{"id":"CVE-2021-38185","details":"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.","modified":"2026-03-20T04:15:47.721676Z","published":"2021-08-08T00:15:07.027Z","related":["ALSA-2022:1991","MGASA-2021-0423","SUSE-RU-2021:2779-1","SUSE-RU-2021:2780-1","SUSE-SU-2021:14777-1","SUSE-SU-2021:14788-1","SUSE-SU-2021:2686-1","SUSE-SU-2021:2689-1","SUSE-SU-2021:2808-1","openSUSE-SU-2024:10697-1"],"references":[{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2023/06/msg00007.html"},{"type":"FIX","url":"https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b"},{"type":"EVIDENCE","url":"https://github.com/fangqyi/cpiopwn"},{"type":"EVIDENCE","url":"https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00000.html"},{"type":"EVIDENCE","url":"https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00002.html"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://cgit.git.savannah.gnu.org/cgit/cpio.git","events":[{"introduced":"0"},{"fixed":"dd96882877721703e19272fe25034560b794061b"}]},{"type":"GIT","repo":"https://git.savannah.gnu.org/git/cpio.git/","events":[{"introduced":"0"},{"last_affected":"cd892d109a583e3a29e1da66b8374c29605bfdc8"}],"database_specific":{"versions":[{"introduced":"0"},{"last_affected":"2.13"}]}}],"versions":["release_2_11","release_2_12","release_2_13","release_2_6","release_2_7"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-38185.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]}