RUSTSEC-2022-0004 on 2022-01-01: Stack overflow in rustc_serialize when parsing deeply nested JSON

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.

GHSA-2226-4v3c-cff8

These reviews are from cargo-vet. To add your review, set up cargo-vet and submit your URL to its registry.

0.3.25 (current) unknown

From kornelski/crev-proofs copy of salsa.debian.org.

Only in debcargo (unstable). Changelog:

  • Team upload.
  • Package rustc-serialize 0.3.25 from crates.io using debcargo 2.6.1
    • New upstream fixes build with new rustc (Closes: #1074736, #1074708)
  • Don't fail build due to compiler warnings
  • Disable broken tests.
  • Port tests to rand 0.8.

cargo-vet does not verify reviewers' identity. You have to fully trust the source the audits are from.

unknown

May have been packaged automatically without a review


This review is from Crev, a distributed system for code reviews. To add your review, set up cargo-crev.

The current version of rustc-serialize is 0.3.25.

0.3.24 (older version) Rating: Neutral + Unmaintained Thoroughness: None Understanding: None

by kornelski on 2020-05-12


Lib.rs has been able to verify that all files in the crate's tarball are in the crate's repository. Please note that this check is still in beta, and absence of this confirmation does not mean that the files don't match.

Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories, so there is a possibility that published crates have a misleading repository URL, or contain different code from the code in the repository.

To review the actual code of the crate, it's best to use cargo crev open rustc-serialize. Alternatively, you can download the tarball of rustc-serialize v0.3.25 or view the source online.