CVE-2021-38185

NameCVE-2021-38185
DescriptionGNU 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
ReferencesDLA-3445-1
Debian Bugs992045

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
cpio (PTS)buster2.12+dfsg-9vulnerable
buster (security)2.12+dfsg-9+deb10u1fixed
bullseye2.13+dfsg-7.1~deb11u1fixed
bookworm2.13+dfsg-7.1fixed
sid, trixie2.15+dfsg-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
cpiosourcebuster2.12+dfsg-9+deb10u1DLA-3445-1
cpiosourcebullseye2.13+dfsg-7.1~deb11u1
cpiosource(unstable)2.13+dfsg-5992045

Notes

[stretch] - cpio <no-dsa> (Minor issue)
https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b
https://github.com/fangqyi/cpiopwn
https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00000.html
https://lists.gnu.org/archive/html/bug-cpio/2021-08/msg00002.html
Regression: https://bugs.debian.org/992098
Regression fixed by: https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dfc801c44a93bed7b3951905b188823d6a0432c8
Regression #2: https://bugs.debian.org/992192
Regression #2 fixed by: https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=236684f6deb3178043fe72a8e2faca538fa2aae1

Search for package or bug name: Reporting problems