LiveActive security incident?Get immediate response
CVE Record

CVE-2021-38185: GNU cpio through 2.13 allows attackers to execute arbitrary code via a crafted pattern file, because of a d...

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.

HighCVSS 7.8Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

GNU cpio through 2.13 can be made to corrupt heap memory when it reads a specially crafted pattern file. Successful exploitation could allow code execution with the privileges of the user running cpio. Business risk depends heavily on whether automated workflows accept untrusted pattern files for cpio's -E option.

Executive priority

Treat as high priority where cpio handles external inputs in automation. For systems that never use untrusted -E pattern files, urgency is lower, but patching remains appropriate because the impact is full confidentiality, integrity, and availability compromise under the executing user.

Technical view

The flaw is an integer overflow in dstring.c ds_fgetstr that can lead to an out-of-bounds heap write. The CVSS vector is local, low complexity, no privileges required, and user interaction required. The CVE notes uncertainty about common real-world cases where the -E pattern file is untrusted.

Likely exposure

Exposure is most likely on systems running GNU cpio 2.13 or older where scripts, backup jobs, package workflows, or archive processing invoke cpio with -E using attacker-controlled or externally supplied pattern files.

Exploitation context

The source bundle references a public GitHub repository and GNU bug discussion, but KEV is false and no cited source states active exploitation. The attack is local and requires a victim workflow to process a crafted pattern file.

Researcher notes

The upstream fix is identified by GNU Savannah commit dd96882877721703e19272fe25034560b794061b. Product metadata in the bundle is incomplete, and the CVE itself warns that common untrusted -E use cases are unclear. Avoid assuming broad remote exposure without local workflow evidence.

Mitigation direction

  • Upgrade GNU cpio using vendor packages or a release containing the upstream fix.
  • Apply Debian LTS update DLA 3445-1 where applicable.
  • Do not use cpio -E with untrusted pattern files.
  • Restrict automation that accepts external pattern files before invoking cpio.
  • Check current vendor guidance for supported fixed versions.

Validation and detection

  • Inventory hosts and containers for GNU cpio versions through 2.13.
  • Search scripts, CI jobs, and cron tasks for cpio invocations using -E.
  • Confirm patched package versions from the operating system vendor.
  • Review file-processing workflows for externally supplied pattern files.
  • Prioritize validation on systems processing user-uploaded archives or build inputs.
Prepared
Confidence
medium
Sources
7

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-190: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-38185 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.8 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
6Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.8CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H1.85.9Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.8High
CVSS 3.1 vector shape for CVE-2021-38185Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
n/an/an/aListed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-190 · source CWE mapping

Integer Overflow or Wraparound

Integer Overflow or Wraparound represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.