Skip to main content

GNU gawk CVE-2026-40467

MEDIUM
Use After Free (CWE-416)
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 access or script injection point
  2. Delivery
    Craft AWK script with getline I/O redirection
  3. Exploit
    Submit script to vulnerable gawk (≤5.4.0)
  4. Execution
    Trigger use-after-free in do_getline_redir()
  5. Impact
    gawk process crashes (DoS)

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

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

Exploitation Conditions

Exploitation requires the ability to execute or influence an AWK script processed by a vulnerable version of gawk (5.4.0 or below) on the local system, specifically one that exercises the getline I/O redirection functionality handled by the do_getline_redir() routine in io.c. The local attack vector (AV:L) means direct remote exploitation without prior local access is not possible. The limiting factors are: (1) local access or script injection capability is required; (2) the AWK script must use a getline redirection construct to reach the vulnerable code path; (3) the outcome is limited to a process crash - no code execution or data disclosure has been demonstrated. Standard gawk usage not involving getline redirection is not expected to trigger this flaw.

Impact

The CVSS 4.0 score of 5.1 (Medium) with vector AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N accurately characterizes this as a low-impact, locally-triggered denial-of-service issue. The local attack vector (AV:L) is the primary limiting factor - remote exploitation is not possible without the ability to influence AWK scripts or input processed by gawk on the target system. The absence of confidentiality (VC:N) and integrity (VI:N) impacts in the CVSS vector, corroborated by the 'crash' description and DoS tags, significantly reduces operational risk. No EPSS data was provided; however, the local-only vector, crash-only impact, and absence from CISA KEV all point to this being a low exploitation-likelihood finding. No public proof-of-concept has been identified at time of analysis. This is a real but low-priority vulnerability for most environments - elevated priority only where gawk is used to process untrusted AWK scripts in automated or multi-tenant pipelines.

Exploit ScenarioDerived

An attacker with local shell access, or the ability to supply a crafted AWK script to an automated pipeline running gawk, provides input that exercises the getline I/O redirection code path in do_getline_redir(). The use-after-free is triggered, causing gawk to crash and disrupting any dependent process or pipeline. No public proof-of-concept exploit code has been identified at time of analysis.

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

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

Alert me

AnalysisAIv1 – Jul 13, 2026

Use-after-free memory corruption in gawk's do_getline_redir() routine within io.c allows a local attacker to crash the gawk process, causing a denial of service. All gawk versions 5.4.0 and below are affected, as confirmed by CERT-PL and an upstream patch commit. No active exploitation has been identified (not in CISA KEV), and the impact is confined to availability - no confidentiality or integrity effects have been demonstrated.

RemediationAI

Apply the upstream patch available via commit a2d18c74109e41bec29a23098eba2e00057286d8 in the GNU gawk repository (https://cgit.git.savannah.gnu.org/cgit/gawk.git/commit/?id=a2d18c74109e41bec29a23098eba2e00057286d8). A formally tagged released version incorporating this fix has not been independently confirmed from available data - monitor the GNU gawk release page and distribution security advisories for a patched package version. For systems where patching is not immediately feasible, restrict execution of untrusted or externally-supplied AWK scripts by gawk, particularly those using getline with I/O redirection; this eliminates the triggerable code path but may break legitimate use cases in log processing or scripting pipelines. Additional guidance is available in the CERT-PL advisory at https://cert.pl/en/posts/2026/07/CVE-2026-40467.

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

The flaw (CWE-416: Use After Free) resides in the do_getline_redir() function in gawk's io.c source file. GNU gawk is the GNU Project's implementation of the AWK text-processing language. Use-after-free vulnerabilities arise when a program dereferences a pointer to heap memory that has already been freed, leading to undefined behavior - typically a crash, and in some cases exploitable memory corruption. The do_getline_redir() function handles getline I/O redirection constructs within AWK scripts, meaning the vulnerable code path is exercised when an AWK program uses getline with input redirection. The CPE cpe:2.3:a:gnu:gawk:*:*:*:*:*:*:*:* with an upper version bound of 5.4.0 covers all prior stable releases distributed by GNU and downstream Linux packagers.

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:N/VA:L/SC:N/SI:N/SA:N
vuln.today AI 4.0 MEDIUM

Local vector requires script execution access; crash-only outcome yields A:L with no confidentiality or integrity impact and unchanged scope.

3.1 AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
4.0 AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
SUSE 4.0 MEDIUM
AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Red Hat 4.0 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
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.2%
Top 88% exploitable
Prevalence
High
gawk ships by default on most Linux distributions
Social Media
2
Sightings
Data Quality
7 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.2%
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

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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