Read the docs
TI-2022-16537 Aliases CVE-2022-36114GHSA-2hvr-h6gw-qrxp

Extracting malicious crates can fill the file system

Priority LOW 31CWE-400Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Fixed

Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-400.

Summary

Cargo is a package manager for the rust programming language. It was discovered that Cargo did not limit the amount of data extracted from compressed archives. An attacker could upload to an alternate registry a specially crafted package that extracts way more data than its size (also known as a "zip bomb"), exhausting the disk space on the machine using Cargo to download the package. Note that by design Cargo allows code execution at build time, due to build scripts and procedural macros. The vulnerabilities in this advisory allow performing a subset of the possible damage in a harder to track down way. Your dependencies must still be trusted if you want to be protected from attacks, as it's possible to perform the same attacks with build scripts and procedural macros. The vulnerability is present in all versions of Cargo. Rust 1.64, to be released on September 22nd, will include a fix for it. Since the vulnerability is just a more limited way to accomplish what a malicious build scripts or procedural macros can do, we decided not to publish Rust point releases backporting the security fix. Patch files are available for Rust 1.63.0 are available in the wg-security-response repository for people building their own toolchain. We recommend users of alternate registries to excercise care in which package they download, by only including trusted dependencies in their projects. Please note that even with these vulnerabilities fixed, by design Cargo allows arbitrary code execution at build time thanks to build scripts and procedural macros: a malicious dependency will be able to cause damage regardless of these vulnerabilities. crates.io implemented server-side checks to reject these kinds of packages years ago, and there are no packages on crates.io exploiting these vulnerabilities. crates.io users still need to excercise care in choosing their dependencies though, as the same concerns about build scripts and procedural macros apply here.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00945 61st percentileScored 2026-11-07
Fix Fixed cargo (rust-lang): 0.65.0cargo (crates.io): 0.65.0, 0.67.0

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
rust-langcargobefore 0.65.0; = 0.66.00.65.0Patch availableCNA
—cargo (crates.io)before 0.65.00.65.0Patch availableGHSA-2hvr-h6gw-qrxp
—cargo (crates.io)0.66.0 to before 0.67.00.67.0Patch availableGHSA-2hvr-h6gw-qrxp
  • cargo Vendorrust-lang Affected before 0.65.0; = 0.66.0 Fixed in 0.65.0 Patch available CNA
  • cargo (crates.io) Vendor— Affected before 0.65.0 Fixed in 0.65.0 Patch available GHSA-2hvr-h6gw-qrxp
  • cargo (crates.io) Vendor— Affected 0.66.0 to before 0.67.0 Fixed in 0.67.0 Patch available GHSA-2hvr-h6gw-qrxp

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:rust-lang:cargo:*:*:*:*:*:rust:*:*before 0.65.0Vulnerablerust-lang
  • cpe:2.3:a:rust-lang:cargo:*:*:*:*:*:rust:*:* Versions before 0.65.0 Vulnerable ·rust-lang

Remediation

  • Fix · CNA cargo (rust-lang) Fixed in 0.65.0
  • Fix · GHSA-2hvr-h6gw-qrxp cargo (crates.io) Fixed in 0.65.0 Advisory →
  • Fix · GHSA-2hvr-h6gw-qrxp cargo (crates.io) Fixed in 0.67.0 Advisory →

Vendor assessments

Red Hat

Red Hat's page for this CVE →

Not affected: 1 product
  • Red Hat

Timeline

  1. 2026-10-02 Threatist record created from CVE-2022-36114
  2. 2026-10-03 Alias added: GHSA-2hvr-h6gw-qrxp

References

  • TI-2022-16536 Extracting malicious crates can corrupt arbitrary files CVSS 3.1HIGH 8.1
  • TI-2023-19877 Cargo not respecting umask when extracting crate archives CVSS 3.1HIGH 7.8
  • TI-2026-04563 Crates in third party registries can override the cached source of other crates CVSS 4.0MEDIUM 6.5
  • TI-2022-22820 Cargo did not verify SSH host keys CVSS 3.1MEDIUM 5.9
  • TI-2026-04562 Cargo can be coerced to share credentials between registries CVSS 4.0LOW 2.3

Sources