p PatchFirst

CVE-2023-40030

CVE-2023-40030 · Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports

Diese Seite enthält Fakten aus öffentlichen Sicherheitsquellen. Lesen Sie vor dem Aktualisieren die Originalmeldung.

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.

CVSS 6.1 · Mittel · EPSS 0,9% · Korrektur verfügbar

Veröffentlicht
Aktualisiert

Technologie-Stack: system

Betroffene Produkte und Versionen

  • cargo

    Softwareversionen
    • >= 1.60.0, < 1.72: Betroffen

    Keine Korrektur veröffentlicht

  • cargo Debian:12

    Softwareversionen
    • 0.66.0+ds1-1
    • 0.66.0+ds2-1
    • 0.66.0+ds2-2
    • 0.70.1+ds1-1
    • 0.70.1+ds1-1~exp1
    • 0.70.1+ds1-2
    • 0.70.1+ds1-3
    • 0.70.1-1~exp1
    Betroffene Versionsbereiche
    • ECOSYSTEM: (−∞, +∞)

    Keine Korrektur veröffentlicht

  • rust-cargo Debian:12

    Softwareversionen
    • 0.66.0-1
    • 0.66.0-2
    • 0.66.0-3
    • 0.66.0-4
    • 0.66.0-5
    • 0.66.0-6
    • 0.70.1-1
    • 0.70.1-2
    • 0.70.1-3
    • 0.76.0-1
    • 0.76.0-2
    • 0.76.0-3
    • 0.76.0-4
    • 0.81.0-1
    • 0.81.0-2
    • 0.81.0-3
    • 0.82.0-1
    • 0.83.0-1
    • 0.83.0-2
    • 0.84.0-1
    • 0.85.0-1
    • 0.86.0-1
    • 0.86.0-2
    • 0.86.0-3
    • 0.86.0-4
    • 0.91.0-1
    • 0.91.0-2
    • 0.91.0-3
    • 0.91.0-4
    • 0.91.0-5
    • 0.96.0-1
    • 0.96.0-2
    • 0.99.0-1
    Betroffene Versionsbereiche
    • ECOSYSTEM: (−∞, +∞)

    Keine Korrektur veröffentlicht

  • rust-cargo Debian:13

    Betroffene Versionsbereiche
    • ECOSYSTEM: < 0.76.0-1

    Auf 0.76.0-1 aktualisieren

  • rust-cargo Debian:14

    Betroffene Versionsbereiche
    • ECOSYSTEM: < 0.76.0-1

    Auf 0.76.0-1 aktualisieren

  • cargo Ubuntu:Pro:16.04:LTS

    Softwareversionen
    • 0.8.0-1
    • 0.16.0-0ubuntu1~16.04.1
    • 0.18.0-0ubuntu0.16.04.1
    • 0.22.0-0ubuntu0.16.04.1
    • 0.23.0-0ubuntu0.16.04.1
    • 0.25.0-1ubuntu1~16.04.1
    • 0.26.0-0ubuntu2~16.04.1
    • 0.29.0-1ubuntu1~16.04.1
    • 0.31.0-3ubuntu1~16.04.1
    • 0.32.0-1~exp1ubuntu1~16.04.1
    • 0.33.0-1ubuntu1~16.04.1
    • 0.35.0-0ubuntu1~16.04.1
    • 0.36.0-0ubuntu1~16.04.1
    • 0.37.0-3ubuntu1~16.04.1
    • 0.38.0-0ubuntu1~16.04.1
    • 0.40.0-3ubuntu1~16.04.1
    • 0.42.0-0ubuntu1~16.04.1
    • 0.44.1-0ubuntu1~16.04.1
    • 0.47.0-1~exp1ubuntu1~16.04.1
    • 0.47.0-1~exp1ubuntu1~16.04.1+esm1
    Betroffene Versionsbereiche
    • ECOSYSTEM: (−∞, +∞)

    Keine Korrektur veröffentlicht

  • cargo Ubuntu:Pro:18.04:LTS

    Softwareversionen
    • 0.19.0-0ubuntu1
    • 0.22.0-0ubuntu1
    • 0.22.0-0ubuntu2
    • 0.23.0-0ubuntu1
    • 0.24.0-1ubuntu1
    • 0.25.0-1ubuntu1
    • 0.26.0-0ubuntu1
    • 0.26.0-0ubuntu2
    • 0.29.0-1ubuntu1~18.04.1
    • 0.31.0-3ubuntu1~18.04.4
    • 0.32.0-1~exp1ubuntu1~18.04.1
    • 0.33.0-1ubuntu1~18.04.1
    • 0.35.0-0ubuntu1~18.04.1
    • 0.36.0-0ubuntu1~18.04.1
    • 0.37.0-3ubuntu1~18.04.1
    • 0.38.0-0ubuntu1~18.04.1
    • 0.40.0-3ubuntu1~18.04.1
    • 0.42.0-0ubuntu1~18.04.1
    • 0.44.1-0ubuntu1~18.04.1
    • 0.47.0-1~exp1ubuntu1~18.04.1
    • 0.52.0-0ubuntu1~18.04.1
    • 0.54.0-0ubuntu1~18.04.1
    • 0.58.0-0ubuntu1~18.04.1
    • 0.60.0ubuntu1-0ubuntu1~18.04.1
    • 0.62.0ubuntu0libgit2-0ubuntu0.18.04.1
    • 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04
    • 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04.1~esm1
    Betroffene Versionsbereiche
    • ECOSYSTEM: (−∞, +∞)

    Keine Korrektur veröffentlicht

  • cargo Ubuntu:Pro:20.04:LTS

    Softwareversionen
    • 0.37.0-3ubuntu2
    • 0.38.0-0ubuntu1
    • 0.39.0-0ubuntu1
    • 0.39.0+really0.38.0-0ubuntu1
    • 0.39.0+really0.39.0-0ubuntu1
    • 0.40.0-3ubuntu1
    • 0.40.0-3ubuntu2
    • 0.41.0-0ubuntu1
    • 0.42.0-0ubuntu1
    • 0.44.1-0ubuntu1~20.04.1
    • 0.47.0-1~exp1ubuntu1~20.04.1
    • 0.52.0-0ubuntu1~20.04.1
    • 0.54.0-0ubuntu1~20.04.1
    • 0.58.0-0ubuntu1~20.04.1
    • 0.60.0ubuntu1-0ubuntu1~20.04.1
    • 0.62.0ubuntu0libgit2-0ubuntu0.20.04.1
    • 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.20.04
    • 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2
    • 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2+esm1
    Betroffene Versionsbereiche
    • ECOSYSTEM: (−∞, +∞)

    Keine Korrektur veröffentlicht

  • cargo Ubuntu:Pro:22.04:LTS

    Softwareversionen
    • 0.52.0-0ubuntu1
    • 0.53.0-0ubuntu2
    • 0.54.0-0ubuntu1
    • 0.54.0-0ubuntu2
    • 0.57.0+ubuntu-0ubuntu1
    • 0.58.0-0ubuntu1
    • 0.60.0ubuntu1-0ubuntu1~22.04.1
    • 0.62.0ubuntu0libgit2-0ubuntu0.22.04.1
    • 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.22.04
    • 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2
    • 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2+esm1
    Betroffene Versionsbereiche
    • ECOSYSTEM: (−∞, +∞)

    Keine Korrektur veröffentlicht

  • rustc Ubuntu:24.04:LTS

    Softwareversionen
    • 1.71.1+dfsg0ubuntu2-0ubuntu1
    Betroffene Versionsbereiche
    • ECOSYSTEM: < 1.73.0+dfsg0ubuntu1-0ubuntu1

    Auf 1.73.0+dfsg0ubuntu1-0ubuntu1 aktualisieren

Originalquellen

Prüfen Sie Ihren Server →