Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2021-38185: n/a in n/a

0
High
VulnerabilityCVE-2021-38185cvecve-2021-38185
Published: Sat Aug 07 2021 (08/07/2021, 00:00:00 UTC)
Source: CVE Database V5
Vendor/Project: n/a
Product: n/a

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.

AI-Powered Analysis

AILast updated: 07/10/2025, 20:19:13 UTC

Technical Analysis

CVE-2021-38185 is a high-severity vulnerability in GNU cpio versions up to 2.13. The flaw arises from an integer overflow in the ds_fgetstr function within the dstring.c source file. This overflow leads to an out-of-bounds heap write when processing a crafted pattern file associated with the -E option. Exploiting this vulnerability allows an attacker to execute arbitrary code on the affected system. The vulnerability is triggered by supplying a maliciously crafted pattern file, which causes the integer overflow during string handling, corrupting heap memory and enabling code execution. However, it is unclear how often the pattern file input is untrusted in typical use cases, which may limit exploitation scenarios. The CVSS 3.1 base score is 7.8, reflecting high impact on confidentiality, integrity, and availability, with low attack complexity but requiring local access and user interaction. No known exploits are currently reported in the wild, and no official patches are linked in the provided data, though GNU cpio updates may have addressed this issue since publication in August 2021.

Potential Impact

For European organizations, the impact of this vulnerability depends largely on the usage of GNU cpio in their environments. GNU cpio is commonly used for archiving and extracting files in Unix-like systems, including Linux distributions prevalent in European enterprises and government infrastructure. Successful exploitation could lead to arbitrary code execution, potentially allowing attackers to gain control over affected systems, steal sensitive data, disrupt operations, or move laterally within networks. This is particularly concerning for sectors relying on automated backup, deployment, or archival processes that utilize cpio with pattern files, especially if those pattern files can be influenced by untrusted sources. The requirement for local access and user interaction somewhat limits remote exploitation but does not eliminate risk in environments where users might be tricked into opening crafted files or where attackers have some foothold. Given the high confidentiality, integrity, and availability impacts, exploitation could lead to data breaches, system compromise, and operational downtime.

Mitigation Recommendations

European organizations should first verify if GNU cpio is used within their systems and identify versions up to 2.13. Since no direct patch links are provided, organizations should check official GNU repositories or trusted Linux distribution security advisories for updates or patches addressing CVE-2021-38185 and apply them promptly. If patching is not immediately possible, restrict or monitor the use of the -E option with pattern files, especially when processing files from untrusted sources. Implement strict input validation and sandboxing for any processes handling pattern files to limit potential damage from exploitation. Additionally, enhance endpoint security controls to detect anomalous behavior indicative of exploitation attempts, and educate users about the risks of opening untrusted files. Employing application whitelisting and least privilege principles can further reduce the attack surface. Regularly audit and monitor systems for signs of compromise related to this vulnerability.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.1
Assigner Short Name
mitre
Date Reserved
2021-08-07T00:00:00.000Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 68487f5e1b0bd07c3938f3f2

Added to database: 6/10/2025, 6:54:22 PM

Last enriched: 7/10/2025, 8:19:13 PM

Last updated: 2/7/2026, 8:24:20 AM

Views: 56

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats