{"id":"EUVD-2023-2375","enisaUuid":"a17ec416-c32c-3647-8a9e-dda20ee95a66","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 \u003d [\"\u003cimg src\u003d\u0027\u0027 onerror\u003dalert(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.","datePublished":"Aug 24, 2023, 10:56:41 PM","dateUpdated":"Sep 30, 2024, 7:09:34 PM","baseScore":6.1,"baseScoreVersion":"3.1","baseScoreVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","references":"https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p\nhttps://github.com/rust-lang/cargo/pull/12291\nhttps://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33\nhttps://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365\n","aliases":"CVE-2023-40030\nGHSA-wrrj-h57r-vx9p\n","assigner":"GitHub_M","epss":0.9,"enisaIdProduct":[{"id":"dd55e86a-20a6-372a-857d-99026b9b934d","product":{"name":"cargo","vendor":{"name":"rust-lang"}},"product_version":"1.60.0, \u003c 1.72"}],"enisaIdVendor":[{"id":"536823d1-26ac-391a-8845-1ff48d5fda0a","vendor":{"name":"rust-lang"}}],"enisaIdVulnerability":[{"id":"1beef64e-5854-3de0-ae22-b327ccffabec","vulnerability":{"id":"GHSA-wrrj-h57r-vx9p","description":"Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports","datePublished":"Aug 24, 2023, 10:15:51 PM","dateUpdated":"Jun 24, 2025, 8:17:26 PM","baseScore":null,"references":"https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p\nhttps://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33\nhttps://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365\nhttps://github.com/rust-lang/cargo\n","enisa_id":"EUVD-2023-2375\n","aliases":"GHSA-wrrj-h57r-vx9p\nCVE-2023-40030\n","epss":0.0,"dataProcessed":"Nov 15, 2026, 2:33:56 AM","vulnerabilityProduct":[],"vulnerabilityVendor":[]}},{"id":"8a0fe194-aeeb-353f-94f9-3b8a8e0b6315","vulnerability":{"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 \u003d [\"\u003cimg src\u003d\u0027\u0027 onerror\u003dalert(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.","datePublished":"Aug 24, 2023, 10:56:41 PM","dateUpdated":"Sep 30, 2024, 7:09:34 PM","status":"PUBLISHED","baseScore":6.1,"baseScoreVersion":"3.1","baseScoreVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","references":"https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p\nhttps://github.com/rust-lang/cargo/pull/12291\nhttps://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33\nhttps://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365\n","enisa_id":"EUVD-2023-2375\n","assigner":"GitHub_M","epss":0.9,"dataProcessed":"Nov 18, 2026, 7:20:08 AM","vulnerabilityProduct":[{"id":"80257a19-adfd-3153-846d-780f65b05468","product":{"name":"cargo","vendor":{"name":"rust-lang"}},"product_version":"1.60.0, \u003c 1.72"}],"vulnerabilityVendor":[{"id":"2b472e3d-2206-3986-afdf-837486c9bd9c","vendor":{"name":"rust-lang"}}]}}],"enisaIdAdvisory":[{"id":"2dababc6-de60-397e-bbbb-c32e6bb1bfc6","advisory":{"id":"openSUSE-SU-2024:13262-1","description":"cargo1.72-1.72.1-1.1 on GA media","summary":"cargo1.72-1.72.1-1.1 on GA media","datePublished":"Jun 15, 2024, 12:00:00 AM","dateUpdated":"Sep 20, 2026, 8:57:09 PM","baseScore":0.0,"references":"https://ftp.suse.com/pub/projects/security/csaf/opensuse-su-2024_13262-1.json\nhttps://www.suse.com/security/cve/CVE-2023-40030/\n","aliases":"CVE-2023-40030\n","source":{"id":21,"name":"csaf_opensuse"},"advisoryProduct":[{"id":"129dfa5c-87ad-3c49-8e7c-2ef68a3d4c60","product":{"name":"cargo1.72-0:1.72.1-1.1.x86_64","vendor":{"name":"SUSE"}}},{"id":"1c7793ad-161a-3e02-843e-722b22bd8d75","product":{"name":"cargo1.72-0:1.72.1-1.1.ppc64le","vendor":{"name":"SUSE"}}},{"id":"1ddcc9eb-8b75-3b55-a727-7f4c06482c76","product":{"name":"rust1.72-1.72.1-1.1.ppc64le","vendor":{"name":"SUSE"}}},{"id":"1ea7370e-e2b8-3e03-879c-22a4ef17deb1","product":{"name":"rust1.72-0:1.72.1-1.1.x86_64","vendor":{"name":"SUSE"}}},{"id":"20363727-7e83-306a-95f5-7832ff0b90db","product":{"name":"cargo1.72-1.72.1-1.1.x86_64","vendor":{"name":"SUSE"}}},{"id":"52060046-367f-3a8d-b826-632d65c42e3e","product":{"name":"cargo1.72-0:1.72.1-1.1.aarch64","vendor":{"name":"SUSE"}}},{"id":"66455f16-78bf-3622-85b9-e064ab0b1da1","product":{"name":"rust1.72-0:1.72.1-1.1.aarch64","vendor":{"name":"SUSE"}}},{"id":"6e546101-461b-3a68-a214-7d85b2c737a2","product":{"name":"rust1.72-1.72.1-1.1.x86_64","vendor":{"name":"SUSE"}}},{"id":"86be3869-67b9-3956-a23f-a9999084bb55","product":{"name":"cargo1.72-1.72.1-1.1.aarch64","vendor":{"name":"SUSE"}}},{"id":"a0456c5a-d5d3-3906-94b5-e624fdb85696","product":{"name":"cargo1.72-1.72.1-1.1.ppc64le","vendor":{"name":"SUSE"}}},{"id":"a2c46f42-f862-3d59-b68e-25969c761b49","product":{"name":"rust1.72-1.72.1-1.1.aarch64","vendor":{"name":"SUSE"}}},{"id":"a8537d5d-34d0-3a29-9116-308a9c140040","product":{"name":"rust1.72-0:1.72.1-1.1.ppc64le","vendor":{"name":"SUSE"}}},{"id":"aec7f384-c5af-387a-9b22-41cff78d5e0f","product":{"name":"rust1.72-1.72.1-1.1.s390x","vendor":{"name":"SUSE"}}},{"id":"baa80183-be33-352a-9349-7ad9001c14ba","product":{"name":"cargo1.72-1.72.1-1.1.s390x","vendor":{"name":"SUSE"}}},{"id":"cfae926e-d584-35a9-8c20-6cf926701b44","product":{"name":"openSUSE Tumbleweed","vendor":{"name":"SUSE"}}},{"id":"e395fff3-9586-3f13-9af0-47f875416dfc","product":{"name":"rust1.72-0:1.72.1-1.1.s390x","vendor":{"name":"SUSE"}}},{"id":"f69c8949-b710-34ad-8c09-42c06ac5ba22","product":{"name":"cargo1.72-0:1.72.1-1.1.s390x","vendor":{"name":"SUSE"}}}]}},{"id":"3d8b2f79-50b3-3952-a894-3ce63844aa3c","advisory":{"id":"SUSE-SU-2023:3722-1","description":"Security update for rust, rust1.72","summary":"Security update for rust, rust1.72","datePublished":"Sep 21, 2023, 8:53:26 AM","dateUpdated":"Sep 21, 2023, 8:53:26 AM","baseScore":0.0,"references":"https://ftp.suse.com/pub/projects/security/csaf/suse-su-2023_3722-1.json\nhttps://www.suse.com/support/update/announcement/2023/suse-su-20233722-1/\nhttps://lists.suse.com/pipermail/sle-updates/2023-September/031626.html\nhttps://bugzilla.suse.com/1214689\nhttps://www.suse.com/security/cve/CVE-2023-40030/\n","aliases":"CVE-2023-40030\n","source":{"id":22,"name":"csaf_suse"},"advisoryProduct":[{"id":"0402e5b9-98dc-348a-a5b0-68ab2a59b186","product":{"name":"openSUSE Leap 15.5 ","vendor":{"name":"SUSE"}}},{"id":"0d504712-ddd7-3e4f-90f0-ef31ed8c1443","product":{"name":"rust1.72-1.72.0-150400.9.3.1.ppc64le","vendor":{"name":"SUSE"}}},{"id":"10d519bf-491d-3884-9794-f422b2e10198","product":{"name":"rust1.72-1.72.0-150400.9.3.1.s390x","vendor":{"name":"SUSE"}}},{"id":"12b32750-2e77-3196-934a-6adc72607f9f","product":{"name":"rust1.72-1.72.0-150400.9.3.1.x86_64","vendor":{"name":"SUSE"}}},{"id":"20075979-0fa7-3119-9358-50cf498160a6","product":{"name":"rust-1.72.0-150400.24.24.1.i586","vendor":{"name":"SUSE"}}},{"id":"219452dd-e6db-3092-ab3b-55ffb8473542","product":{"name":"SUSE Linux Enterprise Module for Development Tools 15 SP5","vendor":{"name":"SUSE"}}},{"id":"24f45cff-b133-3277-9bf3-d9fb6f922584","product":{"name":"cargo1.72-1.72.0-150400.9.3.1.x86_64","vendor":{"name":"SUSE"}}},{"id":"48efd965-87db-3a01-b6b3-0f19c4df04a7","product":{"name":"cargo-1.72.0-150400.24.24.1.ppc64le","vendor":{"name":"SUSE"}}},{"id":"54060cb3-e91e-30ce-948a-9d2f7c23271a","product":{"name":"cargo-1.72.0-150400.24.24.1.i586","vendor":{"name":"SUSE"}}},{"id":"66465b5f-32ca-39a2-a390-b24578bf489a","product":{"name":"SUSE Linux Enterprise Module for Development Tools 15 SP4","vendor":{"name":"SUSE"}}},{"id":"6b24aaa6-0a50-3aa1-91c9-50d2fb70df6b","product":{"name":"rust1.72-1.72.0-150400.9.3.1.i586","vendor":{"name":"SUSE"}}},{"id":"6b4d87a5-7a2b-3702-b5a3-9ce3a17eeab4","product":{"name":"rust1.72-1.72.0-150400.9.3.1.aarch64","vendor":{"name":"SUSE"}}},{"id":"6ecec09f-373b-3055-b774-9355d13f3f44","product":{"name":"rust-1.72.0-150400.24.24.1.ppc64le","vendor":{"name":"SUSE"}}},{"id":"767e9292-2df4-31a8-afaf-b70311d96c46","product":{"name":"rust-1.72.0-150400.24.24.1.x86_64","vendor":{"name":"SUSE"}}},{"id":"7dafee74-1d9b-370c-8142-6f5df91f6492","product":{"name":"rust-1.72.0-150400.24.24.1.s390x","vendor":{"name":"SUSE"}}},{"id":"82272cb7-1b9c-3715-b001-2f92c21b5774","product":{"name":"cargo-1.72.0-150400.24.24.1.aarch64","vendor":{"name":"SUSE"}}},{"id":"a293a309-b30d-312c-a15c-05e70d92a695","product":{"name":"cargo-1.72.0-150400.24.24.1.x86_64","vendor":{"name":"SUSE"}}},{"id":"ab0f973d-02ed-32ed-9129-06bd138e272c","product":{"name":"openSUSE Leap 15.4","vendor":{"name":"opensuse"}}},{"id":"b36c008a-2bf6-30d0-9d73-1c1de046d561","product":{"name":"cargo1.72-1.72.0-150400.9.3.1.aarch64","vendor":{"name":"SUSE"}}},{"id":"b68dc551-ff04-3cab-a359-4ed1a5d7ebf3","product":{"name":"rust-1.72.0-150400.24.24.1.aarch64","vendor":{"name":"SUSE"}}},{"id":"bf62091c-6add-379f-aaef-d85030bd2046","product":{"name":"cargo1.72-1.72.0-150400.9.3.1.ppc64le","vendor":{"name":"SUSE"}}},{"id":"c4325dc8-c79c-32cf-9508-3ab0be31c82d","product":{"name":"cargo1.72-1.72.0-150400.9.3.1.s390x","vendor":{"name":"SUSE"}}},{"id":"ed49f88f-7b6d-317b-9b71-3c4dde77f343","product":{"name":"cargo-1.72.0-150400.24.24.1.s390x","vendor":{"name":"SUSE"}}},{"id":"f54d1aa8-0392-3cc6-befb-6abd98653aea","product":{"name":"cargo1.72-1.72.0-150400.9.3.1.i586","vendor":{"name":"SUSE"}}}]}},{"id":"ad899781-b545-3661-86a8-59f5a5539a41","advisory":{"id":"msrc_CVE-2023-40030","description":"Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports","datePublished":"Sep 1, 2023, 12:00:00 AM","dateUpdated":"Feb 21, 2026, 4:02:10 AM","baseScore":0.0,"references":"https://msrc.microsoft.com/csaf/vex/2023/msrc_cve-2023-40030.json\n","aliases":"CVE-2023-40030\n","source":{"id":20,"name":"csaf_microsoft"},"advisoryProduct":[{"id":"073207ea-caa4-3a86-8ff3-7769902bf42a","product":{"name":"cbl2 rust 1.72.0-2","vendor":{"name":"Microsoft"}}},{"id":"23a470bd-16d7-351d-ae02-4aed70ba5f7e","product":{"name":"azl3 rust 0:1.75.0-14.azl3","vendor":{"name":"Microsoft"}}},{"id":"34ab8894-bd83-3f7c-ab0e-5d2b0f1b14d0","product":{"name":"azl3 rust 1.86.0-1","vendor":{"name":"Microsoft"}}},{"id":"363f3c9b-d7db-3e69-aa05-60312e5a43e5","product":{"name":"3.0","vendor":{"name":"Wind River"}}},{"id":"423669a0-5463-3368-bd66-6d72f18cc5c4","product":{"name":"rust","vendor":{"name":"rust-lang"}}},{"id":"6712b46d-bd56-3e94-be68-fcb18c3bcc7d","product":{"name":"cbl2 rust 0:1.72.0-2.cbl2","vendor":{"name":"Microsoft"}}},{"id":"685b7503-b63e-33c4-b416-0fa0167f518d","product":{"name":"2.0","vendor":{"name":"Smiths Medical"}}},{"id":"a5035859-1154-3a93-92b8-bd0941da54ec","product":{"name":"azl3 rust 1.75.0-14","vendor":{"name":"Microsoft"}}},{"id":"a7ec3c1c-c67e-3eb5-960f-378e02817d42","product":{"name":"azl3 rust 0:1.86.0-1.azl3","vendor":{"name":"Microsoft"}}},{"id":"efe17d7d-741d-3280-8bca-e05fee12b9d8","product":{"name":"Azure Linux","vendor":{"name":"Microsoft"}}}]}}]}