CVE-2021-38185: Integer Overflow

Published Aug 7, 2021
·
Updated

GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a dstring.c dsfgetstr integer overflow that triggers an out-of-bounds heap write. NOTE: it is unclear whether there are common cases where the pattern file, associated with the -E option, is untrusted data.

Affected Software

12 affected componentsFixes available
ubuntu/cpio<2.13+dfsg-5
2.13+dfsg-5
ubuntu/cpio<2.13+dfsg-4ubuntu4
2.13+dfsg-4ubuntu4
ubuntu/cpio<2.12+dfsg-6ubuntu0.18.04.4
2.12+dfsg-6ubuntu0.18.04.4
ubuntu/cpio<2.13+dfsg-2ubuntu0.3
2.13+dfsg-2ubuntu0.3
ubuntu/cpio<2.13+dfsg-4ubuntu0.3
2.13+dfsg-4ubuntu0.3
ubuntu/cpio<2.11+dfsg-5ubuntu1.1+
2.11+dfsg-5ubuntu1.1+
ubuntu/cpio<2.11+dfsg-1ubuntu1.2+
2.11+dfsg-1ubuntu1.2+
ubuntu/cpio<2.13+dfsg-4ubuntu4
2.13+dfsg-4ubuntu4
ubuntu/cpio<2.13+dfsg-4ubuntu4
2.13+dfsg-4ubuntu4
ubuntu/cpio<2.13+dfsg-4ubuntu4
2.13+dfsg-4ubuntu4
debian/cpio<=2.12+dfsg-9
2.12+dfsg-9+deb10u12.13+dfsg-7.1~deb11u12.13+dfsg-7.12.15+dfsg-1
GNU cpio<=2.13

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ubuntu/cpio to a version that resolves this vulnerability.

    Fixed in 2.13+dfsg-5
  2. Upgrade

    Upgrade ubuntu/cpio to a version that resolves this vulnerability.

    Fixed in 2.13+dfsg-4ubuntu4
  3. Upgrade

    Upgrade ubuntu/cpio to a version that resolves this vulnerability.

    Fixed in 2.12+dfsg-6ubuntu0.18.04.4
  4. Upgrade

    Upgrade ubuntu/cpio to a version that resolves this vulnerability.

    Fixed in 2.13+dfsg-2ubuntu0.3
  5. Upgrade

    Upgrade ubuntu/cpio to a version that resolves this vulnerability.

    Fixed in 2.13+dfsg-4ubuntu0.3
  6. Upgrade

    Upgrade ubuntu/cpio to a version that resolves this vulnerability.

    Fixed in 2.11+dfsg-5ubuntu1.1+
  7. Upgrade

    Upgrade ubuntu/cpio to a version that resolves this vulnerability.

    Fixed in 2.11+dfsg-1ubuntu1.2+
  8. Upgrade

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

    Fixed in 2.12+dfsg-9+deb10u1Fixed in 2.13+dfsg-7.1~deb11u1Fixed in 2.13+dfsg-7.1Fixed in 2.15+dfsg-1

Event History

Aug 7, 2021
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Aug 8, 2021
Data Sourced
via NVD·12:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·11:58 PM
Description

Parent advisories

This vulnerability appears in the following advisories.

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 CVE-2021-38185?

CVE-2021-38185 is a vulnerability in GNU cpio through 2.13 that allows attackers to execute arbitrary code via a crafted pattern file.

2

How severe is CVE-2021-38185?

CVE-2021-38185 has a severity score of 7.8 (high).

3

Which software versions are affected by CVE-2021-38185?

GNU cpio versions 2.13+dfsg-5 and earlier are affected by CVE-2021-38185.

4

How can I fix CVE-2021-38185?

To fix CVE-2021-38185, update GNU cpio to version 2.13+dfsg-5 or later.

5

Where can I find more information about CVE-2021-38185?

You can find more information about CVE-2021-38185 at the following references: - [Reference 1](https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b) - [Reference 2](https://github.com/fangqyi/cpiopwn) - [Reference 3](https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00000.html)

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