{"answers":{"affected":"2 open source packages ship an affected version, including cargo. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-40030 in the wild and no public exploit code.","fix":"Upgrade cargo to 1.72 or later.","what":"CVE-2023-40030 is a medium-severity cross-site scripting vulnerability in rust-lang cargo, published on 24 Aug 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2023-40030 and fix it if it is affected.\n\nWhat it is: CVE-2023-40030 is a medium-severity cross-site scripting vulnerability in rust-lang cargo, published on 24 Aug 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2023-40030 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- cargo (crates.io): affected from 1.60.0; fixed in 1.72\n- cargo (crates.io): affected from 1.60.0; fixed in 1.72\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-40030/ (Markdown: https://insights.sbomify.com/CVE-2023-40030/index.md)","id":"CVE-2023-40030","markdown":"https://insights.sbomify.com/CVE-2023-40030/index.md","name":"CVE-2023-40030","record":{"aliases":["AZL-28511","BELL-CVE-2023-40030","DEBIAN-CVE-2023-40030","GHSA-wrrj-h57r-vx9p","SUSE-SU-2023:3722-1","UBUNTU-CVE-2023-40030","openSUSE-SU-2024:13262-1"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution","data_read"],"network_reachable":"yes","non_default_config":true,"product_category":"Rust Cargo build tool","requires_auth":"none","summary":"Malicious dependencies can inject JavaScript into Cargo timing reports, potentially leading to XSS if the report is uploaded to a web server.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"rust","vendor":"rust-lang"}],"cvss":{"score":6.1,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"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.","ecosystems":["SUSE:Linux Enterprise Module for Development Tools 15 SP4","SUSE:Linux Enterprise Module for Development Tools 15 SP5","crates.io","openSUSE:Leap 15.4","openSUSE:Leap 15.5","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports","id":"CVE-2023-40030","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"xss","year":"2023"},"n_packages":11,"n_references":4,"next":{"headline":"Notepad++ vulnerable to heap buffer write overflow in Utf8_16_Read::convert","id":"CVE-2023-40031"},"packages":[{"ecosystem":"crates.io","fixed":["1.72"],"introduced":["1.60.0"],"last_affected":[],"package":"cargo","purl":null,"source":"GHSA-wrrj-h57r-vx9p"},{"ecosystem":"crates.io","fixed":["1.72"],"introduced":["1.60.0"],"last_affected":[],"package":"cargo","purl":"pkg:cargo/cargo","source":"GHSA-wrrj-h57r-vx9p"},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","fixed":["1.72.0-150400.24.24.1"],"introduced":["0"],"last_affected":[],"package":"rust","purl":"pkg:rpm/suse/rust\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP4","source":"SUSE-SU-2023:3722-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","fixed":["1.72.0-150400.9.3.1"],"introduced":["0"],"last_affected":[],"package":"rust1.72","purl":"pkg:rpm/suse/rust1.72\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP4","source":"SUSE-SU-2023:3722-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP5","fixed":["1.72.0-150400.24.24.1"],"introduced":["0"],"last_affected":[],"package":"rust","purl":"pkg:rpm/suse/rust\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP5","source":"SUSE-SU-2023:3722-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP5","fixed":["1.72.0-150400.9.3.1"],"introduced":["0"],"last_affected":[],"package":"rust1.72","purl":"pkg:rpm/suse/rust1.72\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP5","source":"SUSE-SU-2023:3722-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["1.72.0-150400.24.24.1"],"introduced":["0"],"last_affected":[],"package":"rust","purl":"pkg:rpm/opensuse/rust\u0026distro=openSUSE%20Leap%2015.4","source":"SUSE-SU-2023:3722-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["1.72.0-150400.9.3.1"],"introduced":["0"],"last_affected":[],"package":"rust1.72","purl":"pkg:rpm/opensuse/rust1.72\u0026distro=openSUSE%20Leap%2015.4","source":"SUSE-SU-2023:3722-1"},{"ecosystem":"openSUSE:Leap 15.5","fixed":["1.72.0-150400.24.24.1"],"introduced":["0"],"last_affected":[],"package":"rust","purl":"pkg:rpm/opensuse/rust\u0026distro=openSUSE%20Leap%2015.5","source":"SUSE-SU-2023:3722-1"},{"ecosystem":"openSUSE:Leap 15.5","fixed":["1.72.0-150400.9.3.1"],"introduced":["0"],"last_affected":[],"package":"rust1.72","purl":"pkg:rpm/opensuse/rust1.72\u0026distro=openSUSE%20Leap%2015.5","source":"SUSE-SU-2023:3722-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["1.72.1-1.1"],"introduced":["0"],"last_affected":[],"package":"rust1.72","purl":"pkg:rpm/opensuse/rust1.72\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:13262-1"}],"prev":{"headline":"Cluster secret might leak in cluster details page in Argo CD","id":"CVE-2023-40029"},"products":["cargo"],"published":"2023-08-24","related":[{"cvss_score":9.8,"headline":"Use after free in n/a","id":"CVE-2020-36318","kev_date_added":null,"published":"2021-04-11"},{"cvss_score":9.8,"headline":"Integer overflow in n/a","id":"CVE-2018-1000810","kev_date_added":null,"published":"2018-10-08"},{"cvss_score":9.1,"headline":"Security feature bypass in n/a","id":"CVE-2021-29922","kev_date_added":null,"published":"2021-08-07"},{"cvss_score":8.2,"headline":"Rust OS Command Injection/Argument Injection vulnerability","id":"CVE-2024-43402","kev_date_added":null,"published":"2024-09-04"},{"cvss_score":7.8,"headline":"Memory corruption in n/a","id":"CVE-2018-1000657","kev_date_added":null,"published":"2018-08-20"},{"cvss_score":7.8,"headline":"Other in n/a","id":"CVE-2018-1000622","kev_date_added":null,"published":"2018-07-09"},{"cvss_score":7.5,"headline":"Memory corruption in n/a","id":"CVE-2015-20001","kev_date_added":null,"published":"2021-04-11"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-09-30","vendors":["rust-lang"]},"summary":"Malicious dependencies can inject JavaScript into Cargo timing reports, potentially leading to XSS if the report is uploaded to a web server.","url":"https://insights.sbomify.com/CVE-2023-40030/"}