CVE-2021-38185 Integer overflow in n/a

High 7.8 Published Updated

Attackers can execute arbitrary code via a crafted pattern file due to an integer overflow in GNU cpio, affecting Linux distributions.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-38185?

CVE-2021-38185 is a high-severity vulnerability in n/a, published on 7 Aug 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

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.

Weakness: CWE-190

Which versions are affected by CVE-2021-38185?

It affects 1 product.

Linux distribution packages (40)
cpio AlmaLinux:8All versions2.12-11.el8
cpio Red Hat:enterprise_linux:8::baseosAll versions0:2.12-11.el8
cpio-debuginfo Red Hat:enterprise_linux:8::baseosAll versions0:2.12-11.el8
cpio-debugsource Red Hat:enterprise_linux:8::baseosAll versions0:2.12-11.el8
cpio Rocky Linux:8All versions0:2.12-11.el8
cpio SUSE:Enterprise Storage 6All versions2.12-3.9.1
cpio SUSE:HPE Helion OpenStack 8All versions2.11-36.12.1
cpio SUSE:HPE Helion OpenStack 8All versions2.11-36.15.1
cpio SUSE:HPE Helion OpenStack 8All versions2.11-36.9.1
cpio SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOSAll versions2.12-3.9.1
cpio SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSSAll versions2.12-3.9.1
cpio SUSE:Linux Enterprise High Performance Computing 15-ESPOSAll versions2.12-3.9.1
cpio SUSE:Linux Enterprise High Performance Computing 15-LTSSAll versions2.12-3.9.1
cpio SUSE:Linux Enterprise Micro 5.0All versions2.12-3.9.1
cpio SUSE:Linux Enterprise Module for Basesystem 15 SP2All versions2.12-3.9.1
cpio SUSE:Linux Enterprise Module for Basesystem 15 SP3All versions2.12-3.9.1
cpio SUSE:Linux Enterprise Point of Sale 11 SP3All versions2.9-75.81.14.1
cpio SUSE:Linux Enterprise Point of Sale 11 SP3All versions2.9-75.81.8.1
cpio SUSE:Linux Enterprise Server 11 SP4-LTSSAll versions2.9-75.81.14.1
cpio SUSE:Linux Enterprise Server 11 SP4-LTSSAll versions2.9-75.81.8.1
cpio SUSE:Linux Enterprise Server 12 SP2-BCLAll versions2.11-36.12.1
cpio SUSE:Linux Enterprise Server 12 SP2-BCLAll versions2.11-36.15.1
cpio SUSE:Linux Enterprise Server 12 SP2-BCLAll versions2.11-36.9.1
cpio SUSE:Linux Enterprise Server 12 SP3-BCLAll versions2.11-36.12.1
cpio SUSE:Linux Enterprise Server 12 SP3-BCLAll versions2.11-36.15.1
cpio SUSE:Linux Enterprise Server 12 SP3-BCLAll versions2.11-36.9.1
cpio SUSE:Linux Enterprise Server 12 SP3-LTSSAll versions2.11-36.12.1
cpio SUSE:Linux Enterprise Server 12 SP3-LTSSAll versions2.11-36.15.1
cpio SUSE:Linux Enterprise Server 12 SP3-LTSSAll versions2.11-36.9.1
cpio SUSE:Linux Enterprise Server 12 SP4-LTSSAll versions2.11-36.12.1
cpio SUSE:Linux Enterprise Server 12 SP4-LTSSAll versions2.11-36.15.1
cpio SUSE:Linux Enterprise Server 12 SP4-LTSSAll versions2.11-36.9.1
cpio SUSE:Linux Enterprise Server 12 SP5All versions2.11-36.12.1
cpio SUSE:Linux Enterprise Server 12 SP5All versions2.11-36.15.1
cpio SUSE:Linux Enterprise Server 12 SP5All versions2.11-36.9.1
cpio SUSE:Linux Enterprise Server 15 SP1-BCLAll versions2.12-3.9.1
cpio SUSE:Linux Enterprise Server 15 SP1-LTSSAll versions2.12-3.9.1
cpio SUSE:Linux Enterprise Server 15-LTSSAll versions2.12-3.9.1
cpio SUSE:Linux Enterprise Server for SAP Applications 12 SP3All versions2.11-36.12.1
cpio SUSE:Linux Enterprise Server for SAP Applications 12 SP3All versions2.11-36.15.1

Products include Gnu Cpio.

How do I fix CVE-2021-38185?

Apply the vendor's patch.

Is CVE-2021-38185 being exploited?

There is no known exploitation of CVE-2021-38185 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as ALSA-2022:1991, AZL-6357, CLEANSTART-2024-HF57565, DEBIAN-CVE-2021-38185, GHSA-pp74-ghrg-jwfh, MGASA-2021-0423 and 14 more.

Is CVE-2021-38185 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free