CVE-2023-40030: Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports
Noroxi assessment
Priority: Monitor (action score 24/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: 0.89% (FIRST EPSS); higher than 59.7% 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) 1.72; rust-cargo (Debian:13) 0.76.0-1; rust (openSUSE:Leap 15.4) 1.72.0-150400.24.24.1.
Low priority for now. Upgrade to cargo (crates.io) 1.72; rust-cargo (Debian:13) 0.76.0-1; rust (openSUSE:Leap 15.4) 1.72.0-150400.24.24.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 downloads a Rust project’s dependencies and compiles the project. Starting in Rust 1.60.0 and prior to 1.72, Cargo did not escape Cargo feature names when including them in the report generated by `cargo build --timings`. A malicious package included as a dependency may inject nearly arbitrary HTML here, potentially leading to cross-site scripting if the report is subsequently uploaded somewhere. The vulnerability affects users relying on dependencies from git, local paths, or alternative registries. Users who solely depend on crates.io are unaffected. Rust 1.60.0 introduced `cargo build --timings`, which produces a report of how long the different steps of the build process took. It includes lists of Cargo features for each crate. Prior to Rust 1.72, Cargo feature names were allowed to contain almost any characters (with some exceptions as used by the feature syntax), but it would produce a future incompatibility warning about them since Rust 1.49. crates.io is far more stringent about what it considers a valid feature name and has not allowed such feature names. As the feature names were included unescaped in the timings report, they could be used to inject Javascript into the page, for example with a feature name like `features = ["<img src='' onerror=alert(0)"]`. If this report were subsequently uploaded to a domain that uses credentials, the injected Javascript could access resources from the website visitor. This issue was fixed in Rust 1.72 by turning the future incompatibility warning into an error. Users should still 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 has server-side checks preventing this attack, 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 remote code execution is allowed by design there as well.
- Published
- Aug 24, 2023
- Updated
- Jun 17, 2026
- EPSS
- 0.8% · 59th percentile
- CWE
- CWE-79
Report tools
Action score
24
Monitor
Low priority for now.
- CVSS
- 24 / 40 · 6.1 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.8%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 6.1
- CNA · GitHub_M
- 6.1
- agree
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 | rust | cpe:2.3:a:rust-lang:rust |
Limit the impact of XSS
This is a cross-site scripting (XSS) vulnerability. A well-configured Content-Security-Policy doesn't fix it, but greatly reduces its impact. Check your site's CSP and other security headers for free.
Check security headersAffected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- rust-lang rust1.60.0 and later · before 1.72.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
- >= 1.60.0, < 1.72affected
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 1.60.0 · before 1.72 | 1.72 |
| Debian:12 | cargo | from 0 | — |
| Debian:12 | rust-cargo | from 0 | — |
| Debian:13 | rust-cargo | before 0.76.0-1 | 0.76.0-1 |
| openSUSE:Leap 15.4 | rust | before 1.72.0-150400.24.24.1 | 1.72.0-150400.24.24.1 |
| openSUSE:Leap 15.4 | rust1.72 | before 1.72.0-150400.9.3.1 | 1.72.0-150400.9.3.1 |
| openSUSE:Tumbleweed | rust1.72 | before 1.72.1-1.1 | 1.72.1-1.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP4 | rust | before 1.72.0-150400.24.24.1 | 1.72.0-150400.24.24.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP4 | rust1.72 | before 1.72.0-150400.9.3.1 | 1.72.0-150400.9.3.1 |
Same product
rust-lang: all recordsOther highest-scoring records for the same primary product.
- CVE-2021-31162In the standard library in Rust before 1.52.0, a double free can occur in the Vec::from_iter function if freeing the element panics.40Plan
- CVE-2021-28879In the standard library in Rust before 1.52.0, the Zip implementation can report an incorrect size due to an integer overflow.40Plan
- CVE-2020-36318In the standard library in Rust before 1.49.0, VecDeque::make_contiguous has a bug that pops the same element more than once under certain c40Plan
Published before and after this one in the same product
- ← EarlierCVE-2021-29922Aug 7, 2021 · library/std/src/net/parser.rs in Rust before 1.53.0 does not properly consider extraneous zero characters at the beginning of an IP address 37Monitor
- ← EarlierCVE-2022-21658Jan 20, 2022 · Race condition in std::fs::remove_dir_all in rustlang25Monitor
- Later →CVE-2024-43402Sep 4, 2024 · Rust OS Command Injection/Argument Injection vulnerability35Monitor
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 | 1.72 | Package registry (OSV) |
| debian:rust-cargo | 0.76.0-1 · Debian:13 | Package registry (OSV) |
| opensuse:rust | 1.72.0-150400.24.24.1 · openSUSE:Leap 15.4 | Package registry (OSV) |
| opensuse:rust1.72 | 1.72.0-150400.9.3.1 · openSUSE:Leap 15.4 | Package registry (OSV) |
| suse:rust | 1.72.0-150400.24.24.1 · SUSE:Linux Enterprise Module for Development Tools 15 SP4 | Package registry (OSV) |
| suse:rust1.72 | 1.72.0-150400.9.3.1 · SUSE:Linux Enterprise Module for Development Tools 15 SP4 | 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.
No history yet (it accumulates with the daily EPSS job).
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
- low · data can be read
- Integrity
- low · data or configuration can be modified
- Availability
- none
Impact can extend beyond the vulnerable component (scope changes).
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Changed
- Confidentiality impact
- Low
- Integrity impact
- Low
- Availability impact
- None
Weakness class (CWE)
CWE-79 · Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
nvd-primary
Root cause
User content is inserted into the page as HTML. The browser interprets the content as code rather than data.
The bug in code
The whole CWE-79 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
commentEl.innerHTML = comment.body;Fixed
commentEl.textContent = comment.body;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)
ATT&CK techniques
—
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (3 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.