cve.bz

CVE-2022-36114 rust-lang cargo: Uncontrolled Resource Consumption

6.5 mediumEPSS 1.0%Fix available

Medium (6.5) in rust-lang cargo. EPSS 1.0% estimated probability of exploitation activity in the next 30 days. Fixed in cargo 0.65.0, 0.67.0.

On this page
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.

Severity

CVSS 3.1

6.5 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
EPSS
1.0% (unchanged from 1.0% a week ago; 0.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 64th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2025-04-23. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-400 Uncontrolled Resource Consumption
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-36114 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-36114?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-36114?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-36114 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
rust-lang:cargobefore 0.65.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-2hvr-h6gw-qrxpcrates.iocargo<0.65.00.65.0
GHSA-2hvr-h6gw-qrxpcrates.iocargo>=0.66.0 <0.67.00.67.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12cargo0.63.1-1DEBIAN-CVE-2022-36114
Debian12, 13, 14rust-cargo0.66.0-1DEBIAN-CVE-2022-36114
Ubuntu20.04:LTScargo0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2UBUNTU-CVE-2022-36114
Ubuntu22.04:LTScargo0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2UBUNTU-CVE-2022-36114
UbuntuPro:16.04:LTS, Pro:18.04:LTScargono fix listedUBUNTU-CVE-2022-36114
SUSELinux Enterprise Module for Development Tools 15 SP3, Linux Enterprise Module for Development Tools 15 SP4rust1.621.62.1-150300.7.7.1SUSE-SU-2022:3451-1
openSUSELeap 15.3, Leap 15.4rust1.621.62.1-150300.7.7.1SUSE-SU-2022:3451-1
openSUSETumbleweedrust1.621.62.1-3.1openSUSE-SU-2024:12343-1
openSUSETumbleweedrust1.631.63.0-3.1openSUSE-SU-2024:12344-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE.

Attack patterns (CAPEC)

  • CAPEC-147 XML Ping of the Death Likelihood: Low · Severity: Medium
  • CAPEC-227 Sustained Client Engagement
  • CAPEC-492 Regular Expression Exponential Blowup

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON