CVE-2022-36113 in Rust-Lang Cargo
Cargo is a package manager for the rust programming language. After a package is downloaded, Cargo extracts its source code in the ~/.cargo folder on disk, making it available to the Rust projects it builds. To record when an extraction is successful, Cargo writes "ok" to the .cargo-ok file at the root of the extrac...
Affects 1 product from 1 vendor. Facts below cite their sources.
Remotely exploitable over the network, low complexity, no authentication required, requires user interaction, impact contained to the vulnerable component, no confidentiality impact, full integrity impact, full availability impact.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Rust-Lang | Cargo | < 0.65.0 |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
No official vendor advisory link on record. See the CVE record.
Exploitation
| CISA known-exploited | Not in the CISA KEV catalog |
|---|---|
| Public exploit | Not confirmed |
Official description
Cargo is a package manager for the rust programming language. After a package is downloaded, Cargo extracts its source code in the ~/.cargo folder on disk, making it available to the Rust projects it builds. To record when an extraction is successful, Cargo writes "ok" to the .cargo-ok file at the root of the extracted source code once it extracted all the files. It was discovered that Cargo allowed packages to contain a .cargo-ok symbolic link, which Cargo would extract. Then, when Cargo attempted to write "ok" into .cargo-ok, it would actually replace the first two bytes of the file the symlink pointed to with ok. This would allow an attacker to corrupt one file on the machine using Cargo to extract 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. Mitigations We recommend users of alternate registries to exercise 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 exercise care in choosing their dependencies though, as remote code execution is allowed by design there as well.
Source: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2022-36113 |
|---|---|
| BreachSpider ID | BS-2022-GLOBAL-065863-H |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H |
| Published | 2022-09-14 |
| Last modified | 2026-06-17 |
| Weakness (CWE) | |
| Source | NVD |
Weakness definitions
CWE-22: Path Traversal
Attacker manipulates file path inputs to access files outside the intended directory.
CWE-59: Improper Link Resolution Before File Access
Software follows symbolic links without verifying the target, allowing read, write, or delete of unintended files.
Related attack patterns (CAPEC)
CAPEC-35 Leverage Executable Code in Non-Executable Files via CWE-59
CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic via CWE-22
CAPEC-76 Manipulating Web Input to File System Calls via CWE-22, CWE-59
CAPEC-78 Using Escaped Slashes in Alternate Encoding via CWE-22
CAPEC-79 Using Slashes in Alternate Encoding via CWE-22
Show all 8
CAPEC-132 Symlink Attack via CWE-59
CAPEC-17 Using Malicious Files via CWE-59
CAPEC-126 Path Traversal via CWE-22
Mapping is CWE to CAPEC per MITRE CAPEC 3.9.
Analysis AI-written, not human-reviewed
CVE-2022-36113 affects Cargo, the Rust package manager, by allowing a malicious actor to manipulate the .cargo-ok file, potentially leading to arbitrary code execution or other security issues.
An attacker could craft a malicious package that, when downloaded and extracted by Cargo, could manipulate the .cargo-ok file to bypass intended security checks or execute arbitrary code.
Questions
What is CVE-2022-36113?
CVE-2022-36113 affects Cargo, the Rust package manager, by allowing a malicious actor to manipulate the .cargo-ok file, potentially leading to arbitrary code execution or other security issues.
What is the CVSS score for CVE-2022-36113?
CVE-2022-36113 has CVSS 8.1 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H. EPSS: 1.3%.
Is CVE-2022-36113 actively exploited?
No confirmed active exploitation of CVE-2022-36113 as of 2026-09-25.
How do I remediate CVE-2022-36113?
Priority: HIGH.
What systems are affected by CVE-2022-36113?
CVE-2022-36113 affects Rust-Lang Cargo.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Rust-Lang","product":"Cargo","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.