CVE-2026-56289: GNU patch infinite loop in unified-diff hunk processing

CVE-2026-56289 · Severity: info · CVSS 4.6 · Published 2026-07-09

GNU patch is a standard utility used to apply code changes to files. A vulnerability exists where a maliciously crafted patch file can cause the utility to enter an infinite loop, consuming all available processor power. This results in a denial of service, making the system unresponsive or preventing software updates from completing until the process is manually terminated.

Technologies: Gnu Patch. Vendors: Gnu.

Quick answers

Is CVE-2026-56289 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-56289 being exploited in the wild.
How severe is CVE-2026-56289?
Informational severity, with a CVSS score of 4.6, published 9 July 2026.
Which products and versions are affected?
Gnu Patch All through 2.8.0.
Is there a fix for CVE-2026-56289?
A patch was published on 2026-04-21: Date of fix commit by Paul Eggert Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-56289 attacked?
It is attacked with local access, in an operating system.
Am I affected by CVE-2026-56289?
Check whether you run Gnu Patch at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

GNU patch (through version 2.8.0) contains a Loop with Unreachable Exit Condition (CWE-835) when processing unified-diff input. The vulnerability is rooted in improper validation of hunk line offsets; a specially crafted patch file can specify an extremely large line number, causing the application to enter an infinite loop while attempting to locate the requested position. This results in 100% CPU utilization and process hang. Exploitation requires a user to attempt to apply the malicious patch file locally. The issue has been addressed in commit faba04ef4f2b410257f76c1b9dc85e350929c4b9.

Affected products

  • GNU patch All through 2.8.0

Timeline

  • 2026-07-09: disclosed
  • 2026-07-09: advisory
  • 2026-04-21: patched: Date of fix commit by Paul Eggert

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.