Vulnerability · Published Aug 7, 2021 · Assigned by mitre
CVE-2021-38185
High 7.8
In plain English
A high-severity integer overflow in the cpio package (AlmaLinux). There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 4.2% (higher than 91% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official description
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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | cpio | 2.12-11.el8 | ALSA-2022:1991 |
| Alpine:v3.20 | cpio | 2.13-r2 | ALPINE-CVE-2021-38185 |
| Alpine:v3.21 | cpio | 2.13-r2 | ALPINE-CVE-2021-38185 |
| Alpine:v3.22 | cpio | 2.13-r2 | ALPINE-CVE-2021-38185 |
| Alpine:v3.23 | cpio | 2.13-r2 | ALPINE-CVE-2021-38185 |
| Alpine:v3.24 | cpio | 2.13-r2 | ALPINE-CVE-2021-38185 |
| Debian:12 | cpio | 2.13+dfsg-5 | DEBIAN-CVE-2021-38185 |
| Debian:13 | cpio | 2.13+dfsg-5 | DEBIAN-CVE-2021-38185 |
| Debian:14 | cpio | 2.13+dfsg-5 | DEBIAN-CVE-2021-38185 |
| Rocky Linux:8 | cpio | 0:2.12-11.el8 | RLSA-2022:1991 |
| Ubuntu:22.04:LTS | cpio | 2.13+dfsg-4ubuntu4 | UBUNTU-CVE-2021-38185 |
Affected products (as reported)
Weakness: CWE-190 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
References
- 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
- https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b
- [debian-lts-announce] 20230604 [SECURITY] [DLA 3445-1] cpio security update mailing-list