Vulnerability · Published Jul 9, 2026 · Assigned by CERT-PL

CVE-2026-56289Loop with Unreachable Exit Condition in GNU patch

Medium 4.6

In plain English

A medium-severity infinite loop in patch from GNU. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.1% (higher than 2% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)4.6Medium
Exploit odds (30 days)0.1%top 98.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

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

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.24patch2.8.1-r0ALPINE-CVE-2026-56289
Debian:12patchno fix listedDEBIAN-CVE-2026-56289
Debian:13patchno fix listedDEBIAN-CVE-2026-56289
Debian:14patchno fix listedDEBIAN-CVE-2026-56289
Ubuntu:22.04:LTSpatchno fix listedUBUNTU-CVE-2026-56289
Ubuntu:24.04:LTSpatchno fix listedUBUNTU-CVE-2026-56289
Ubuntu:25.10patchno fix listedUBUNTU-CVE-2026-56289
Ubuntu:26.04:LTSpatchno fix listedUBUNTU-CVE-2026-56289
Ubuntu:26.10patchno fix listedUBUNTU-CVE-2026-56289

Affected products (as reported)

VendorProductVersions
GNU patch 0 – through 2.8.0

Weakness: CWE-835 · Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L

References