Fedora Account System
Red Hat Associate
Red Hat Customer
A flaw was found in GNU patch. The reversal fallback in intuit_diff_type() in src/pch.c selects a filename from the patch headers without applying the name_is_valid() 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.
Fixed in patch-2.8.1.
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2026:96215 https://access.redhat.com/errata/RHSA-2026:96215
This issue has been addressed in the following products: Red Hat Enterprise Linux 9.8 Extended Update Support Via RHSA-2026:99161 https://access.redhat.com/errata/RHSA-2026:99161
This issue has been addressed in the following products: Red Hat Enterprise Linux 10.2 Extended Update Support Via RHSA-2026:102252 https://access.redhat.com/errata/RHSA-2026:102252
This issue has been addressed in the following products: Red Hat Enterprise Linux 10 Via RHSA-2026:102274 https://access.redhat.com/errata/RHSA-2026:102274