Skip to main content

GNU gawk CVE-2026-40553

MEDIUM
Stack-based Buffer Overflow (CWE-121)
2026-07-13 CERT-PL
5.1
CVSS 4.0 · Vendor: CERT-PL
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain local system access
  2. Delivery
    Invoke gawk with readdir extension enabled
  3. Exploit
    Supply crafted directory input targeting ftype()
  4. Execution
    Overflow stack-allocated buffer
  5. Impact
    Crash gawk process or attempt control-flow hijack

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Stack buffer bounds checking
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires local access to a system running gawk 5.4.0 or below with the readdir extension compiled and in active use. The ftype() routine must be reached, which occurs when gawk processes directory entries through that extension. The CVSS 4.0 vector (PR:N) indicates no elevated privileges are required - any user able to execute gawk and supply crafted input can trigger the overflow. Code execution feasibility is limited by stack hardening mitigations (canaries, ASLR, NX) and has not been demonstrated. Remote exploitation is not applicable per the AV:L vector; a network-exposed attack path would require an intermediary service that invokes gawk on attacker-controlled input.

Impact

The CVSS 4.0 score of 5.1 with AV:L reflects a strictly local attack surface, which substantially limits real-world exposure compared to network-reachable vulnerabilities. Integrity and availability impacts are rated low (VI:L, VA:L), and there is no confidentiality impact (VC:N). The provided vector records low subsequent-system impact (SC:L/SI:L/SA:L), plausible when gawk is embedded in automated or privileged pipeline scripts whose failure cascades to downstream processes. No EPSS data was supplied, and KEV status is absent from the input, indicating no confirmed active exploitation. The RCE tag is present but explicitly unconfirmed by CERT-PL, so the operational risk should be treated as crash-level until evidence of code execution emerges. The combination of local-only attack vector, low individual impact ratings, and unconfirmed RCE makes this a low-to-moderate urgency finding for most organizations; systems where gawk processes untrusted input inside privileged or automated contexts warrant faster remediation.

Exploit ScenarioDerived

A local user supplies crafted directory input or invokes a gawk script that exercises the readdir extension's ftype() routine, triggering a write past the stack buffer boundary. In the most reliably demonstrated outcome, this crashes the gawk process and disrupts any pipeline depending on it. In a more sophisticated attempt leveraging favorable stack layout or absent hardening, an attacker might attempt to redirect execution, though this code-execution path has not been confirmed as feasible by the researcher.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 13, 2026

Stack-based buffer overflow in gawk's readdir extension (extension/readdir.c, ftype() routine) affects all gawk releases through version 5.4.0, enabling a local attacker to crash the process and theoretically achieve code execution. The RCE angle is explicitly unconfirmed by the reporter (CERT-PL), making denial-of-service the primary demonstrated impact at this time. No public exploit identified at time of analysis; an upstream source-level patch commit is available on GNU Savannah.

RemediationAI

Monitor your Linux distribution's package feed for an updated gawk package that incorporates the upstream fix commit (https://cgit.git.savannah.gnu.org/cgit/gawk.git/commit/?id=cca0366144336b49aaa7d5d949966ce8e2c70843) and apply it as soon as available. The CERT-PL advisory at https://cert.pl/en/posts/2026/07/CVE-2026-40467 should be reviewed for any additional researcher guidance. If a packaged update is not yet available and gawk is used to process externally-supplied or untrusted directory paths, consider restricting execution of gawk in those pipelines as a compensating control - be aware that disabling readdir-extension-dependent scripts will break any gawk programs that enumerate directories using that extension. No exact patched release version number was confirmed in the available data; do not infer a specific version beyond what is stated here.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

gawk is the GNU Project's implementation of the AWK text-processing language, shipped by default on virtually every major Linux distribution. CWE-121 (Stack-based Buffer Overflow) identifies the root cause: the ftype() function inside extension/readdir.c writes data beyond the bounds of a stack-allocated buffer. The readdir extension provides directory-traversal capabilities to gawk scripts, and ftype() classifies filesystem entry types within that extension. Because the overflowed buffer resides on the stack, adjacent frame data - including saved return addresses - may be corrupted, creating the theoretical potential for control-flow hijack. This path is constrained in practice by modern mitigations such as stack canaries, ASLR, and NX. CPE cpe:2.3:a:gnu:gawk:*:*:*:*:*:*:*:* covers all gawk variants through 5.4.0.

Know when Gawk gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (CERT-PL) PRIMARY 5.1 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:L/SI:L/SA:L
vuln.today AI 5.1 MEDIUM

Local vector because gawk is a CLI tool; PR:N since any local user can run it; no confidentiality impact; low integrity and availability from crash and potential stack corruption.

3.1 AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
4.0 AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 6.2 MEDIUM

Primary rating from Vendor (CERT-PL).

CVSS VectorVendor: CERT-PL

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
Low

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.3%
Top 79% exploitable
Prevalence
High
default install on most Linux distributions worldwide
Social Media
2
Sightings
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment MSRC Vendor CIRCL VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

A stack-based buffer overflow occurs when a program writes more data to a buffer located on the stack than it was allocated to hold.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

cpe:2.3:a:gnu:gawk:*:*:*:*:*:*:*:*

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Micro 5.3 Affected
SUSE Linux Enterprise Micro 5.4 Affected
SUSE Linux Enterprise Micro 5.5 Affected
SUSE Linux Enterprise Module for Basesystem 15 SP7 Affected
SUSE Linux Enterprise Server 15 SP7 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy