Vulnerabilities · 2021 · Gnu
CVE-2021-38185
Gnu Cpio vulnerability
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.
Affected products
Cpio. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Gnu Cpio runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Set the orderSystems that can be reached from the internet come first, then the rest.
References
- lists.gnu.org/archive/html/bug-cpio/2021-08/msg00000.html · Exploit
- lists.gnu.org/archive/html/bug-cpio/2021-08/msg00002.html · Exploit
- git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b · Patch
- github.com/fangqyi/cpiopwn · Exploit
- lists.debian.org/debian-lts-announce/2023/06/msg00007.html
- nvd.nist.gov/vuln/detail/CVE-2021-38185
- cve.org/CVERecord?id=CVE-2021-38185
More vulnerabilities in Gnu products
CVE-2026-24061CVE-2026-0915CVE-2026-0861CVE-2025-66866CVE-2025-66865CVE-2025-66864CVE-2025-66863CVE-2025-66862All 1,147
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.