Informazioni sul CVE-2023-40030
Malicious dependencies can inject arbitrary JavaScript into cargo-generated timing reports
CWE ID: CWE-79
Base Score (CVSS): N/A
CVE: CVE-2023-40030
Descrizione: 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 = [“
Vettore di attacco CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Punteggio CVSS
Il CVSS è un sistema di valutazione che misura la gravità di una vulnerabilità informatica considerando fattori come l’impatto potenziale, la probabilità di attacco e la facilità di esecuzione.
Riassunto: Accesso: Network, Privilegi: None, Interazione utente: Required, Confidenzialità: Low, Integrità: Low, Disponibilità: None.
Dettaglio del Vettore
Metrica | Valore | Significato | Descrizione |
---|---|---|---|
Attack Vector (AV) | N | Network | L’attacco può essere eseguito da remoto attraverso la rete. |
Attack Complexity (AC) | L | Low | L’attacco non richiede condizioni particolari. |
Privileges Required (PR) | N | None | Non sono richiesti privilegi. |
User Interaction (UI) | R | Required | È richiesta l’interazione di un utente. |
Scope (S) | C | Changed | La vulnerabilità impatta su componenti esterni. |
Confidentiality Impact (C) | L | Low | Impatto limitato. |
Integrity Impact (I) | L | Low | Impatto limitato. |
Availability Impact (A) | N | None | Nessun impatto sulla disponibilità. |
Riferimenti esterni
- https://github.com/rust-lang/cargo/security/advisories/GHSA-wrrj-h57r-vx9p
- https://github.com/rust-lang/cargo/pull/12291
- https://github.com/rust-lang/cargo/commit/9835622853f08be9a4b58ebe29dcec8f43b64b33
- https://github.com/rust-lang/cargo/commit/f975722a0eac934c0722f111f107c4ea2f5c4365
Prodotti interessati
- rust-lang – cargo
Relazioni con altri prodotti
Produttore:rust-lang
Prodotto: cargo
Anno: 2023
CWE: CWE-79
CVSS: 0.0