# CVE-2026-56288: NULL Pointer Dereference in GNU patch

> An attacker can cause a denial of service in GNU patch by providing a specially crafted unified-diff file that triggers a NULL pointer dereference.

- **Severity:** Medium 4.6 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 9 Jul 2026
- **Updated:** 9 Jul 2026
- **Also known as:** AZL-92154, DEBIAN-CVE-2026-56288, ECHO-4701-db72-1af3, GHSA-m3j2-9m66-r96h, JLSEC-2026-1260, RHSA-2026:38019, UBUNTU-CVE-2026-56288

## What is CVE-2026-56288?

CVE-2026-56288 is a medium-severity vulnerability in GNU patch, published on 9 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official 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

Weakness: CWE-476 (NULL Pointer Dereference)

## Which versions are affected by CVE-2026-56288?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `patch` | Red Hat:hummingbird:1 | All versions | 0:2.8-4.3.hum1 |

Products: Gnu Patch.

## How do I fix CVE-2026-56288?

Apply the vendor's patch.

## Is CVE-2026-56288 being exploited?

There is no known exploitation of CVE-2026-56288 in the wild and no public exploit code.

## Other vulnerabilities in GNU patch

- [CVE-2018-20969](https://insights.sbomify.com/CVE-2018-20969/): Command injection in n/a (high 7.8)
- [CVE-2018-6952](https://insights.sbomify.com/CVE-2018-6952/): Use after free in n/a (high 7.5)
- [CVE-2019-13636](https://insights.sbomify.com/CVE-2019-13636/): Path traversal in n/a (medium 5.9)
- [CVE-2021-45261](https://insights.sbomify.com/CVE-2021-45261/): Null dereference in n/a (medium 5.5)
- [CVE-2019-20633](https://insights.sbomify.com/CVE-2019-20633/): Use after free in n/a (medium 5.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-56288 and fix it if it is affected.

What it is: CVE-2026-56288 is a medium-severity vulnerability in GNU patch, published on 9 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-56288 in the wild and no public exploit code.

Affected product: GNU patch. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-56288/ (Markdown: https://insights.sbomify.com/CVE-2026-56288/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-56288
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-56288
- OSV: https://osv.dev/vulnerability/CVE-2026-56288

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-56288/
Summaries are generated and may contain mistakes; the official description above is the record.
