GNU gawk
CVE-2026-40468
LOW
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply crafted numeric input
-
DeliveryFeed to vulnerable gawk process
-
ExploitTrigger integer overflow in builtin.c
-
ExecutionCorrupt heap allocation metadata
-
PersistOverwrite heap objects with attacker bytes
-
ImpactCause memory exhaustion or partial integrity compromise
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
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 that gawk processes attacker-controlled input containing carefully crafted numeric arguments capable of triggering the integer overflow in builtin.c - this is reflected by the CVSS 4.0 AT:P (Attack Requirements: Present) metric, indicating specific conditions must be met rather than a default-exploitable configuration. The attack vector is local (AV:L), meaning the malicious input must be processed on the target system, either by direct invocation of gawk by the attacker or by a local/server-side script that feeds external data into gawk. No authentication is required to run gawk (PR:N), and no user interaction is needed beyond the script or process that invokes gawk (UI:N). Exploitation is limited to gawk versions 5.4.0 and below. The primary limiting factor is the requirement for attacker-controlled numeric input to reach the vulnerable built-in function code path - systems where gawk only processes trusted, internally generated data are not realistically at risk. |
| Impact | Real-world risk is low to moderate in isolation but warrants patching where gawk processes untrusted external input. The CVSS 4.0 score of 2.1 reflects local-only exploitation (AV:L), the presence of attack prerequisites (AT:P), and limited impact (VI:L, VA:L, SA:L). There is no KEV listing and no public exploit code identified at time of analysis, further suppressing urgency. The risk is elevated in environments where gawk is used in automated pipelines or server-side scripts that ingest attacker-controlled data, because the local attack vector (AV:L) does not preclude remote-origin malicious input being processed locally. The heap overwrite primitive described in the advisory introduces a theoretical path to further exploitation beyond DoS, though the current scoring does not reflect code execution. EPSS data was not provided; given the low CVSS score and no public exploit, exploitation probability is presumed low. The primary risk scenario is availability disruption (memory exhaustion) rather than system compromise. |
| Exploit ScenarioDerived | An attacker supplies a crafted input file or stream containing specific numeric values that, when passed to a gawk built-in function, trigger an integer overflow in builtin.c. The overflowed value corrupts heap allocation size calculations, causing gawk to either exhaust memory or write attacker-controlled bytes into adjacent heap metadata. In environments where gawk is invoked by server-side scripts processing user-uploaded content, this can be triggered without direct shell access. No public exploit code identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 13, 2026
Integer overflow in GNU gawk's builtin.c (versions 5.4.0 and below) enables heap metadata corruption and memory exhaustion when gawk processes attacker-crafted input. The flaw stems from a CWE-190 integer wraparound condition that can be triggered locally to overwrite heap objects with attacker-controlled bytes, potentially escalating from a denial-of-service to memory corruption with partial integrity impact. No public exploit identified at time of analysis, and CERT-PL reported this with a low CVSS 4.0 base score of 2.1, reflecting a limited, local attack surface with specific attack prerequisites.
RemediationAI
Vendor-released patch: upstream fix committed to the GNU gawk Savannah repository (commit 062f2f2581b991362c046f7f2e238ffa34e6f8c7), available at https://cgit.git.savannah.gnu.org/cgit/gawk.git/commit/?id=062f2f2581b991362c046f7f2e238ffa34e6f8c7. Users should upgrade to a distribution-packaged release that includes this commit, or build gawk from source at a revision equal to or newer than this commit. A patched tagged release version was not independently confirmed from the available reference data. As a compensating control where patching is not immediately possible, restrict gawk-based scripts from processing untrusted external data - specifically, audit pipelines where attacker-influenced input is passed to gawk without sanitization of large numeric arguments to built-in functions. Disabling or sandboxing (e.g., via seccomp or containers) scripts that call gawk on untrusted input limits the blast radius of exploitation.
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
GNU gawk (GNU awk) is the GNU Project's implementation of the AWK text-processing language, widely installed on Linux and Unix systems as a core scripting utility. The vulnerability resides in builtin.c, the source file implementing gawk's built-in functions (e.g., length, substr, split). CWE-190 (Integer Overflow or Wraparound) describes a condition where arithmetic on integer values exceeds the type's bounds, causing the result to wrap around unexpectedly. In gawk's context, an overflowing integer used in memory allocation or indexing calculations can result in an undersized heap allocation, subsequently enabling heap metadata corruption when oversized data is written into the allocated region. The affected CPE is cpe:2.3:a:gnu:gawk:*:*:*:*:*:*:*:* covering all gawk versions through 5.4.0. The upstream fix is available via a named commit on the GNU Savannah git repository.
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
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:L
Local tool with attack prerequisites (AT:P maps to AC:H); any user can run gawk (PR:N); no confidentiality impact; limited integrity and availability.
Primary rating from Vendor (CERT-PL).
CVSS VectorVendor: CERT-PL
DescriptionCVE.org
Integer overflow vulnerability has been found in "builtin.c" program file of gawk. This issue may lead to memory exhaustion on the hosting operating system and could be used to overwrite gawk heap metadata and objects with attacker-controlled bytes. It affects gawk in versions 5.4.0 and below.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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.
Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.
Affected Products (CPE)CVE.org
A heap out-of-bounds read flaw was found in builtin.c in the gawk package. Rated high severity (CVSS 7.1), this vulnerab
Stack-based buffer overflow in gawk's readdir extension (extension/readdir.c, ftype() routine) affects all gawk releases
Integer overflow in gawk's do_sub() routine (builtin.c) enables heap metadata corruption on 32-bit builds, crashing the
Use-after-free memory corruption in gawk's do_getline_redir() routine within io.c allows a local attacker to crash the g
NVD
CVE.org
EPSS
Vulnrichment
VulDB
GitHub PoC
Exploit-DB