# CVE-2021-38185: GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a dstring.c dsfgetstr integer overf…

- Severity: High 7.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 4.17%, higher than 91% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 3 links below, marked "exploit"
- Published: 2021-08-07T00:00:00.000Z
- Modified: 2026-06-17T04:01:42.950Z
- Weaknesses: CWE-190
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: mitre

## 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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- gnu cpio: up to 2.13

## Every score

- CISA-ADP: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 6.8 Medium `AV:N/AC:M/Au:N/C:P/I:P/A:P`

## References

- <https://github.com/fangqyi/cpiopwn> (exploit, third-party-advisory)
- <https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00000.html> (exploit, mailing-list, vendor-advisory)
- <https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00002.html> (exploit, mailing-list, vendor-advisory)
- <https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b> (patch, third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2023/06/msg00007.html> (mailing-list)

## Sources

- CVE List: [CVE-2021-38185](https://www.cve.org/CVERecord?id=CVE-2021-38185), CVE Terms of Use, modified 2025-06-09
- NVD: [CVE-2021-38185](https://nvd.nist.gov/vuln/detail/CVE-2021-38185), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-38185 · Whole record: https://cve.day/CVE-2021-38185.json · Rebuilt by cve.day 2026-11-25T22:58:03.052Z
