CVE-2023-40030
Rust vulnerability analysis and mitigation

Overview

Cargo, starting in Rust 1.60.0 and prior to 1.72, contained a vulnerability where feature names in the report generated by cargo build --timings were not properly escaped. This vulnerability (CVE-2023-40030) was discovered and disclosed in August 2023. The issue affects users who rely on dependencies from git, local paths, or alternative registries, while users who solely depend on crates.io are unaffected (Rust Advisory).

Technical details

The vulnerability stems from Cargo's handling of feature names in timing reports. Prior to Rust 1.72, Cargo feature names could contain almost any characters, with some syntax-related exceptions. While Rust 1.49 introduced warnings about certain characters in feature names, these names were included unescaped in the timings report. This could allow malicious packages to inject arbitrary HTML and potentially JavaScript into the report (Rust Advisory). The vulnerability has a CVSS score of 6.1, indicating medium severity (Oracle Bulletin).

Impact

If exploited, this vulnerability could lead to cross-site scripting (XSS) attacks if the timing report is uploaded to a web location. However, it's important to note that Cargo already allows code execution at build time through build scripts and procedural macros, so this vulnerability represents a subset of possible attacks that could be performed in a way that's harder to track (Rust Advisory).

Mitigation and workarounds

The vulnerability was fixed in Rust 1.72 by converting the feature name validation check from a warning to a hard error. This change prevents the use of potentially dangerous characters in feature names. Users should upgrade to Rust 1.72 or later to mitigate this vulnerability (Rust Advisory).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22257HIGH8.8
  • RustRust
  • salvo
NoYesJan 08, 2026
CVE-2026-22698HIGH8.7
  • RustRust
  • sm2
NoNoJan 10, 2026
CVE-2026-22699HIGH7.5
  • RustRust
  • sm2
NoNoJan 10, 2026
GHSA-g59m-gf8j-gjf5LOW3.7
  • RustRust
  • aws-sdk-neptunedata
NoYesJan 08, 2026
GHSA-585q-cm62-757jLOW2
  • RustRust
  • mnl
NoNoJan 09, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management