Bug 1733916 (CVE-2019-13638) - CVE-2019-13638 patch: OS shell command injection when processing crafted patch files
Summary: CVE-2019-13638 patch: OS shell command injection when processing crafted patc...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2019-13638
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1733917 1734832 1734833 1747863 1747864 1747865 1747866 1759538 1759539 1759549 1764222
Blocks: 1731850
TreeView+ depends on / blocked
 
Reported: 2019-07-29 08:24 UTC by Dhananjay Arunesh
Modified: 2021-02-16 21:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
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.
Clone Of:
Environment:
Last Closed: 2019-09-19 06:45:33 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2883 0 None None None 2019-09-23 20:06:09 UTC
Red Hat Product Errata RHBA-2019:2984 0 None None None 2019-10-09 05:22:05 UTC
Red Hat Product Errata RHBA-2019:3129 0 None None None 2019-10-16 13:38:45 UTC
Red Hat Product Errata RHBA-2019:3137 0 None None None 2019-10-17 13:58:38 UTC
Red Hat Product Errata RHBA-2019:3279 0 None None None 2019-10-31 11:56:35 UTC
Red Hat Product Errata RHBA-2019:3290 0 None None None 2019-10-31 17:03:24 UTC
Red Hat Product Errata RHSA-2019:2798 0 None None None 2019-09-19 04:08:11 UTC
Red Hat Product Errata RHSA-2019:2964 0 None None None 2019-10-03 14:04:07 UTC
Red Hat Product Errata RHSA-2019:3757 0 None None None 2019-11-06 16:57:20 UTC
Red Hat Product Errata RHSA-2019:3758 0 None None None 2019-11-06 17:05:30 UTC
Red Hat Product Errata RHSA-2019:4061 0 None None None 2019-12-03 11:00:59 UTC

Description Dhananjay Arunesh 2019-07-29 08:24:07 UTC
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

Comment 1 Dhananjay Arunesh 2019-07-29 08:24:26 UTC
Created patch tracking bugs for this issue:

Affects: fedora-all [bug 1733917]

Comment 5 Marco Benatto 2019-07-31 15:04:17 UTC
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 injection via crafted patch files. An attacker may use this weakness to run arbitrary shell command when the user is applying patch files.

Comment 7 errata-xmlrpc 2019-09-19 04:08:08 UTC
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

Comment 8 Product Security DevOps Team 2019-09-19 06:45:33 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-13638

Comment 13 errata-xmlrpc 2019-10-03 14:04:06 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:2964 https://access.redhat.com/errata/RHSA-2019:2964

Comment 23 errata-xmlrpc 2019-11-06 16:57:17 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.5 Extended Update Support

Via RHSA-2019:3757 https://access.redhat.com/errata/RHSA-2019:3757

Comment 24 errata-xmlrpc 2019-11-06 17:05:27 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.6 Extended Update Support

Via RHSA-2019:3758 https://access.redhat.com/errata/RHSA-2019:3758

Comment 26 Marco Benatto 2019-11-20 12:55:25 UTC
The version of patch shipped with Red Hat Enterprise Linux 6 is not affected. The vulnerability was introduced on upstream's patch version 2.7 while RHEL6 ships version 2.6.x from patch.

Comment 29 errata-xmlrpc 2019-12-03 11:00:57 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.4 Advanced Update Support
  Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions
  Red Hat Enterprise Linux 7.4 Telco Extended Update Support

Via RHSA-2019:4061 https://access.redhat.com/errata/RHSA-2019:4061

Comment 31 Eric Christensen 2020-04-30 13:18:48 UTC
Statement:

Red Hat Enterprise Linux 6 is not affected by this vulnerability as the shipped version of patch did not carry the code that introduced this flaw.


Note You need to log in before you can comment on or make changes to this bug.