RUSTSEC-2021-0012

Source
https://rustsec.org/advisories/RUSTSEC-2021-0012
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0012.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2021-0012
Aliases
Published
2021-01-02T12:00:00Z
Modified
2023-11-08T04:05:20.783188Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Reading uninitialized memory can cause UB (`Deserializer::read_vec`)
Details

Deserializer::read_vec() created an uninitialized buffer and passes it to a user-provided Read implementation (Deserializer.reader.read_exact()).

Passing an uninitialized buffer to an arbitrary Read implementation is currently defined as undefined behavior in Rust. Official documentation for the Read trait explains the following: "It is your responsibility to make sure that buf is initialized before calling read. Calling read with an uninitialized buf (of the kind one obtains via MaybeUninit<T>) is not safe, and can lead to undefined behavior."

The flaw was corrected in commit ce310f7 by zero-initializing the newly allocated buffer before handing it to Deserializer.reader.read_exact().

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / cdr

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.2.4

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [],
        "arch": []
    }
}

Database specific

{
    "cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
    "informational": null,
    "categories": [
        "memory-exposure"
    ]
}