Skip to content
OpenAdvisories
Medium · 4.6 CVE-2026-56289 EUVD-2026-42557GHSA-3m3r-f94v-4mf8

Loop with Unreachable Exit Condition in GNU patch

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

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 products

VendorProductAffectedFixed
GNU patch ≤ 2.8.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 patch No fix yet —
Debian 13 patch No fix yet —
Debian 12 patch No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 patch No fix yet —
Ubuntu 26.04 LTS patch No fix yet —
Ubuntu 25.10 patch No fix yet —
Ubuntu 24.04 LTS patch No fix yet —
Ubuntu 22.04 LTS patch No fix yet —
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS patch No fix yet —
Ubuntu 18.04 LTS patch No fix yet —
Ubuntu 16.04 LTS patch No fix yet —
Ubuntu Pro 14.04 LTS patch No fix yet —
ReleasePackageFixed inAdvisory
Red Hat Hardened Images 1 patch 2.8-4.2.hum1 RHSA-2026:37468
ReleasePackageFixed inAdvisory
SLES 15 SP7 patch 2.7.6-150000.5.12.1 SUSE-SU-2026:3161-1
SLES 12 SP5 patch 2.7.5-8.14.1 SUSE-SU-2026:2922-1
Show 5 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 16.0 patch 2.7.6-160000.4.1 SUSE-SU-2026:22651-1
SLES 16.0 patch 2.7.6-160000.4.1 SUSE-SU-2026:22651-1
SLE Micro 6.2 patch 2.7.6-160000.4.1 SUSE-SU-2026:22604-1
SLE Micro 6.1 patch 2.7.6-slfo.1.1_2.1 SUSE-SU-2026:22905-1
SLE Micro 6.0 patch 2.7.6-4.1 SUSE-SU-2026:23210-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed patch 2.8-3.1 openSUSE-SU-2026:11260-1
openSUSE Leap 16.0 patch 2.7.6-160000.4.1 openSUSE-SU-2026:21332-1
ReleasePackageFixed inAdvisory
Alpine v3.24 patch 2.8.1-r0 —

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 patch 2.7.6-10 —

Advisories 10

References