CVEfocus › CVE database › CVE-2021-38185

CVE-2021-38185

CVSS 7.8 HighEPSS 4.2% (higher than 92% of CVEs)Published 2021-08-07Updated 2025-06-09Assigner: mitre

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.

CWE-190

What to do

Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

20Fixed
2Fix pending
2Will not fix
1Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04cpioFixed2.13+dfsg-4ubuntu4UBUNTU-CVE-2021-38185
Ubuntu 20.04cpioFixed2.13+dfsg-2ubuntu0.3UBUNTU-CVE-2021-38185
Ubuntu 18.04cpioFixed2.12+dfsg-6ubuntu0.18.04.4UBUNTU-CVE-2021-38185
Ubuntu 16.04cpioFix pending2.11+dfsg-5ubuntu1.1+esm1 (Ubuntu Pro)UBUNTU-CVE-2021-38185
Ubuntu 14.04cpioFix pending2.11+dfsg-1ubuntu1.2+esm2 (Ubuntu Pro)UBUNTU-CVE-2021-38185
Debian 14cpioFixed2.13+dfsg-5DEBIAN-CVE-2021-38185
Debian 13cpioFixed2.13+dfsg-5DEBIAN-CVE-2021-38185
Debian 12cpioFixed2.13+dfsg-5DEBIAN-CVE-2021-38185
Red Hat Enterprise Linux 9cpioNot affected
Red Hat Enterprise Linux 8cpioFixed0:2.12-11.el8RHSA-2022:1991
Red Hat Enterprise Linux 7cpioWill not fix
Out of support scope
Red Hat Enterprise Linux 6cpioWill not fix
Out of support scope
AlmaLinux 8cpioFixed2.12-11.el8ALSA-2022:1991
Rocky Linux 8cpioFixed0:2.12-11.el8RLSA-2022:1991
Alpine Linux 3.24cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.23cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.22cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.21cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.20cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.19cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.18cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.17cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.16cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.15cpioFixed2.13-r2ALPINE-CVE-2021-38185
Alpine Linux 3.14cpioFixed2.13-r2ALPINE-CVE-2021-38185

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.