Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. cargo
  4. ›
  5. CVE-2022-36113

CVE-2022-36113: Cargo extracting malicious crates can corrupt arbitrary files

September 16, 2022 (updated September 21, 2022)

The Rust Security Response WG was notified that Cargo did not prevent extracting some malformed packages downloaded from alternate registries. An attacker able to upload packages to an alternate registry could corrupt arbitary files when Cargo downloaded the package.

The severity of this vulnerability is “low” for users of alternate registries. Users relying on crates.io are not affected.

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.

References

  • github.com/advisories/GHSA-rfj2-q3h3-hm5j
  • github.com/rust-lang/cargo
  • github.com/rust-lang/cargo/commit/15f1e4b0bf4b4fc20369e0a85d9b77957c4dd52a
  • github.com/rust-lang/cargo/commit/97b80919e404b0768ea31ae329c3b4da54bed05a
  • github.com/rust-lang/cargo/commit/dafe4a7ea016739680ec7998aebe1bc6de131a5b
  • github.com/rust-lang/cargo/security/advisories/GHSA-rfj2-q3h3-hm5j
  • nvd.nist.gov/vuln/detail/CVE-2022-36113
  • security.gentoo.org/glsa/202210-09

Code Behaviors & Features

Detect and mitigate CVE-2022-36113 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.65.0, all versions starting from 0.66.0 before 0.67.0, version 0.66.0

Fixed versions

  • 0.65.0
  • 0.67.0

Solution

Upgrade to versions 0.65.0, 0.67.0 or above.

Impact 3.9 LOW

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

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-59: Improper Link Resolution Before File Access ('Link Following')

Source file

cargo/cargo/CVE-2022-36113.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:22 +0000.