Skip to content
OpenAdvisories
High · 7.8 Public exploit CVE-2021-38185 EUVD-2021-24655GHSA-pp74-ghrg-jwfh

GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a dstring.c ds_fgetstr integer over…

Published Aug 7, 2021 · Updated Jun 9, 2025 · Assigned by mitre

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.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 cpio 2.13+dfsg-5 —
Debian 13 cpio 2.13+dfsg-5 —
Debian 12 cpio 2.13+dfsg-5 —
Debian 10 cpio 2.12+dfsg-9+deb10u1 DLA-3445-1
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS cpio 2.13+dfsg-4ubuntu4 —
Ubuntu 20.04 LTS cpio 2.13+dfsg-2ubuntu0.3 USN-5064-1
Ubuntu 18.04 LTS cpio 2.12+dfsg-6ubuntu0.18.04.4 USN-5064-1
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 16.04 LTS cpio 2.11+dfsg-5ubuntu1.1+esm1 USN-5064-2
Ubuntu Pro 14.04 LTS cpio 2.11+dfsg-1ubuntu1.2+esm2 USN-5064-3
ReleasePackageFixed inAdvisory
RHEL 8 cpio 2.12-11.el8 RHSA-2022:1991

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 8 cpio 2.12-11.el8 ALSA-2022:1991

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 8 cpio 2.12-11.el8 RLSA-2022:1991
ReleasePackageFixed inAdvisory
SLES 15 SP3 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SLES 15 SP2 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SLES 15 SP1 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SLES 15 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SLES 12 SP5 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
Show 22 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES 12 SP4 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SLES 12 SP3 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SLES 12 SP2 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SLES 11 SP4 cpio 2.9-75.81.8.1 SUSE-SU-2021:14788-1, SUSE-SU-2021:14777-1
SLES for SAP 15 SP1 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SLES for SAP 15 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SLES for SAP 12 SP5 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SLES for SAP 12 SP4 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SLES for SAP 12 SP3 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SLE Micro 5.0 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SLE HPC 15 SP1 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SLE HPC 15 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SUSE OpenStack Cloud Crowbar 9 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SUSE OpenStack Cloud Crowbar 8 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SUSE OpenStack Cloud 9 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SUSE OpenStack Cloud 8 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SUSE Manager Server 4.0 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SUSE Manager Retail Branch Server 4.0 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SUSE Manager Proxy 4.0 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
SUSE Linux Enterprise Point of Sale 11 SP3 cpio 2.9-75.81.8.1 SUSE-SU-2021:14788-1, SUSE-SU-2021:14777-1
SUSE HPE Helion OpenStack 8 cpio 2.11-36.9.1 SUSE-SU-2021:2808-1, SUSE-SU-2021:2686-1, SUSE-RU-2021:2779-1
SUSE Enterprise Storage 6 cpio 2.12-3.9.1 SUSE-RU-2021:2780-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed cpio 2.13-3.3 openSUSE-SU-2024:10697-1
ReleasePackageFixed inAdvisory
Alpine v3.24 cpio 2.13-r2 —
Alpine v3.23 cpio 2.13-r2 —
Alpine v3.22 cpio 2.13-r2 —
Alpine v3.21 cpio 2.13-r2 —
Alpine v3.20 cpio 2.13-r2 —
Show 6 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 cpio 2.13-r2 —
Alpine v3.18 cpio 2.13-r2 —
Alpine v3.17 cpio 2.13-r2 —
Alpine v3.16 cpio 2.13-r2 —
Alpine v3.15 cpio 2.13-r2 —
Alpine v3.14 cpio 2.13-r2 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 cpio 2.13-13.amzn2023.0.2 ALAS2023-2023-021
Amazon Linux 2 cpio 2.12-11.amzn2 ALAS2-2023-1972

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 2 (CBL-Mariner) cpio 2.13-4 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 8 cpio 2.12-11.el8 ELSA-2022-1991

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

  • fangqyi/cpiopwn ★ 5 · Jul 19, 2021

    ACE poc exploit for glibc cpio 2.13 through mmap chunk metadata curruption (CVE-2021-38185)

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Advisories 20

References