CVE-2023-40030
Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports
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.
Exposure status: unknown. This page does not establish whether an installed system is affected or corrected.
Severity and exploitation evidence
EPSS: 0.895% · score date 2026-11-19. EPSS is an estimated probability over the next 30 days, not proof of exploitation.
CISA KEV: not included in the checked catalog; exploitation may still occur. Last checked: 2026-11-19T17:28:52.703Z. Public exploit availability is not used to set this status.
CVSS 3.1 · 6.1 · published by GitHub_MCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Assessment source · checked 2026-11-19T12:56:57.967Z
CVSS 3.1 · 6.1 · published by Ubuntu SecurityCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Assessment source · checked 2026-11-19T16:51:15.805Z
Verification by field
| Field | Status | Checked at (UTC) | Source |
|---|---|---|---|
| kev | verified | 2026-11-19T17:28:52.703Z | CISA KEV |
| cvss | verified | 2026-11-19T12:56:57.967Z | CVE Program |
| epss | verified | 2026-11-19T16:04:36.838Z | FIRST EPSS |
| patches | verified | 2026-11-19T16:51:15.805Z | Ubuntu Security |
| affected | verified | 2026-11-19T12:56:57.967Z | CVE Program |
| lifecycle | verified | 2026-11-19T12:56:57.967Z | CVE Program |
Affected versions and configuration
rust-lang cargo; default status: unknown: >= 1.60.0, < 1.72 [affected; scheme: unspecified]
Defaults, conditional configuration, package status and version schemes are retained below. A version range alone is not an exposure verdict.
Ubuntu Security · ubuntu-package · full conditions
[
{
"name": "rustc",
"debian": "https://tracker.debian.org/pkg/rustc",
"source": "https://ubuntu.com/security/cve?package=rustc",
"ubuntu": "https://packages.ubuntu.com/search?suite=all§ion=all&arch=any&searchon=sourcenames&keywords=rustc",
"statuses": [
{
"pocket": "security",
"status": "DNE",
"component": null,
"description": "",
"release_codename": "stonking"
},
{
"pocket": "security",
"status": "ignored",
"component": null,
"description": "end of life, was needs-triage",
"release_codename": "lunar"
},
{
"pocket": "security",
"status": "ignored",
"component": null,
"description": "end of life, was needs-triage",
"release_codename": "mantic"
},
{
"pocket": "security",
"status": "not-affected",
"component": null,
"description": "cargo used from system",
"release_codename": "bionic"
},
{
"pocket": "security",
"status": "not-affected",
"component": null,
"description": "cargo used from system",
"release_codename": "focal"
},
{
"pocket": "security",
"status": "not-affected",
"component": null,
"description": "cargo used from system",
"release_codename": "jammy"
},
{
"pocket": "security",
"status": "released",
"component": null,
"description": "1.73.0+dfsg0ubuntu1-0ubuntu1",
"release_codename": "noble"
},
{
"pocket": "security",
"status": "not-affected",
"component": null,
"description": "cargo used from system",
"release_codename": "trusty"
},
{
"pocket": "security",
"status": "released",
"component": null,
"description": "1.72",
"release_codename": "upstream"
},
{
"pocket": "security",
"status": "not-affected",
"component": null,
"description": "cargo used from system",
"release_codename": "xenial"
},
{
"pocket": "security",
"status": "DNE",
"component": null,
"description": "",
"release_codename": "oracular"
},
{
"pocket": "security",
"status": "DNE",
"component": null,
"description": "",
"release_codename": "plucky"
},
{
"pocket": "security",
"status": "DNE",
"component": null,
"description": "",
"release_codename": "questing"
},
{
"pocket": "security",
"status": "DNE",
"component": null,
"description": "",
"release_codename": "resolute"
}
]
}
]Archived source JSONCVE Program · cve-json · full conditions
{
"affected": [
{
"vendor": "rust-lang",
"product": "cargo",
"versions": [
{
"status": "affected",
"version": ">= 1.60.0, < 1.72"
}
]
}
],
"additionalContainers": [
{
"title": "CVE Program Container",
"references": [
{
"url": "https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p",
"name": "https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p",
"tags": [
"x_refsource_CONFIRM",
"x_transferred"
]
},
{
"url": "https://github.com/rust-lang/cargo/pull/12291",
"name": "https://github.com/rust-lang/cargo/pull/12291",
"tags": [
"x_refsource_MISC",
"x_transferred"
]
},
{
"url": "https://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33",
"name": "https://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33",
"tags": [
"x_refsource_MISC",
"x_transferred"
]
},
{
"url": "https://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365",
"name": "https://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365",
"tags": [
"x_refsource_MISC",
"x_transferred"
]
}
],
"providerMetadata": {
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE",
"dateUpdated": "2024-08-02T18:24:54.788Z"
}
},
{
"title": "CISA ADP Vulnrichment",
"metrics": [
{
"other": {
"type": "ssvc",
"content": {
"id": "CVE-2023-40030",
"role": "CISA Coordinator",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"version": "2.0.3",
"timestamp": "2024-09-30T19:08:43.006051Z"
}
}
}
],
"providerMetadata": {
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP",
"dateUpdated": "2024-09-30T19:09:34.361Z"
}
}
]
}Archived source JSONCorrection evidence
Distribution packages and upstream releases are distinct. ESM channels may require the corresponding Ubuntu entitlement. Notes and branch ranges are not installable package versions. OSV fixed boundaries are ecosystem-specific version thresholds, not proof that a package is currently available or installed.
| Evidence type | Distribution / release | Package | Channel | Version or source note | Source |
|---|---|---|---|---|---|
| distribution-package | Ubuntu / noble | rustc | security | 1.73.0+dfsg0ubuntu1-0ubuntu1 | Official record |
| upstream-release | upstream / upstream | rustc | Not a distribution channel | 1.72 | Official record |
Vendor notices and operational guidance
No connected vendor notice is available for this record.
Original sources and dates
- CISA KEVConsulted: 2026-11-19T17:28:52.703ZArchived source JSON
Source publication: not supplied
Source modification: 2026-11-18T19:17:41.0354ZDocument fingerprint
a35fdc67c7d9802988dcfc1d3ff1198da327948d1db122ab7692ac201055ac56 - CVE ProgramConsulted: 2026-11-19T12:56:57.967ZArchived source JSON
Source publication: 2023-08-24T22:56:41.085Z
Source modification: 2024-09-30T19:09:34.361ZDocument fingerprint
fc8fa9b62b82a654cf6e25c1f23dd2045a4c1c178fc5a2e63fe539fbae16dcd8 - Ubuntu SecurityConsulted: 2026-11-19T16:51:15.805ZArchived source JSON
Source publication: 2023-08-24T23:15:00.000Z
Source modification: 2025-08-04T18:51:03.965ZDocument fingerprint
2604218f1be4c8cb1a980ad023b815eeee102e910ea25aebc1db1250855864f2 - FIRST EPSSConsulted: 2026-11-19T16:04:36.838ZArchived source JSON
Source publication: not supplied
Source modification: not suppliedDocument fingerprint
752b5a4ab7063ebae6041b8a2218e2c7a480f9f66d4152a818c6a0713b1fa460
Official status history
- UNKNOWN → PUBLISHED · · evidence