CVE-2026-40467
Analyzed Analyzed - Analysis Complete

Use After Free in gawk io.c do_getline_redir()

Vulnerability report for CVE-2026-40467, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-13

Last updated on: 2026-07-14

Assigner: CERT.PL

Description

Use After Free vulnerability has been found in "io.c" program file of gawk (do_getline_redir() routine). This issue may lead to a crash. It affects gawk in versions 5.4.0 and below.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-13
Last Modified
2026-07-14
Generated
2026-08-02
AI Q&A
2026-07-14
EPSS Evaluated
2026-08-01
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
fossies gawk to 5.4.0 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-416 The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-40467 is a Use After Free vulnerability found in the GNU gawk software. It specifically affects the io.c program file within the do_getline_redir() routine. A Use After Free vulnerability occurs when a program continues to use memory after it has been freed, which can lead to unpredictable behavior, crashes, or exploitation by attackers.

In this case, the vulnerability is triggered in the do_getline_redir() function, which handles redirection for getline operations in gawk. Improper handling of the redir_exp variable can lead to a crash. The issue affects gawk versions 5.4.0 and below.

  • The vulnerability was discovered by Michał Majchrowicz and Marcin Wyczechowski from AFINE.
  • A fix was implemented in gawk version 5.4.1, which includes proper cleanup of the redir_exp variable and additional checks to prevent memory leaks.
Detection Guidance

Detecting CVE-2026-40467 on your system involves checking the installed version of gawk and looking for signs of exploitation or crashes related to the do_getline_redir() routine in io.c.

  • Check the installed version of gawk using the command: gawk --version. If the version is 5.4.0 or below, your system is vulnerable.
  • Review system logs for crashes or unexpected terminations of gawk processes, particularly those involving file redirection operations.
  • Use debugging tools like gdb to attach to running gawk processes and monitor for memory corruption or use-after-free errors in the do_getline_redir() function.
  • Inspect network traffic or system calls for unusual patterns that might indicate exploitation attempts, such as malformed input files or unexpected redirections.
Impact Analysis

The impact of this vulnerability depends on how you use gawk and the environment in which it operates.

  • If you are running gawk version 5.4.0 or below, this vulnerability could cause the program to crash unexpectedly. This may disrupt scripts or processes that rely on gawk for text processing or data manipulation.
  • While the CVSS v3.1 score indicates a high severity (7.5) for availability impact, it does not suggest direct impacts on confidentiality or integrity. However, a crash could still lead to denial of service in automated systems or workflows.
  • In certain scenarios, a Use After Free vulnerability could potentially be exploited to execute arbitrary code, though this specific CVE does not provide evidence of such exploitation.

If you are using gawk in a critical system, such as log processing, data transformation, or automation pipelines, this vulnerability could cause downtime or require manual intervention to restore functionality.

Compliance Impact

The impact of this vulnerability on compliance with standards and regulations depends on the context in which gawk is used and the data it processes.

  • GDPR: If gawk is used to process personal data of EU citizens, a crash or denial of service caused by this vulnerability could disrupt data processing workflows. While the vulnerability itself does not directly lead to data exposure, prolonged downtime or loss of data availability could be considered a violation of GDPR's requirements for data availability and resilience (Article 32).
  • HIPAA: For organizations handling protected health information (PHI), this vulnerability could pose risks if gawk is used in systems processing or analyzing PHI. A crash could disrupt critical healthcare operations, potentially violating HIPAA's requirements for ensuring the availability and integrity of electronic PHI (ePHI). However, since the vulnerability does not directly expose or alter data, the risk is primarily related to system availability.
  • Other standards: Compliance frameworks like ISO 27001 or NIST SP 800-53 emphasize the importance of system integrity and availability. A vulnerability that causes crashes or denial of service could be seen as a failure to maintain these security objectives, potentially leading to non-compliance if not addressed promptly.

To mitigate compliance risks, organizations should update gawk to version 5.4.1 or later, as the vulnerability has been fixed in this release.

Mitigation Strategies

To mitigate CVE-2026-40467, follow these immediate steps:

  • Upgrade gawk to version 5.4.1 or later, as this version contains the fix for the vulnerability. The upgrade can be done using your system's package manager (e.g., apt, yum, dnf) or by compiling from source.
  • If upgrading is not immediately possible, restrict the use of gawk in environments where untrusted input is processed, especially with file redirections.
  • Monitor gawk processes for crashes or unusual behavior, and implement logging to track potential exploitation attempts.
  • Apply network-level protections, such as firewalls or intrusion detection systems, to block or alert on suspicious activity targeting gawk processes.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-40467. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart