Skip to main content
Public proof of conceptFix available

CVE-2021-38185

A public proof of concept exists; no exploitation attested.

  • Published2021-08-08
  • WeaknessCWE-190

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

Description

GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a dstring.c ds_fgetstr 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.

Timeline

dates in UTC
  1. 2021-08-0800:15CVE publishedNVD

Observed activity

isMalicious corpus · updated 2026-11-03 21:37 UTC
Indicators tagged with this CVE, per day0 indicators over 7 days
Block these indicators
  • Firewall list (EDL, text): https://api.ismalicious.com/edl/cve/CVE-2021-38185?format=txt
  • CSV export: https://api.ismalicious.com/edl/cve/CVE-2021-38185?format=csv
  • TAXII collection of exploited CVEs
  • The EDL and CSV take an API key on the Pro plan.

Versions per branch

NVD
Gnu cpio
BranchAffectedFixed in
2.13≤ 2.13no fix published

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • cpioUbuntu:Pro:16.04:LTSall versions · fixed in 2.11+dfsg-5ubuntu1.1+esm1
  • cpioUbuntu:Pro:14.04:LTSall versions · fixed in 2.11+dfsg-1ubuntu1.2+esm2
  • cpioUbuntu:22.04:LTSall versions · fixed in 2.13+dfsg-4ubuntu4
  • cpioUbuntu:20.04:LTSall versions · fixed in 2.13+dfsg-2ubuntu0.3
  • cpioUbuntu:18.04:LTSall versions · fixed in 2.12+dfsg-6ubuntu0.18.04.4
  • cpioSUSE:OpenStack Cloud Crowbar 9all versions · fixed in 2.11-36.12.1
  • cpioSUSE:OpenStack Cloud Crowbar 9all versions · fixed in 2.11-36.15.1
  • cpioSUSE:OpenStack Cloud Crowbar 9all versions · fixed in 2.11-36.9.1

80 more package ranges on OSV.dev

Vendor advisories

  • CVE-2021-38185 Red Hat Product Security13 products fixed · 3 known affected

    cpio: integer overflow in ds_fgetstr() in dstring.c can lead to an out-of-bounds write via a crafted pattern file

    cpio.src as a component of Red Hat Enterprise Linux 6 · cpio as a component of Red Hat Enterprise Linux 7 · cpio.src as a component of Red Hat Enterprise Linux 7

  • SSA-202008 Siemens ProductCERT11 known affected

    SSA-202008: Multiple Vulnerabilities in Ruggedcom Rox Before V2.17.0

    RUGGEDCOM ROX MX5000 · RUGGEDCOM ROX MX5000RE · RUGGEDCOM ROX RX1400 · +8 more

  • RHSA-2022:1991 Red Hat Product Security13 products fixed

    Red Hat Security Advisory: cpio security update

Full record on NVD

Fix

  1. Vendor fix Siemens ProductCERT SSA-202008 · 11 productsUpdate to V2.17.0 or later version
  2. Vendor fix Red Hat Product Security RHSA-2022:1991 · 13 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
  3. No fix planned, says the vendor Red Hat Product Security CVE-2021-38185 · 3 productsOut of support scope

Advisories and patches

Detection

read 2026-11-03 22:42 UTC
Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof-of-concept repositories
1 repository, unverifiedfangqyi/cpiopwn
PoC-in-GitHub
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Published
2021-08-08
Last Modified
2026-06-17
NVD status
Modified
GitHub Advisory
GHSA-pp74-ghrg-jwfh

Frequently asked questions

What is CVE-2021-38185?

GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a dstring.c ds_fgetstr 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.

Is CVE-2021-38185 actively exploited?

Active exploitation of CVE-2021-38185 has not been confirmed. Its EPSS score was 4.2% on 2026-11-03, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2021-38185?

CVE-2021-38185 has a CVSS v3 base score of 7.8 (HIGH severity), with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.

Running cpio? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record