CVE-2021-38185: GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a dstr
CVE-2021-38185 is a high-severity flaw (CVSS 7.8) affecting cpio. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
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.
Why this priority
- High severity
- EPSS top 9%: very likely to be exploited
- Public exploit reference
A fixed release or distro patch exists.
Risk facts
| CVSS score | 7.8 (High) |
| Attack vector | Local |
| Attack complexity | Low |
| Privileges needed | None |
| User interaction | Required |
| EPSS exploit chance | 4.2% (top 9%) |
| CISA exploited list | No |
| Weakness | CWE-190 |
| Published | 2021-08-08 |
| Last modified | 2026-06-17 |
Last updated 2026-06-17 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score
Am I affected?
Timeline
- Published CVE record published
- Updated Record last modified
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Quick answers
How do I fix CVE-2021-38185?
cpio: upgrade to newer than 2.13. Exact commands for each OS are on this page.
Is CVE-2021-38185 being exploited?
CVE-2021-38185 is not on the CISA Known Exploited Vulnerabilities list at the time of the last update. Check again, as this can change.
What does CVE-2021-38185 affect?
CVE-2021-38185 affects cpio. Severity is high (CVSS 7.8). 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 wh
How urgent is CVE-2021-38185?
Priority 55/100. High severity; EPSS top 9%: very likely to be exploited; Public exploit reference
Related CVEs
- CVE-2015-1197 LOW 1.9 DOWNGRADE cpio 2.11, when using the --no-absolute-filenames option, allows local users to write to arbitrary files via a
- CVE-2023-7207 MEDIUM 4.9 DOWNGRADE Debian's cpio contains a path traversal vulnerability
- CVE-2019-14866 HIGH 7.3 UPGRADE MITIGATE In all versions of cpio before 2.13 does not properly validate input files when generating TAR archives
- CVE-2016-2037 MEDIUM 6.5 DOWNGRADE MITIGATE The cpio_safer_name_suffix function in util.c in cpio 2.11 allows remote attackers to cause a denial of servic
- CVE-2014-9112 MEDIUM 5.0 DOWNGRADE MITIGATE Heap-based buffer overflow in the process_copy_in function in GNU Cpio 2.11 allows remote attackers to cause a