
CVE catalog
CVE-2023-40030
cargo: CVE-2023-40030
- Severity
- Medium · CVSS 6.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Published
- Source
- [NVD] · [CVE record]
- EPSS
- 0.90% · Oct 27, 2026
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.
Vulnerable and fixed packages
Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | cargo | bookworm | 0.66.0+ds1-1 | vulnerable |
| Debian | rust-cargo | sid | 0.99.0-1 | fixed |
| Debian | rust-cargo | forky | 0.99.0-1 | fixed |
| Debian | rust-cargo | trixie | 0.86.0-2 | fixed |
| Debian | rust-cargo | bookworm | 0.66.0-1 | vulnerable |
| Ubuntu | cargo | pro | 0.52.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.53.0-0ubuntu2 | vulnerable |
| Ubuntu | cargo | pro | 0.54.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.54.0-0ubuntu2 | vulnerable |
| Ubuntu | cargo | pro | 0.57.0+ubuntu-0ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.58.0-0ubuntu1 | vulnerable |
| Ubuntu | cargo | pro | 0.60.0ubuntu1-0ubuntu1~22.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.62.0ubuntu0libgit2-0ubuntu0.22.04.1 | vulnerable |
| Ubuntu | cargo | pro | 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.22.04 | vulnerable |
| Ubuntu | cargo | pro | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2 | vulnerable |
| Ubuntu | cargo | pro | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2+esm1 | vulnerable |
| Ubuntu | rustc | 24.04 | 1.71.1+dfsg0ubuntu2-0ubuntu1 | vulnerable |
| Ubuntu | rustc | 24.04 | 1.73.0+dfsg0ubuntu1-0ubuntu1 | fixed |
| Opensuse | rust1.72 | tumbleweed | 1.72.1-1.1 | fixed |
| Suse | rust | linux enterprise module for development tools 15 sp4 | 1.72.0-150400.24.24.1 | fixed |
| Suse | rust1.72 | linux enterprise module for development tools 15 sp4 | 1.72.0-150400.9.3.1 | fixed |
| Suse | rust | linux enterprise module for development tools 15 sp5 | 1.72.0-150400.24.24.1 | fixed |
| Suse | rust1.72 | linux enterprise module for development tools 15 sp5 | 1.72.0-150400.9.3.1 | fixed |
| Opensuse | rust | leap 15.4 | 1.72.0-150400.24.24.1 | fixed |
| Opensuse | rust1.72 | leap 15.4 | 1.72.0-150400.9.3.1 | fixed |
| Opensuse | rust | leap 15.5 | 1.72.0-150400.24.24.1 | fixed |
| Opensuse | rust1.72 | leap 15.5 | 1.72.0-150400.9.3.1 | fixed |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | cargo | source | bookworm | (unfixed) | not yet assigned | Not reported | [1059305] |
| Debian | rust-cargo | source | sid | 0.76.0-1 | not yet assigned | Not reported | [1059306] |
| Debian | rust-cargo | source | forky | 0.76.0-1 | not yet assigned | Not reported | [1059306] |
| Debian | rust-cargo | source | trixie | 0.76.0-1 | not yet assigned | Not reported | [1059306] |
| Debian | rust-cargo | source | bookworm | (unfixed) | not yet assigned | Not reported | [1059306] |
| Ubuntu | rustc | deb | 24.04 | 1.73.0+dfsg0ubuntu1-0ubuntu1 | Not reported | UBUNTU-CVE-2023-40030 | Not reported |
| Opensuse | rust1.72 | rpm | tumbleweed | 1.72.1-1.1 | Not reported | OPENSUSE-SU-2024:13262-1 | Not reported |
| Suse | rust | rpm | linux enterprise module for development tools 15 sp4 | 1.72.0-150400.24.24.1 | Not reported | SUSE-SU-2023:3722-1 | Not reported |
| Suse | rust1.72 | rpm | linux enterprise module for development tools 15 sp4 | 1.72.0-150400.9.3.1 | Not reported | SUSE-SU-2023:3722-1 | Not reported |
| Suse | rust | rpm | linux enterprise module for development tools 15 sp5 | 1.72.0-150400.24.24.1 | Not reported | SUSE-SU-2023:3722-1 | Not reported |
| Suse | rust1.72 | rpm | linux enterprise module for development tools 15 sp5 | 1.72.0-150400.9.3.1 | Not reported | SUSE-SU-2023:3722-1 | Not reported |
| Opensuse | rust | rpm | leap 15.4 | 1.72.0-150400.24.24.1 | Not reported | SUSE-SU-2023:3722-1 | Not reported |
| Opensuse | rust1.72 | rpm | leap 15.4 | 1.72.0-150400.9.3.1 | Not reported | SUSE-SU-2023:3722-1 | Not reported |
| Opensuse | rust | rpm | leap 15.5 | 1.72.0-150400.24.24.1 | Not reported | SUSE-SU-2023:3722-1 | Not reported |
| Opensuse | rust1.72 | rpm | leap 15.5 | 1.72.0-150400.9.3.1 | Not reported | SUSE-SU-2023:3722-1 | Not reported |
[Debian bug #1059305][Debian bug #1059306]
Notes
[bookworm] cargo: Minor issue [bookworm] rust-cargo: Minor issue
OpenFactory catalog packages
[Debian 12 (Bookworm)]
- [cargo]Affected
Details (2)
0.66.0+ds1-1· amd64 · bookwormAffected
dsa · cargo · debian · bookworm; dsa · cargo · debian · 12
0.66.0+ds1-1· arm64 · bookwormAffected
dsa · cargo · debian · bookworm; dsa · cargo · debian · 12
- [cargo-doc]Affected
Source package: [cargo]
Details (2)
0.66.0+ds1-1· all · bookwormAffected
dsa · cargo · debian · bookworm; dsa · cargo · debian · 12
0.66.0+ds1-1· all · bookwormAffected
dsa · cargo · debian · bookworm; dsa · cargo · debian · 12
- [librust-cargo-dev]Affected
Source package: [rust-cargo]
Details (2)
0.66.0-1· amd64 · bookwormAffected
dsa · rust-cargo · debian · bookworm; dsa · rust-cargo · debian · 12
0.66.0-1· arm64 · bookwormAffected
dsa · rust-cargo · debian · bookworm; dsa · rust-cargo · debian · 12
[Debian 13 (Trixie)]
- [librust-cargo-dev]Fixed
Source package: [rust-cargo]
Details (2)
0.86.0-2· amd64 · trixieFixed · Fixed:
0.76.0-1dsa · rust-cargo · debian · 13
0.86.0-2· arm64 · trixieFixed · Fixed:
0.76.0-1dsa · rust-cargo · debian · 13
Observed:
References
- [https://ftp.suse.com/pub/projects/security/csaf/suse-su-2023_3722-1.json]
- [https://osv.dev/vulnerability/DEBIAN-CVE-2023-40030]
- [https://osv.dev/vulnerability/SUSE-SU-2023:3722-1]
- [https://osv.dev/vulnerability/UBUNTU-CVE-2023-40030]
- [https://osv.dev/vulnerability/openSUSE-SU-2024:13262-1]
- [https://security-tracker.debian.org/tracker/CVE-2023-40030]
- [https://security.access.redhat.com/data/csaf/v2/vex/2023/cve-2023-40030.json]
[Debian Security Tracker] · [FIRST EPSS] · [OSV Package Vulnerability Database] · [Red Hat security advisories and VEX] · [SUSE security advisories and VEX]