Skip to content
Fencer Intel
medium —

GHSA-2226-4v3c-cff8 json

Stack overflow in rustc_serialize when parsing deeply nested JSON

published 4y ago modified 3y ago also RUSTSEC-2022-0004

cvss
—
not scored
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

Summary

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.

Is GHSA-2226-4v3c-cff8 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Affected packages

ecosystem package affected fixed in
crates.io rustc-serialize
<=0.3.24
>=0.0.0-0
no fix listed

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.