RUSTSEC-2022-0004

    Dashboard / Vulnerabilities / RUSTSEC-2022-0004

    RUSTSEC-2022-0004

    Published: 1 Jan 2022Last Modified: 8 Nov 2023

    Summary: Stack overflow in rustc_serialize when parsing deeply nested JSON

    Details: When parsing JSON using `json::Json::from_str`, there is no limit to the depth of the stack, therefore deeply nested objects can cause a stack overflow, which aborts the process. Example code that triggers the vulnerability is ```rust fn main() { let _ = rustc_serialize::json::Json::from_str(&"[0,[".repeat(10000)); } ``` [serde](https://crates.io/crates/serde) is recommended as a replacement to rustc_serialize.

    Affected packages

    Package

    Name: rustc-serialize

    Purl: pkg:cargo/rustc-serialize

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0.0.0-0
    Fixed -None

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    RUSTSEC-2022-0004 | CVE-DB