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
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| 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.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | patch | No fix yet | — |
| Debian 13 | patch | No fix yet | — |
| Debian 12 | patch | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Hardened Images 1 | patch | 2.8-4.2.hum1 | RHSA-2026:37468 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | patch | 2.8.1-r0 | — |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | patch | 2.7.6-10 | — |
Advisories 10
- RHSA-2026:37468 Red Hat Security Advisory: Red Hat Hardened Images RPMs Security Update Red Hat Security Advisories (RHSA) · Oct 17, 2026
- WID-SEC-2026-2274 patch: Mehrere Schwachstellen ermöglichen Denial of Service BSI CERT-Bund (WID) · Oct 11, 2026
- SUSE-SU-2026:23210-1 Security update for patch SUSE / openSUSE Security Updates · Aug 26, 2026
- SUSE-SU-2026:22905-1 Security update for patch SUSE / openSUSE Security Updates · Jul 28, 2026
- SUSE-SU-2026:3161-1 Security update for patch SUSE / openSUSE Security Updates · Jul 22, 2026
- SUSE-SU-2026:22651-1 Security update for patch SUSE / openSUSE Security Updates · Jul 17, 2026
- SUSE-SU-2026:22604-1 Security update for patch SUSE / openSUSE Security Updates · Jul 16, 2026
- openSUSE-SU-2026:21332-1 Security update for patch SUSE / openSUSE Security Updates · Jul 15, 2026
- SUSE-SU-2026:2922-1 Security update for patch SUSE / openSUSE Security Updates · Jul 15, 2026
- openSUSE-SU-2026:11260-1 patch-2.8-3.1 on GA media SUSE / openSUSE Security Updates · Jul 13, 2026