CVE-2026-115207: Patch: filename validation bypass in reversal fallback allows file creation outside the working directory

Published Oct 22, 2026
·
Updated

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.

Other sources

A flaw was found in GNU patch. The reversal fallback in intuitdifftype() in src/pch.c selects a filename from the patch headers without applying the nameisvalid() check that normally rejects absolute paths. A crafted unified diff that appears to delete a nonexistent file, with an absolute filename in both headers and an epoch timestamp for the new file, can trigger automatic reversal when applied with patch -p0 -t. The unvalidated absolute filename reaches the filesystem operations, allowing attacker-controlled file creation outside the working directory with the permissions of the account running patch. Exploitation requires a user or workflow to apply the crafted patch; it does not bypass operating-system filesystem permissions.

— Red Hat

Affected Software

1 affected component
GNU patch

Event History

Oct 22, 2026
Data Sourced
via Red Hat·07:27 AM
DescriptionSeverityAffected Software
CVE Published
via MITRE·10:16 AM
Data Sourced
via MITRE·10:16 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which environments are realistically exposed?

Users or automated workflows that apply attacker-supplied patch files with patch -p0 -t are exposed if the crafted patch triggers automatic reversal. The files can be created with the permissions of the account running patch.

2

What does an attacker need to provide to trigger the behavior?

The attacker needs to persuade a user or workflow to apply a crafted unified diff. The described trigger uses a patch that appears to delete a nonexistent file, includes an absolute filename in both headers, and has an epoch timestamp for the new file.

3

Does successful exploitation bypass filesystem permissions?

No. File creation remains constrained by the operating-system permissions of the user or service account executing patch.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203