---
id: "CVE-2026-115207"
kind: "vulnerability"
aliases: ["CVE-2026-115207"]
title: "GNU patch: crafted patch file creates files outside the working directory"
severity: "medium"
cvss: 5.5
epss: 0.0013
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["ci-pipelines", "gnu-patch", "linux", "package"]
not_affected_if: ["patch-files-trusted-only"]
published_at: "2026-10-22T11:17:50+00:00"
first_seen_at: "2026-10-23T21:57:30+00:00"
updated_at: "2026-10-25T04:10:44+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115207", "first_seen_at": "2026-10-23T21:57:30+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-115207", "first_seen_at": "2026-10-24T07:15:51+00:00"}]
---

# GNU patch: crafted patch file creates files outside the working directory

GNU patch accepts absolute file paths in patch headers during automatic reversal instead of rejecting them. A crafted patch file can make it create files in arbitrary locations with the permissions of the user running it.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- `patch --version` to see the installed GNU patch version, then compare it against the fixed release in the NVD entry (unknown in the sources)
- Check whether any build, CI or deploy job runs `patch` on patch files from outside the team

## Fix

- Upgrade GNU patch to a release that includes the fix (the fixed version is unknown in the sources)
- Until then, only apply patch files from trusted sources and run patch in a throwaway directory

## Timeline

- 2026-10-23T21:57:30+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-115207
- 2026-10-24T07:15:51+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-115207

## From the sources

A flaw was found in GNU patch. An attacker can achieve arbitrary file creation outside the intended working directory by enticing a user or automated workflow to apply a specially crafted patch file. Due to missing validation during automatic patch reversal, absolute file paths in patch headers are accepted rather than rejected. Consequently, the utility can create files in arbitrary locations with the permissions of the executing user.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
