CVEMETERBack to radar
OFFICIAL RECORD · Rust

CVE-2023-40030

PUBLISHEDOfficial status check: verifiedCVSS 3.1: 6.1 · medium

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_M
CVSS: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 Security
CVSS: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

FieldStatusChecked at (UTC)Source
kevverified2026-11-19T17:28:52.703ZCISA KEV
cvssverified2026-11-19T12:56:57.967ZCVE Program
epssverified2026-11-19T16:04:36.838ZFIRST EPSS
patchesverified2026-11-19T16:51:15.805ZUbuntu Security
affectedverified2026-11-19T12:56:57.967ZCVE Program
lifecycleverified2026-11-19T12:56:57.967ZCVE 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&section=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 JSON
CVE 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 JSON

Correction 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 typeDistribution / releasePackageChannelVersion or source noteSource
distribution-packageUbuntu / noblerustcsecurity1.73.0+dfsg0ubuntu1-0ubuntu1Official record
upstream-releaseupstream / upstreamrustcNot a distribution channel1.72Official record

Vendor notices and operational guidance

No connected vendor notice is available for this record.

Original sources and dates

Official status history