CVE-2022-36113: Cargo extracting malicious crates can corrupt arbitrary files
(updated )
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
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 →