Skip to content
Noroxi
NVD / CVE Program· CNA GitHub_M

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.

MediumCVSS 6.1 · v3.1—No exploit Fix available
Published
Aug 24, 2023
Updated
Jun 17, 2026
EPSS
0.8% · 59th percentile

Report tools

JSON

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.

Follow CVE-2023-40030

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits instantly.

Your free account also gets you

Running WordPress? Scan your site free with WP Lens

  • Stack alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools

Sign up with email · Have an account? Sign in

Free account, no card. Unfollow any time.

Running WordPress? Scan your site free with WP Lens

Is your version affected? Check it

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 help

Affected 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.

VendorProduct
rust-langrust

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 headers

Affected 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.

EcosystemPackageAffected rangeFix
crates.iocargofrom 1.60.0 · before 1.721.72
Debian:12cargofrom 0—
Debian:12rust-cargofrom 0—
Debian:13rust-cargobefore 0.76.0-10.76.0-1
openSUSE:Leap 15.4rustbefore 1.72.0-150400.24.24.11.72.0-150400.24.24.1
openSUSE:Leap 15.4rust1.72before 1.72.0-150400.9.3.11.72.0-150400.9.3.1
openSUSE:Tumbleweedrust1.72before 1.72.1-1.11.72.1-1.1
SUSE:Linux Enterprise Module for Development Tools 15 SP4rustbefore 1.72.0-150400.24.24.11.72.0-150400.24.24.1
SUSE:Linux Enterprise Module for Development Tools 15 SP4rust1.72before 1.72.0-150400.9.3.11.72.0-150400.9.3.1

Other 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 c
    40Plan

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 rustlang
    25Monitor
  • Later →CVE-2024-43402Sep 4, 2024 · Rust OS Command Injection/Argument Injection vulnerability
    35Monitor

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
crates.io:cargo1.72Package registry (OSV)
debian:rust-cargo0.76.0-1 · Debian:13Package registry (OSV)
opensuse:rust1.72.0-150400.24.24.1 · openSUSE:Leap 15.4Package registry (OSV)
opensuse:rust1.721.72.0-150400.9.3.1 · openSUSE:Leap 15.4Package registry (OSV)
suse:rust1.72.0-150400.24.24.1 · SUSE:Linux Enterprise Module for Development Tools 15 SP4Package registry (OSV)
suse:rust1.721.72.0-150400.9.3.1 · SUSE:Linux Enterprise Module for Development Tools 15 SP4Package 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.

Finders, 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

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.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

ts
commentEl.innerHTML = comment.body;

Fixed

ts
commentEl.textContent = comment.body;

Change log

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records