CVE-2026-40553
Analyzed Analyzed - Analysis Complete

Buffer Overflow in GNU Awk (gawk) via ftype() Routine

Vulnerability report for CVE-2026-40553, 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

Buffer overflow vulnerability has been found in "extension/readdir.c" program file of gawk (ftype() routine). This issue could be used to crash the program and potentially to achieve code execution, although the latter has not been confirmed to be feasible. 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-121 A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-40553 is a buffer overflow vulnerability found in the gawk (GNU Awk) software, specifically in the ftype() routine within the extension/readdir.c program file. This issue occurs when the program improperly handles path concatenation, potentially allowing a buffer overflow if the combined directory and filename path exceeds the allocated buffer size.

The vulnerability can cause the gawk program to crash. While it has not been confirmed, there is a potential risk of achieving arbitrary code execution due to the buffer overflow. The issue affects gawk versions 5.4.0 and below.

  • Location: extension/readdir.c, ftype() routine.
  • Root cause: Improper handling of path concatenation using sprintf(), leading to buffer overflow.
  • Impact: Program crash; potential (unconfirmed) code execution.
  • Affected versions: gawk 5.4.0 and below.
Detection Guidance

To detect the presence of the vulnerable gawk version on your system, you can check the installed version of gawk. The vulnerability affects gawk versions 5.4.0 and below.

  • Use the following command to check the gawk version: gawk --version

If the output shows a version number of 5.4.0 or lower, your system is vulnerable. For example, if the output is 'GNU Awk 5.4.0', the system is affected.

Additionally, you can inspect the source code or binaries for the presence of the vulnerable code in extension/readdir.c, specifically looking for unsafe sprintf() usage in the ftype() routine. However, this requires access to the source code or debugging symbols.

Impact Analysis

This vulnerability can impact you in several ways, depending on how you use gawk:

  • Program crashes: If you run gawk with maliciously crafted input (e.g., directory or filenames designed to trigger the overflow), the program may crash unexpectedly. This could disrupt scripts or workflows that rely on gawk.
  • Potential code execution: While not confirmed, the buffer overflow could theoretically allow an attacker to execute arbitrary code on your system. This would grant them control over the affected process, potentially leading to further compromise.
  • Data integrity risks: If gawk is used to process sensitive data (e.g., logs, configuration files, or user input), a crash or code execution could corrupt or expose that data.
  • System stability: Repeated crashes or exploitation attempts could degrade system performance or cause instability in environments where gawk is heavily used.

The impact is more severe if gawk is used in automated scripts, batch processing, or environments where untrusted input is processed (e.g., web applications, data pipelines).

Compliance Impact

This vulnerability could affect compliance with common standards and regulations in the following ways:

  • GDPR (General Data Protection Regulation): If gawk is used to process personal data of EU citizens, a buffer overflow leading to crashes or potential code execution could result in unauthorized access or data corruption. This may violate GDPR requirements for data integrity (Article 5(1)(f)) and security of processing (Article 32). A breach could also trigger reporting obligations under Article 33.
  • HIPAA (Health Insurance Portability and Accountability Act): If gawk is used in healthcare systems to process protected health information (PHI), the vulnerability could compromise the confidentiality or integrity of PHI. This would violate the HIPAA Security Rule (45 CFR Part 164, Subpart C), which mandates safeguards for electronic PHI. A breach could require notification under the HIPAA Breach Notification Rule (45 CFR Part 164, Subpart D).
  • PCI DSS (Payment Card Industry Data Security Standard): If gawk is used in payment processing environments, the vulnerability could expose cardholder data to unauthorized access or corruption. This would violate PCI DSS requirements for secure software development (Requirement 6) and system integrity (Requirement 11).
  • NIST SP 800-53: The vulnerability may violate controls related to system and information integrity (SI family), such as SI-10 (Information Input Validation) and SI-15 (Information Output Filtering). Organizations following NIST guidelines would need to address the vulnerability to maintain compliance.
  • ISO/IEC 27001: The vulnerability could impact Annex A controls, particularly A.12.2 (Protection from malware), A.12.6 (Technical vulnerability management), and A.14.2 (Security in development and support processes). Failure to address it could result in non-conformity with the standard.

To maintain compliance, organizations should patch the vulnerability promptly, assess whether any sensitive data was exposed or corrupted, and document remediation efforts as part of their risk management processes.

Mitigation Strategies

The following steps can be taken to mitigate the vulnerability:

  • Upgrade gawk to version 5.4.1 or later, as the vulnerability has been fixed in this version. This is the most effective mitigation.
  • If upgrading is not immediately possible, restrict access to gawk and avoid processing untrusted input, especially directory listings or files that could trigger the buffer overflow in the ftype() routine.
  • Monitor systems for unusual crashes or behavior in gawk, as this could indicate exploitation attempts.

For systems where gawk is not critical, consider disabling or removing it until an upgrade can be performed.

Chat Assistant

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

EPSS Chart