CVE-2022-36113: Extracting malicious crates can corrupt arbitrary files
Noroxi assessment
Priority: Monitor (action score 32/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 1.2% (FIRST EPSS); higher than 68.2% of all records.
- Anyone who can reach it over the internet can trigger it. No account or password is required. A user must open a link or visit a page. No special conditions are required; it is repeatable.
- Fixed version: cargo (crates.io) 0.67.0, 0.65.0; cargo (Debian:12) 0.63.1-1; rust-cargo (Debian:12) 0.66.0-1.
- Severity is disputed: the assigning authority (CNA) scores it 4.6, NVD 8.1.
Low priority for now. Upgrade to cargo (crates.io) 0.67.0, 0.65.0; cargo (Debian:12) 0.63.1-1; rust-cargo (Debian:12) 0.66.0-1 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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.
- Published
- Sep 14, 2022
- Updated
- Jun 17, 2026
- EPSS
- 1.2% · 68th percentile
- CWE
- CWE-22
Report tools
Action score
32
Monitor
Low priority for now.
- CVSS
- 32 / 40 · 8.1 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 1.2%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 8.1
- CNA · GitHub_M
- 4.6
- 3.5 point gap
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Running WordPress? Scan your site free with WP Lens
Noroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| rust-lang | cargo | cpe:2.3:a:rust-lang:cargo |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- rust-lang cargobefore 0.65.0
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
rust-lang cargo
- < 0.65.0, = 0.66.0affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| crates.io | cargo | from 0.66.0 · before 0.67.0 | 0.67.0 |
| crates.io | cargo | before 0.65.0 | 0.65.0 |
| Debian:12 | cargo | before 0.63.1-1 | 0.63.1-1 |
| Debian:12 | rust-cargo | before 0.66.0-1 | 0.66.0-1 |
| openSUSE:Leap 15.3 | rust1.62 | before 1.62.1-150300.7.7.1 | 1.62.1-150300.7.7.1 |
| openSUSE:Tumbleweed | rust1.62 | before 1.62.1-3.1 | 1.62.1-3.1 |
| openSUSE:Tumbleweed | rust1.63 | before 1.63.0-3.1 | 1.63.0-3.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP3 | rust1.62 | before 1.62.1-150300.7.7.1 | 1.62.1-150300.7.7.1 |
Same product
rust-lang: all recordsOther highest-scoring records for the same primary product.
- CVE-2023-38497Cargo not respecting umask when extracting crate archives29Monitor
- CVE-2026-5223Crates in third party registries can override the cached source of other crates26Monitor
- CVE-2022-36114Extracting malicious crates can fill the file system26Monitor
Published before and after this one in the same product
- Later →CVE-2022-46176Jan 11, 2023 · Cargo did not verify SSH host keys23Monitor
- Later →CVE-2026-5222May 25, 2026 · Cargo can be coerced to share credentials between registries9Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| crates.io:cargo | 0.65.0 | Package registry (OSV) |
| crates.io:cargo | 0.67.0 | Package registry (OSV) |
| debian:cargo | 0.63.1-1 · Debian:12 | Package registry (OSV) |
| debian:rust-cargo | 0.66.0-1 · Debian:12 | Package registry (OSV) |
| opensuse:rust1.62 | 1.62.1-150300.7.7.1 · openSUSE:Leap 15.3 | Package registry (OSV) |
| opensuse:rust1.63 | 1.63.0-3.1 · openSUSE:Tumbleweed | Package registry (OSV) |
| suse:rust1.62 | 1.62.1-150300.7.7.1 · SUSE:Linux Enterprise Module for Development Tools 15 SP3 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- A user must open a link or visit a page.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- none
- Integrity
- high · data or configuration can be modified
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- High
- Availability impact
- High
Weakness class (CWE)
CWE-22 · Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
nvd-primary
Root cause
A user-supplied file name is joined with the allowed directory, but the result is never checked to confirm it is still inside that directory.
The bug in code
The whole CWE-22 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
const file = path.join(ROOT, req.query.name);
res.sendFile(file);Fixed
const file = path.resolve(ROOT, req.query.name);
if (!file.startsWith(ROOT + path.sep)) {
return res.sendStatus(400);
}
res.sendFile(file);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Path TraversalCAPEC-126likelihood: High · Very High
- Using Slashes and URL Encoding Combined to Bypass Validation LogicCAPEC-64likelihood: High · High
- Manipulating Web Input to File System CallsCAPEC-76likelihood: High · Very High
- Using Escaped Slashes in Alternate EncodingCAPEC-78likelihood: High · High
- Using Slashes in Alternate EncodingCAPEC-79likelihood: High · High
ATT&CK techniques
—
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (1 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.