GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern…
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 fixed, 2 without a fix
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA and Red Hat. Impact type from CWE-190 and the CVSS impact.
Summary
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 it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
Remediation
Red Hat 1 advisory
- RHSA-2022:1991 Released 2022-05-10 · Red Hat rating Moderatecpio security update
- Red Hat Enterprise Linux BaseOS (v. 8) cpio-2.12-11.el8
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux BaseOS (v. 8) | Fixed | RHSA-2022:1991 |
Not affected: 1 product
- Red Hat Enterprise Linux 9
Timeline
- 2026-10-02 Threatist record created from CVE-2021-38185
- 2026-10-03 Alias added: GHSA-pp74-ghrg-jwfh
References
Exploit 3
Patch 1
More GNU Cpio vulnerabilities
- TI-2023-06601 Cpio: extraction allows symlinks which enables remote command execution CVSS 3.1MEDIUM 5.3
- TI-2010-03976 cpio, as used in build 2007.05.10, 2010.07.28, and possibly other versions, allows remote… CVSS 3.1HIGH 7.2
- TI-2010-00595 Heap-based buffer overflow in the rmt_read__ function in lib/rtapelib.c in the rmt client… CVSS 2.0MEDIUM 6.8
- TI-2016-01868 The cpio_safer_name_suffix function in util.c in cpio 2.11 allows remote attackers to… CVSS 3.0MEDIUM 6.5
- TI-2019-11070 Improper input validation in Red Hat cpio CVSS 3.1HIGH 7.3
- TI-2014-07398 Heap-based buffer overflow in the process_copy_in function in GNU Cpio 2.11 allows remote… CVSS 2.0MEDIUM 5.0
Sources
- CVE-2021-38185 · CVE Program
- CVE-2021-38185 · NVD
- FIRST EPSS
- GHSA-pp74-ghrg-jwfh · GitHub Advisory Database · CC BY 4.0
- CVE-2021-38185 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences