Advisory

RUSTSEC-2022-0004

Also known as: GHSA-2226-4v3c-cff8

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

fn main() {
    let _ = rustc_serialize::json::Json::from_str(&"[0,[".repeat(10000));
}

serde is recommended as a replacement to rustc_serialize.

Severity

Not rated by the source.

Dates

Published
2022-01-01 12:00 UTC
Modified
2023-11-08 04:13 UTC

Affected packages and fixes

rustc-serialize

crates.io · All systems

Affected

  • introduced 0.0.0-0 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences