CVE-2026-56288: GNU Patch NULL Pointer Dereference DoS Vulnerability
GNU patch, a widely-used utility for applying code changes, contains a flaw that can be triggered by a specially crafted patch file. When the tool processes consecutive newline markers at the end of a file in an unexpected way, it can crash instead of applying the patch. An attacker who can supply a malicious patch file to a user or system running patch could exploit this to disrupt workflow or prevent legitimate patching operations.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.5 MEDIUM · CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- Weaknesses (CWE)
- CWE-476
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-09 / 2026-07-13
NVD description (verbatim)
GNU patch is vulnerable to a NULL pointer dereference when processing a specially crafted unified-diff patch file. Improper handling of consecutive end-of-file newline markers can corrupt internal hunk (single block of changes in diff) data structures, causing the application to pass a NULL pointer to fwrite() during patch processing. An attacker can trigger this condition with a malicious patch file, causing the utility to crash and resulting in a denial of service. This issue has been fixed in the commit e6d6a4e021660679d7fc9150f981d4920f722313
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-56288 is a NULL pointer dereference vulnerability in GNU patch stemming from improper handling of end-of-file newline sequences in unified-diff format patch files. During hunk data structure processing, consecutive EOF newline markers can corrupt internal state, causing a NULL pointer to be passed to fwrite(). This results in an unhandled null dereference and application crash. The vulnerability is rooted in CWE-476 (NULL pointer dereference) and has been remediated in commit e6d6a4e021660679d7fc9150f981d4920f722313.
Business impact
The primary business impact is denial of service: a malicious or compromised patch file can cause patch to crash, interrupting automated patching workflows, CI/CD pipelines, or manual code maintenance. Organizations relying on patch as part of security update deployment or software development processes could experience operational delays. However, because the vulnerability requires local or indirect file-based attack vectors and produces only a crash (not code execution), the blast radius is constrained compared to memory corruption vulnerabilities.
Affected systems
GNU patch in all versions prior to the fix commit are affected. Any system or user account with patch installed and privileges to execute it is potentially at risk. This includes Linux distributions that package GNU patch, embedded systems using patch for firmware updates, and development environments where patch is part of the build or update toolchain. Version numbers and specific affected releases should be verified against vendor advisories and distribution-specific security bulletins.
Exploitability
Exploitability is moderate. The CVSS 3.1 score of 5.5 (MEDIUM) reflects that the attack vector is local, requires low privileges, and does not require user interaction beyond executing patch with a crafted input file. An attacker must already have the ability to place or control a patch file on the target system, or trick a user into applying a malicious patch. Remote exploitation would require an upstream injection point (e.g., a compromised patch repository or man-in-the-middle scenario). The vulnerability does not enable privilege escalation or data exfiltration—impact is limited to availability disruption.
Remediation
Apply a patch or update from your GNU patch vendor or Linux distribution that includes commit e6d6a4e021660679d7fc9150f981d4920f722313 or later. Most major distributions (Debian, Red Hat, Ubuntu, etc.) will release patched packages; users should check their package management system for available updates. Verify the patched version number against the vendor advisory before deployment. Until patched, restrict file-based inputs to patch to known, trusted sources and consider sandboxing patch execution in untrusted workflows.
Patch guidance
1. Check your current GNU patch version: run 'patch --version'. 2. Consult your Linux distribution's security bulletin (Debian, Red Hat, Ubuntu, etc.) for the patched version number specific to your platform. 3. Update via your package manager (apt, yum, dnf, etc.). 4. Verify the updated version no longer exhibits the vulnerability by re-running 'patch --version' and confirming it matches the vendor's released version. 5. Test patch functionality on non-critical systems first if possible.
Detection guidance
Log and alert on unexpected patch utility crashes, particularly when patch processes files from external or untrusted sources. Monitor for error messages referencing NULL pointer dereferences or segmentation faults from patch processes. In SIEM or log aggregation systems, look for process exit codes indicating abnormal termination (e.g., signal 11 for SIGSEGV). Endpoint detection and response (EDR) tools can flag repeated crash patterns. Implement file integrity monitoring on patch files in version control or patch repositories to detect injection of malformed unified-diff content.
Why prioritize this
Prioritize this vulnerability for patching because: (1) GNU patch is a fundamental utility with broad distribution across Linux systems and development environments, (2) Although the CVSS score is MEDIUM, denial of service in patch workflows can cascade to delay critical security updates or system maintenance, (3) It is not on the CISA KEV list, meaning it has not yet been widely exploited in the wild, providing a window for proactive remediation before threat actors develop automated tools, (4) Exploitation is relatively simple (craft a malicious patch file), making it suitable for adversaries who have supply-chain or file-injection capabilities.
Risk score, explained
The CVSS 3.1 score of 5.5 (MEDIUM) reflects: AV:L (local attack vector—attacker must place file on target or user must run patch locally), AC:L (low complexity—no special conditions), PR:L (low privilege—any user with patch execution rights), UI:N (no user interaction beyond running patch), S:U (impact is to the application process scope, not system-wide), C:N (no confidentiality loss), I:N (no integrity loss), A:H (high availability impact via crash). The score does not account for supply-chain amplification (a single malicious patch file distributed through a repository could affect many systems) but reflects single-system worst-case risk.
Frequently asked questions
Can this vulnerability lead to remote code execution?
No. The vulnerability is a denial-of-service crash, not a memory corruption flaw that enables arbitrary code execution. The NULL pointer dereference causes patch to exit abnormally, disrupting workflow but not enabling an attacker to run commands or access data.
Do I need to patch this immediately if I use patch?
It depends on your threat model. If patch is used primarily by trusted developers on internally-managed systems, risk is lower. If patch is part of an automated CI/CD pipeline or processes files from external sources (e.g., patch repositories, user uploads), patching should be prioritized within 2–4 weeks. The vulnerability is not yet on the CISA Known Exploited Vulnerabilities list, but that status can change.
How can I tell if a patch file might be malicious?
Inspect patch files for anomalies: unusual numbers of consecutive newlines at the end of hunks, very large or truncated file sections, or patches from unexpected sources. Use version control and signed patch distributions where possible. Validate patches in a controlled environment or with formal patch review processes before applying to production systems.
What versions of GNU patch are affected?
All versions prior to the fix commit e6d6a4e021660679d7fc9150f981d4920f722313 are potentially affected. Verify the exact patched version number from your distribution's security advisory—version numbering varies across vendors (Debian, Red Hat, Ubuntu, etc.). Check 'patch --version' and compare against your vendor's release notes.
This analysis is based on publicly available vulnerability data as of the publication date. CVSS scores, affected versions, and patch information reflect the source advisory; users must verify specific version numbers and patch applicability against their vendor's official security bulletins. No exploit code or weaponized proof-of-concept is provided. This summary does not constitute legal or professional security advice; organizations should conduct their own risk assessment and coordinate patching with their change management and incident response procedures. Information and recommendations are provided 'as is' without warranty. For authoritative guidance, consult the GNU patch project, your Linux distribution's security team, or your organization's security policy. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2025-55639MEDIUMGPAC MP4Box NULL Pointer Dereference Denial of Service
- CVE-2025-55641MEDIUMNULL Pointer Dereference in GPAC MP4Box v2.4 Denial of Service
- CVE-2025-55643MEDIUMGPAC MP4Box NULL Pointer DoS Vulnerability
- CVE-2025-55649MEDIUMGPAC MP4Box NULL Pointer DoS Vulnerability
- CVE-2025-55651MEDIUMGPAC MP4Box NULL Pointer Dereference DoS Vulnerability
- CVE-2025-55659MEDIUMGPAC MP4Box NULL Pointer Denial of Service
- CVE-2025-55663MEDIUMMP4Box Segmentation Fault DoS Vulnerability – GPAC v2.4
- CVE-2025-60473MEDIUMMP4Box Null Pointer DoS Vulnerability – GPAC Patching Guide