Description
GNU patch is vulnerable to a NULL pointer dereference when processing a specially crafted unified-diff patch file. Improper handling of consecutive end-of-file newline markers can corrupt internal hunk (single block of changes in diff) data structures, causing the application to pass a NULL pointer to fwrite() during patch processing.
An attacker can trigger this condition with a malicious patch file, causing the utility to crash and resulting in a denial of service.
This issue has been fixed in the commit e6d6a4e021660679d7fc9150f981d4920f722313
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.3.hum1 | RHSA-2026:38019 |
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:38019 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