Loop with Unreachable Exit Condition in GNU patch
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Active
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and Red Hat. Impact type from CWE-835.
Summary
GNU patch is vulnerable to a denial of service (DoS) due to improper validation of hunk (single block of changes in diff) line offsets in unified-diff input. A specially crafted patch can specify an extremely large line number, causing the application to enter an effectively infinite processing loop while attempting to locate the requested position. This results in excessive CPU consumption and prevents the process from completing. An attacker can trigger this behavior by supplying a malicious patch file, causing the utility to become unresponsive and require manual termination. This issue has been fixed in the commit faba04ef4f2b410257f76c1b9dc85e350929c4b9
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
Remediation
Red Hat 1 advisory
- RHSA-2026:37468 Released 2026-07-10 · Red Hat rating ModerateRed Hat Hardened Images RPMs Security Update
- Red Hat Hardened Images patch-2.8-4.2.hum1@aarch64, patch-2.8-4.2.hum1@src, patch-2.8-4.2.hum1@x86_64
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Hardened Images | Fixed | RHSA-2026:37468 |
Timeline
- 2026-10-02 Threatist record created from CVE-2026-56289
- 2026-10-03 Alias added: GHSA-3m3r-f94v-4mf8
References
More GNU Patch vulnerabilities
- TI-2015-01271 Directory traversal vulnerability in GNU patch versions which support Git-style patching… CVSS 3.0HIGH 7.5
- TI-2018-05076 A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6. CVSS 3.0HIGH 7.5
- TI-2018-05075 An issue was discovered in GNU patch through 2.7.6. CVSS 3.0HIGH 7.5
- TI-2018-15808 GNU Patch version 2.7.6 contains an input validation vulnerability when processing patch… CVSS 3.0HIGH 7.8
- TI-2019-10248 GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited… CVSS 3.0HIGH 7.8
- TI-2018-14931 do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a… CVSS 3.0HIGH 7.8
Sources
- CVE-2026-56289 · CVE Program
- CVE-2026-56289 · NVD
- FIRST EPSS
- GHSA-3m3r-f94v-4mf8 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-56289 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences