CVE-2019-13638
published 2019-07-26CVE-2019-13638: GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff…
PriorityP341high7.8CVSS 3.0
AVLACLPRNUIRSUCHIHAH
EPSS
4.53%
90.5th percentile
GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed editor does not need to be present on the vulnerable system. This is different from CVE-2018-1000156.
Affected
30 ranges· showing 25
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | debian_linux | — | — |
| debian | debian_linux | — | — |
| debian | debian_linux | — | — |
| debian | patch | < patch 2.7.6-5 (bookworm) | patch 2.7.6-5 (bookworm) |
| gnu | patch | <= 2.7.6 | — |
| gnu | patch | — | — |
| gnu | patch | >= 0 < 2.7.6-5 | 2.7.6-5 |
| gnu | patch | >= 0 < 2.7.6-5 | 2.7.6-5 |
| gnu | patch | >= 0 < 2.7.6-5 | 2.7.6-5 |
| gnu | patch | >= 0 < 2.7.6-5 | 2.7.6-5 |
| gnu | patch | >= 0 < 2.7.5-1ubuntu0.16.04.2 | 2.7.5-1ubuntu0.16.04.2 |
| gnu | patch | >= 0 < 2.7.6-2ubuntu1.1 | 2.7.6-2ubuntu1.1 |
| gnu | patch | >= 0 < 2.7.1-4ubuntu2.4+esm1 | 2.7.1-4ubuntu2.4+esm1 |
| msrc | azl3_patch_2.7.6-9_on_azure_linux_3.0 | — | — |
| msrc | cbl2_patch_2.7.6-7_on_cbl_mariner_2.0 | — | — |
| msrc | cbl_mariner_1.0_arm | — | — |
| msrc | cbl_mariner_1.0_x64 | — | — |
| msrc | cbl_mariner_2.0_arm | — | — |
| msrc | cbl_mariner_2.0_x64 | — | — |
| msrc | cm1_patch_2.7.6-7_on_cbl_mariner_1.0 | — | — |
| msrc | patch-2.7.6-7.cm1.aarch64.rpm_on_cbl_mariner_1.0_arm | — | — |
| msrc | patch-2.7.6-7.cm1.x86_64.rpm_on_cbl_mariner_1.0_x64 | — | — |
| msrc | patch-2.7.6-7.cm2.aarch64.rpm_on_cbl_mariner_2.0_arm | — | — |
| msrc | patch-2.7.6-7.cm2.x86_64.rpm_on_cbl_mariner_2.0_x64 | — | — |
| msrc | patch-2.7.6-9.azl3.aarch64.rpm_on_azure_linux_3.0_arm | — | — |
CVSS provenance
nvdv3.07.8HIGHCVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
nvdv2.09.3CRITICALAV:N/AC:M/Au:N/C:C/I:C/A:C
osv7.8HIGH
vendor_debian7.8HIGH
vendor_msrc7.8HIGH
vendor_redhat7.8HIGH
vendor_ubuntu5.9MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
GHSA-g5pm-269j-95rr: do_ed_script in pch
ghsa_unreviewed·2022-05-24·CVSS 7.8
CVE-2018-20969 [HIGH] CWE-78 GHSA-g5pm-269j-95rr: do_ed_script in pch
do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638, but the ! syntax is specific to ed, and is unrelated to a shell metacharacter.
GHSA
GHSA-vqpq-8jvg-rwmx: GNU patch through 2
ghsa_unreviewed·2022-05-24·CVSS 7.8
CVE-2019-13638 [HIGH] CWE-78 GHSA-vqpq-8jvg-rwmx: GNU patch through 2
GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed editor does not need to be present on the vulnerable system. This is different from CVE-2018-1000156.
OSV
CVE-2018-20969: do_ed_script in pch
osv·2019-08-16·CVSS 7.8
CVE-2018-20969 [HIGH] CVE-2018-20969: do_ed_script in pch
do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638, but the ! syntax is specific to ed, and is unrelated to a shell metacharacter.
OSV
CVE-2019-13638: GNU patch through 2
osv·2019-07-26·CVSS 7.8
CVE-2019-13638 [HIGH] CVE-2019-13638: GNU patch through 2
GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed editor does not need to be present on the vulnerable system. This is different from CVE-2018-1000156.
OSV
patch vulnerabilities
osv·2019-07-24·CVSS 5.9
CVE-2019-13636 [MEDIUM] patch vulnerabilities
patch vulnerabilities
USN-4071-1 fixed several vulnerabilities in Patch. This update provides
the corresponding update for Ubuntu 14.04 ESM.
Original advisory details:
It was discovered that Patch incorrectly handled certain files.
An attacker could possibly use this issue to access sensitive information.
(CVE-2019-13636)
It was discovered that Patch incorrectly handled certain files.
An attacker could possibly use this issue to execute arbitrary code.
(CVE-2019-13638)
OSV
patch vulnerabilities
osv·2019-07-24·CVSS 5.9
CVE-2019-13636 [MEDIUM] patch vulnerabilities
patch vulnerabilities
It was discovered that Patch incorrectly handled certain files.
An attacker could possibly use this issue to access sensitive information.
(CVE-2019-13636)
It was discovered that Patch incorrectly handled certain files.
An attacker could possibly use this issue to execute arbitrary code.
(CVE-2019-13638)
Red Hat
patch: do_ed_script in pch.c does not block strings beginning with a ! character
vendor_redhat·2019-08-16·CVSS 7.8
CVE-2018-20969 [HIGH] CWE-78 patch: do_ed_script in pch.c does not block strings beginning with a ! character
patch: do_ed_script in pch.c does not block strings beginning with a ! character
do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638, but the ! syntax is specific to ed, and is unrelated to a shell metacharacter.
A flaw was found in GNU patch through version 2.7.6. Strings beginning with a exclamation mark are not blocked by default. When ed receives an exclamation mark-prefixed command line argument, the argument is executed as a shell command. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.
Package: patch (Red Hat Enterprise Linux 5) - Out of support scope
Package: patch (Red Hat Enterprise Linux 6) - Not affected
Microsoft
do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638 but the ! syntax is specific to ed and is unre
vendor_msrc·2019-08-13·CVSS 7.8
CVE-2018-20969 [HIGH] CWE-78 do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638 but the ! syntax is specific to ed and is unre
do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638 but the ! syntax is specific to ed and is unrelated to a shell metacharacter.
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025. See this blog post for more information. If impact to additional products is
Red Hat
patch: OS shell command injection when processing crafted patch files
vendor_redhat·2019-07-29·CVSS 7.8
CVE-2019-13638 [HIGH] CWE-78 patch: OS shell command injection when processing crafted patch files
patch: OS shell command injection when processing crafted patch files
GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed editor does not need to be present on the vulnerable system. This is different from CVE-2018-1000156.
A flaw was found in GNU patch through version 2.7.6. An ed-style diff payload patch file with shell metacharacters can be used to inject OS shell commands into a system. The ed editor does not need to be present on the vulnerable system for this attack to function. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.
Statement: Red Hat Enterprise Linux 6 is not aff
Ubuntu
Patch vulnerabilities
vendor_ubuntu·2019-07-24·CVSS 5.9
CVE-2019-13636 [MEDIUM] Patch vulnerabilities
Title: Patch vulnerabilities
Summary: Several security issues were fixed in Patch.
It was discovered that Patch incorrectly handled certain files.
An attacker could possibly use this issue to access sensitive information.
(CVE-2019-13636)
It was discovered that Patch incorrectly handled certain files.
An attacker could possibly use this issue to execute arbitrary code.
(CVE-2019-13638)
Instructions: In general, a standard system update will make all the necessary changes.
Ubuntu
Patch vulnerabilities
vendor_ubuntu·2019-07-24·CVSS 5.9
CVE-2019-13636 [MEDIUM] Patch vulnerabilities
Title: Patch vulnerabilities
Summary: Several security issues were fixed in Patch.
USN-4071-1 fixed several vulnerabilities in Patch. This update provides
the corresponding update for Ubuntu 14.04 ESM.
Original advisory details:
It was discovered that Patch incorrectly handled certain files.
An attacker could possibly use this issue to access sensitive information.
(CVE-2019-13636)
It was discovered that Patch incorrectly handled certain files.
An attacker could possibly use this issue to execute arbitrary code.
(CVE-2019-13638)
Instructions: In general, a standard system update will make all the necessary changes.
Microsoft
GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed edito
vendor_msrc·2019-07-09·CVSS 7.8
CVE-2019-13638 [HIGH] CWE-78 GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed edito
GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed editor does not need to be present on the vulnerable system. This is different from CVE-2018-1000156.
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025. See this bl
Debian
CVE-2019-13638: patch - GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be ...
vendor_debian·2019·CVSS 7.8
CVE-2019-13638 [HIGH] CVE-2019-13638: patch - GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be ...
GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed editor does not need to be present on the vulnerable system. This is different from CVE-2018-1000156.
Scope: local
bookworm: resolved (fixed in 2.7.6-5)
bullseye: resolved (fixed in 2.7.6-5)
forky: resolved (fixed in 2.7.6-5)
sid: resolved (fixed in 2.7.6-5)
trixie: resolved (fixed in 2.7.6-5)
Debian
CVE-2018-20969: patch - do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginnin...
vendor_debian·2018·CVSS 7.8
CVE-2018-20969 [HIGH] CVE-2018-20969: patch - do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginnin...
do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638, but the ! syntax is specific to ed, and is unrelated to a shell metacharacter.
Scope: local
bookworm: resolved (fixed in 2.7.6-5)
bullseye: resolved (fixed in 2.7.6-5)
forky: resolved (fixed in 2.7.6-5)
sid: resolved (fixed in 2.7.6-5)
trixie: resolved (fixed in 2.7.6-5)
No detection rules found.
No public exploits indexed.
Bugzilla
CVE-2018-20969 patch: do_ed_script in pch.c does not block strings beginning with a ! character
bugzilla·2019-08-29·CVSS 7.8
CVE-2018-20969 [HIGH] CVE-2018-20969 patch: do_ed_script in pch.c does not block strings beginning with a ! character
CVE-2018-20969 patch: do_ed_script in pch.c does not block strings beginning with a ! character
A vulnerability was found in do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638, but the ! syntax is specific to ed, and is unrelated to a shell metacharacter.
Reference:
https://git.savannah.gnu.org/cgit/patch.git/commit/?id=3fcd042d26d70856e826a42b5f93dc4854d80bf0
https://seclists.org/bugtraq/2019/Aug/29
Discussion:
Created patch tracking bugs for this issue:
Affects: fedora-all [bug 1746673]
---
This issue has been addressed in the following products:
Red Hat Enterprise Linux 8
Via RHSA-2019:2798 https://access.redhat.com/errata/RHSA-2019:2798
---
This bug is now closed. Further u
Bugzilla
CVE-2019-13638 patch: OS shell command injection when processing crafted patch files [fedora-all]
bugzilla·2019-07-29·CVSS 7.8
CVE-2019-13638 [HIGH] CVE-2019-13638 patch: OS shell command injection when processing crafted patch files [fedora-all]
CVE-2019-13638 patch: OS shell command injection when processing crafted patch files [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of fedora-all.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this issue affects multipl
Bugzilla
CVE-2019-13638 patch: OS shell command injection when processing crafted patch files
bugzilla·2019-07-29·CVSS 7.8
CVE-2019-13638 [HIGH] CVE-2019-13638 patch: OS shell command injection when processing crafted patch files
CVE-2019-13638 patch: OS shell command injection when processing crafted patch files
A vulnerability was found in GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed editor does not need to be present on the vulnerable system. This is different from CVE-2018-1000156.
Reference:
https://git.savannah.gnu.org/cgit/patch.git/commit/?id=3fcd042d26d70856e826a42b5f93dc4854d80bf0
Discussion:
Created patch tracking bugs for this issue:
Affects: fedora-all [bug 1733917]
---
During patch file processing, patch application calls the 'ed' file editor. As the invocation was done using a shell command to spawn an ed processm patch was susceptible to command
http://packetstormsecurity.com/files/154124/GNU-patch-Command-Injection-Directory-Traversal.htmlhttps://access.redhat.com/errata/RHSA-2019:2798https://access.redhat.com/errata/RHSA-2019:2964https://access.redhat.com/errata/RHSA-2019:3757https://access.redhat.com/errata/RHSA-2019:3758https://access.redhat.com/errata/RHSA-2019:4061https://git.savannah.gnu.org/cgit/patch.git/commit/?id=3fcd042d26d70856e826a42b5f93dc4854d80bf0https://github.com/irsl/gnu-patch-vulnerabilitieshttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SVWWGISFWACROJJPVJJL4UBLVZ7LPOLT/https://seclists.org/bugtraq/2019/Aug/29https://seclists.org/bugtraq/2019/Jul/54https://security-tracker.debian.org/tracker/CVE-2019-13638https://security.gentoo.org/glsa/201908-22https://security.netapp.com/advisory/ntap-20190828-0001/https://www.debian.org/security/2019/dsa-4489http://packetstormsecurity.com/files/154124/GNU-patch-Command-Injection-Directory-Traversal.htmlhttps://access.redhat.com/errata/RHSA-2019:2798https://access.redhat.com/errata/RHSA-2019:2964https://access.redhat.com/errata/RHSA-2019:3757https://access.redhat.com/errata/RHSA-2019:3758https://access.redhat.com/errata/RHSA-2019:4061https://git.savannah.gnu.org/cgit/patch.git/commit/?id=3fcd042d26d70856e826a42b5f93dc4854d80bf0https://github.com/irsl/gnu-patch-vulnerabilitieshttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SVWWGISFWACROJJPVJJL4UBLVZ7LPOLT/https://seclists.org/bugtraq/2019/Aug/29https://seclists.org/bugtraq/2019/Jul/54https://security-tracker.debian.org/tracker/CVE-2019-13638https://security.gentoo.org/glsa/201908-22https://security.netapp.com/advisory/ntap-20190828-0001/https://www.debian.org/security/2019/dsa-4489
2019-07-26
Published