CVE-2018-1000156: Input Validation

Published Apr 6, 2018
·
Updated

GNU patch does not properly sanitize patch files allowing for malicious patches to pass arbitrary shell commands to ed. An attacker could exploit this by tricking a user into applying malicious patches with the patch command.

Other sources

GNU Patch version 2.7.6 contains an input validation vulnerability when processing patch files, specifically the EDITORPROGRAM invocation (using ed) can result in code execution. This attack appear to be exploitable via a patch file processed via the patch utility. This is similar to FreeBSD's CVE-2015-1418 however although they share a common ancestry the code bases have diverged over time.

Launchpad

Affected Software

30 affected componentsFixes available
GNU patch=2.7.6
Canonical Ubuntu Linux=12.04
Canonical Ubuntu Linux=14.04
Canonical Ubuntu Linux=16.04
Canonical Ubuntu Linux=17.10
Debian Debian Linux=7.0
redhat Enterprise Linux Desktop=6.0
redhat Enterprise Linux Desktop=7.0
redhat Enterprise Linux Server=6.0
redhat Enterprise Linux Server=7.0
redhat Enterprise Linux Server Aus=6.4
redhat Enterprise Linux Server Aus=6.5
redhat Enterprise Linux Server Aus=6.6
redhat Enterprise Linux Server Aus=7.2
redhat Enterprise Linux Server Aus=7.3
redhat Enterprise Linux Server Aus=7.4
redhat Enterprise Linux Server Aus=7.6
redhat Enterprise Linux Server Eus=6.7
redhat Enterprise Linux Server Eus=7.3
redhat Enterprise Linux Server Eus=7.4
redhat Enterprise Linux Server Eus=7.5
redhat Enterprise Linux Server Eus=7.6
redhat Enterprise Linux Server Tus=6.6
redhat Enterprise Linux Server Tus=7.2
redhat Enterprise Linux Server Tus=7.3
redhat Enterprise Linux Server Tus=7.4
redhat Enterprise Linux Server Tus=7.6
redhat Enterprise Linux Workstation=6.0
redhat Enterprise Linux Workstation=7.0
debian/patch
2.7.6-72.8-2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/patch to a version that resolves this vulnerability.

    Fixed in 2.7.6-7Fixed in 2.8-2
  2. Upgrade

    Upgrade GNU Patch to a version that resolves this vulnerability.

    Fixed in 2.7.6
  3. Compensating control

    Prevent untrusted users from providing or influencing patch files or patch command invocations; ensure only trusted patch files are processed by the patch utility.

Event History

Apr 6, 2018
Data Sourced
via Red Hat·12:36 AM
DescriptionSeverityAffected Software
CVE Published
via MITRE·01:00 PM
Data Sourced
via MITRE·01:00 PM
Description
Data Sourced
via NVD·01:29 PM
DescriptionSeverityWeaknessAffected Software
Feb 19, 2026
Data Sourced
via Ubuntu·04:05 PM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Debian·04:06 PM
DescriptionAffected Software
Data Sourced
via Launchpad·04:06 PM
Description
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2018-1000156?

CVE-2018-1000156 is considered a high severity vulnerability due to its potential to allow arbitrary code execution.

2

How do I fix CVE-2018-1000156?

To fix CVE-2018-1000156, update GNU Patch to version 2.7.6-7 or later.

3

Which versions of GNU Patch are affected by CVE-2018-1000156?

GNU Patch version 2.7.6 is affected by CVE-2018-1000156.

4

How can an attacker exploit CVE-2018-1000156?

An attacker can exploit CVE-2018-1000156 by tricking a user into applying a malicious patch file.

5

What systems are vulnerable to CVE-2018-1000156?

Systems using GNU Patch version 2.7.6, including Debian and various versions of Ubuntu and Red Hat Enterprise Linux, are vulnerable to CVE-2018-1000156.

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