{"id":"CVE-2023-40030","aliases":["AZL-28511","BELL-CVE-2023-40030","DEBIAN-CVE-2023-40030","EUVD-2023-2375","GHSA-wrrj-h57r-vx9p","SUSE-SU-2023:3722-1","UBUNTU-CVE-2023-40030","openSUSE-SU-2024:13262-1"],"status":"published","title":"Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports","description":"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.\n\nRust 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 = [\"\u003cimg 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.\n\nThis 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.","severity":{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00895,"percentile":0.59845,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2023-08-24T22:15:51Z","modified":"2026-10-28T02:31:10Z","fixes":[{"ecosystem":"crates.io","package":"cargo","fixed_in":["1.72"],"sources":["ghsa","osv"]},{"ecosystem":"Azure Linux:2","package":"rust","fixed_in":["1.72.0-2"],"sources":["osv"]},{"ecosystem":"Alpaquita:stream","package":"rust","fixed_in":["1.72.0-r1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"rust-cargo","fixed_in":["0.76.0-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"rust-cargo","fixed_in":["0.76.0-1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"rust","fixed_in":["1.72.0-150400.24.24.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"rust1.72","fixed_in":["1.72.0-150400.9.3.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP5","package":"rust","fixed_in":["1.72.0-150400.24.24.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP5","package":"rust1.72","fixed_in":["1.72.0-150400.9.3.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.4","package":"rust","fixed_in":["1.72.0-150400.24.24.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.4","package":"rust1.72","fixed_in":["1.72.0-150400.9.3.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.5","package":"rust","fixed_in":["1.72.0-150400.24.24.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.5","package":"rust1.72","fixed_in":["1.72.0-150400.9.3.1"],"sources":["osv"]},{"ecosystem":"Ubuntu:24.04:LTS","package":"rustc","fixed_in":["1.73.0+dfsg0ubuntu1-0ubuntu1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"rust1.72","fixed_in":["1.72.1-1.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.60.0"},{"fixed":"1.72"}]}]},{"source":"osv","ecosystem":"Azure Linux:2","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.0-2"}]}]},{"source":"osv","ecosystem":"Alpaquita:23","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.64.0-r2"}]}]},{"source":"osv","ecosystem":"Alpaquita:stream","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.69.0-r10"},{"fixed":"1.72.0-r1"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.66.0+ds1-1","0.66.0+ds2-1","0.66.0+ds2-2","0.70.1+ds1-1","0.70.1+ds1-1~exp1","0.70.1+ds1-2","0.70.1+ds1-3","0.70.1-1~exp1"]},{"source":"osv","ecosystem":"Debian:12","package":"rust-cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.66.0-1","0.66.0-2","0.66.0-3","0.66.0-4","0.66.0-5","0.66.0-6","0.70.1-1","0.70.1-2","0.70.1-3","0.76.0-1","0.76.0-2","0.76.0-3","0.76.0-4","0.81.0-1","0.81.0-2","0.81.0-3","0.82.0-1","0.83.0-1","0.83.0-2","0.84.0-1","0.85.0-1","0.86.0-1","0.86.0-2","0.86.0-3","0.86.0-4","0.91.0-1","0.91.0-2","0.91.0-3","0.91.0-4","0.91.0-5","0.96.0-1","0.96.0-2","0.99.0-1"]},{"source":"osv","ecosystem":"Debian:13","package":"rust-cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.76.0-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"rust-cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.76.0-1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.60.0"},{"fixed":"1.72"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.0-150400.24.24.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"rust1.72","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.0-150400.9.3.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP5","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.0-150400.24.24.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP5","package":"rust1.72","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.0-150400.9.3.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.4","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.0-150400.24.24.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.4","package":"rust1.72","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.0-150400.9.3.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.5","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.0-150400.24.24.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.5","package":"rust1.72","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.0-150400.9.3.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.8.0-1","0.16.0-0ubuntu1~16.04.1","0.18.0-0ubuntu0.16.04.1","0.22.0-0ubuntu0.16.04.1","0.23.0-0ubuntu0.16.04.1","0.25.0-1ubuntu1~16.04.1","0.26.0-0ubuntu2~16.04.1","0.29.0-1ubuntu1~16.04.1","0.31.0-3ubuntu1~16.04.1","0.32.0-1~exp1ubuntu1~16.04.1","0.33.0-1ubuntu1~16.04.1","0.35.0-0ubuntu1~16.04.1","0.36.0-0ubuntu1~16.04.1","0.37.0-3ubuntu1~16.04.1","0.38.0-0ubuntu1~16.04.1","0.40.0-3ubuntu1~16.04.1","0.42.0-0ubuntu1~16.04.1","0.44.1-0ubuntu1~16.04.1","0.47.0-1~exp1ubuntu1~16.04.1","0.47.0-1~exp1ubuntu1~16.04.1+esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.19.0-0ubuntu1","0.22.0-0ubuntu1","0.22.0-0ubuntu2","0.23.0-0ubuntu1","0.24.0-1ubuntu1","0.25.0-1ubuntu1","0.26.0-0ubuntu1","0.26.0-0ubuntu2","0.29.0-1ubuntu1~18.04.1","0.31.0-3ubuntu1~18.04.4","0.32.0-1~exp1ubuntu1~18.04.1","0.33.0-1ubuntu1~18.04.1","0.35.0-0ubuntu1~18.04.1","0.36.0-0ubuntu1~18.04.1","0.37.0-3ubuntu1~18.04.1","0.38.0-0ubuntu1~18.04.1","0.40.0-3ubuntu1~18.04.1","0.42.0-0ubuntu1~18.04.1","0.44.1-0ubuntu1~18.04.1","0.47.0-1~exp1ubuntu1~18.04.1","0.52.0-0ubuntu1~18.04.1","0.54.0-0ubuntu1~18.04.1","0.58.0-0ubuntu1~18.04.1","0.60.0ubuntu1-0ubuntu1~18.04.1","0.62.0ubuntu0libgit2-0ubuntu0.18.04.1","0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04","0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.37.0-3ubuntu2","0.38.0-0ubuntu1","0.39.0-0ubuntu1","0.39.0+really0.38.0-0ubuntu1","0.39.0+really0.39.0-0ubuntu1","0.40.0-3ubuntu1","0.40.0-3ubuntu2","0.41.0-0ubuntu1","0.42.0-0ubuntu1","0.44.1-0ubuntu1~20.04.1","0.47.0-1~exp1ubuntu1~20.04.1","0.52.0-0ubuntu1~20.04.1","0.54.0-0ubuntu1~20.04.1","0.58.0-0ubuntu1~20.04.1","0.60.0ubuntu1-0ubuntu1~20.04.1","0.62.0ubuntu0libgit2-0ubuntu0.20.04.1","0.66.0+ds0ubuntu0.libgit2-0ubuntu0.20.04","0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2","0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2+esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.52.0-0ubuntu1","0.53.0-0ubuntu2","0.54.0-0ubuntu1","0.54.0-0ubuntu2","0.57.0+ubuntu-0ubuntu1","0.58.0-0ubuntu1","0.60.0ubuntu1-0ubuntu1~22.04.1","0.62.0ubuntu0libgit2-0ubuntu0.22.04.1","0.66.0+ds0ubuntu0.libgit2-0ubuntu0.22.04","0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2","0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2+esm1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"rustc","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.73.0+dfsg0ubuntu1-0ubuntu1"}]}],"versions":["1.71.1+dfsg0ubuntu2-0ubuntu1"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"rust1.72","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.72.1-1.1"}]}]}],"products":[{"vendor":"rust-lang","product":"cargo"},{"vendor":"rust-lang","product":"rust"}],"references":[{"url":"https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p","tags":["x_refsource_CONFIRM","x_transferred","Vendor Advisory","advisory","web","report"]},{"url":"https://github.com/rust-lang/cargo/pull/12291","tags":["x_refsource_MISC","x_transferred","Issue Tracking","Patch","fix","report"]},{"url":"https://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33","tags":["x_refsource_MISC","x_transferred","Patch","fix","web","report"]},{"url":"https://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365","tags":["x_refsource_MISC","x_transferred","Patch","fix","web","report"]},{"url":"https://github.com/advisories/GHSA-wrrj-h57r-vx9p"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-40030","tags":["web","advisory"]},{"url":"https://docs.bell-sw.com/security/cves/CVE-2023-40030","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/40xxx/CVE-2023-40030.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2023-40030","tags":["advisory"]},{"url":"https://github.com/rust-lang/cargo","tags":["package"]},{"url":"https://www.suse.com/support/update/announcement/2023/suse-su-20233722-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1214689","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2023-40030","tags":["web"]},{"url":"https://ubuntu.com/security/CVE-2023-40030","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2023-40030","tags":["report"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2023-40030","title":"Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports","description":"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.\n\nRust 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 = [\"\u003cimg 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.\n\nThis 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.","status":"published","published":"2023-08-24T22:56:41.085Z","modified":"2024-09-30T19:09:34.361Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:35:22.309324Z"}],"euvd":[{"id":"EUVD-2023-2375","description":"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.\n\nRust 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 = [\"\u003cimg 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.\n\nThis 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.","status":"published","published":"2023-08-24T22:56:41Z","modified":"2024-09-30T19:09:34Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-03T00:28:01.909154Z"}],"ghsa":[{"id":"GHSA-wrrj-h57r-vx9p","title":"Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports","description":"The Rust Security Response WG was notified that 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 XSS if the report is subsequently uploaded somewhere.\n\nThe severity of this vulnerability is \"low\" for users relying on dependencies from git, local paths, or alternative registries. Users who solely depend on crates.io are unaffected.\n\n\nNote that **by design** Cargo allows code execution at build time, due to build scripts and procedural macros. The vulnerability in this advisory allows 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.\n\n# Overview\n\nRust 1.60.0 [introduced](https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html#cargo---timings) `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.\n\nPrior 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](https://github.com/rust-lang/cargo/pull/8814). crates.io is far more stringent about what it considers a valid feature name and has not allowed such feature names.\n\nAs the feature names defined in the `Cargo.toml` file 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 = [\"\u003cimg 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.\n\nThis issue was fixed by [turning the future incompatibility warning into an error](https://github.com/rust-lang/cargo/pull/12291).\n\n# Affected versions\n\nThe vulnerability is present in all versions of Cargo after and including 1.60.0. Rust 1.72, to be released on August 24, will include a fix for it.\n\nUsers whose dependencies are entirely on crates.io are unaffected.\n\n# Mitigations\n\nWe recommend users always excercise 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.\n\ncrates.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.","status":"published","published":"2023-08-24T22:15:51Z","modified":"2025-06-24T20:17:28Z","cwes":["CWE-79"],"updated_at":"2026-11-02T14:38:47.835488Z"}],"nvd":[{"id":"CVE-2023-40030","description":"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.\n\nRust 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 = [\"\u003cimg 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.\n\nThis 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.","status":"published","published":"2023-08-24T23:15:09.287Z","modified":"2026-06-17T06:15:50.403Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:08:25.025396Z"}],"osv":[{"id":"AZL-28511","title":"CVE-2023-40030 affecting package rust for versions less than 1.72.0-2","description":"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.\n\nRust 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 = [\"\u003cimg 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.\n\nThis 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.","status":"published","published":"2023-08-24T23:15:09Z","modified":"2026-04-21T04:25:51.473477Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:28:03.46006Z"},{"id":"BELL-CVE-2023-40030","status":"published","published":"2023-08-24T23:15:00Z","modified":"2026-01-26T09:33:34.380189Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:28:17.742221Z"},{"id":"CVE-2023-40030","title":"Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports","description":"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.\n\nRust 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 = [\"\u003cimg 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.\n\nThis 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.","status":"published","published":"2023-08-24T22:56:41.085Z","modified":"2026-10-28T02:31:10.362315238Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:44:33.244128Z"},{"id":"DEBIAN-CVE-2023-40030","description":"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 = [\"\u003cimg 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.","status":"published","published":"2023-08-24T23:15:09.287Z","modified":"2026-10-26T18:02:31.466311308Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:45:39.980321Z"},{"id":"UBUNTU-CVE-2023-40030","description":"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 = [\"\u003cimg 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.","status":"published","published":"2023-08-24T23:15:00Z","modified":"2026-04-22T14:10:59.876959Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T16:54:22.741943Z"},{"id":"GHSA-wrrj-h57r-vx9p","title":"Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports","description":"The Rust Security Response WG was notified that 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 XSS if the report is subsequently uploaded somewhere.\n\nThe severity of this vulnerability is \"low\" for users relying on dependencies from git, local paths, or alternative registries. Users who solely depend on crates.io are unaffected.\n\n\nNote that **by design** Cargo allows code execution at build time, due to build scripts and procedural macros. The vulnerability in this advisory allows 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.\n\n# Overview\n\nRust 1.60.0 [introduced](https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html#cargo---timings) `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.\n\nPrior 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](https://github.com/rust-lang/cargo/pull/8814). crates.io is far more stringent about what it considers a valid feature name and has not allowed such feature names.\n\nAs the feature names defined in the `Cargo.toml` file 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 = [\"\u003cimg 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.\n\nThis issue was fixed by [turning the future incompatibility warning into an error](https://github.com/rust-lang/cargo/pull/12291).\n\n# Affected versions\n\nThe vulnerability is present in all versions of Cargo after and including 1.60.0. Rust 1.72, to be released on August 24, will include a fix for it.\n\nUsers whose dependencies are entirely on crates.io are unaffected.\n\n# Mitigations\n\nWe recommend users always excercise 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.\n\ncrates.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.","status":"published","published":"2023-08-24T22:15:51Z","modified":"2026-09-10T03:49:57.709943115Z","cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:59.131095Z"},{"id":"openSUSE-SU-2024:13262-1","title":"cargo1.72-1.72.1-1.1 on GA media","description":"These are all security issues fixed in the cargo1.72-1.72.1-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2026-02-04T04:24:03.696597Z","updated_at":"2026-11-02T16:58:36.025801Z"},{"id":"SUSE-SU-2023:3722-1","title":"Security update for rust, rust1.72","description":"This update for rust, rust1.72 fixes the following issues:\n\nChanges in rust:\n\n- Update to version 1.72.0 - for details see the rust1.72 package\n\nChanges in rust1.72:\n\n- CVE-2023-40030: fix minor non-exploited issue in cargo (bsc#1214689)\n\n\nVersion 1.72.0 (2023-08-24)\n==========================\n\nLanguage\n--------\n\n- Replace const eval limit by a lint and add an exponential backoff warning\n- expand: Change how `#![cfg(FALSE)]` behaves on crate root\n- Stabilize inline asm for LoongArch64\n- Uplift `clippy::undropped_manually_drops` lint\n- Uplift `clippy::invalid_utf8_in_unchecked` lint\n- Uplift `clippy::cast_ref_to_mut` lint\n- Uplift `clippy::cmp_nan` lint\n- resolve: Remove artificial import ambiguity errors\n- Don't require associated types with Self: Sized bounds in `dyn Trait` objects\n\nCompiler\n--------\n\n- Remember names of `cfg`-ed out items to mention them in diagnostics\n- Support for native WASM exceptions\n- Add support for NetBSD/aarch64-be (big-endian arm64).\n- Write to stdout if `-` is given as output file\n- Force all native libraries to be statically linked when linking a static binary\n- Add Tier 3 support for `loongarch64-unknown-none*`\n- Prevent `.eh_frame` from being emitted for `-C panic=abort`\n- Support 128-bit enum variant in debuginfo codegen\n- compiler: update solaris/illumos to enable tsan support.\n\nRefer to Rust's platform support page for more information on Rust's tiered platform support.\n\nLibraries\n---------\n\n- Document memory orderings of `thread::{park, unpark}`\n- io: soften ‘at most one write attempt’ requirement in io::Write::write\n- Specify behavior of HashSet::insert\n- Relax implicit `T: Sized` bounds on `BufReader\u003cT\u003e`, `BufWriter\u003cT\u003e` and `LineWriter\u003cT\u003e`\n- Update runtime guarantee for `select_nth_unstable`\n- Return `Ok` on kill if process has already exited\n- Implement PartialOrd for `Vec`s over different allocators\n- Use 128 bits for TypeId hash\n- Don't drain-on-drop in DrainFilter impls of various collections.\n- Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata\n\nRustdoc\n-------\n\n- Allow whitespace as path separator like double colon\n- Add search result item types after their name\n- Search for slices and arrays by type with `[]`\n- Clean up type unification and 'unboxing'\n\nStabilized APIs\n---------------\n\n- `impl\u003cT: Send\u003e Sync for mpsc::Sender\u003cT\u003e`\n- `impl TryFrom\u003c\u0026OsStr\u003e for \u0026str`\n- `String::leak`\n\nThese APIs are now stable in const contexts:\n\n- `CStr::from_bytes_with_nul`\n- `CStr::to_bytes`\n- `CStr::to_bytes_with_nul`\n- `CStr::to_str`\n\nCargo\n-----\n\n- Enable `-Zdoctest-in-workspace` by default. When running each documentation\n  test, the working directory is set to the root directory of the package the\n  test belongs to.\n- Add support of the 'default' keyword to reset previously set `build.jobs`\n  parallelism back to the default.\n\nCompatibility Notes\n-------------------\n\n- Alter `Display` for `Ipv6Addr` for IPv4-compatible addresses\n- Cargo changed feature name validation check to a hard error. The warning was\n  added in Rust 1.49. These extended characters aren't allowed on crates.io, so\n  this should only impact users of other registries, or people who don't publish\n  to a registry.\n  ","status":"published","published":"2023-09-21T08:53:26Z","modified":"2026-02-04T03:22:22.313685Z","updated_at":"2026-11-02T15:53:53.440387Z"}]}}
