RUSTSEC-2019-0002

Source
https://rustsec.org/advisories/RUSTSEC-2019-0002
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2019-0002.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2019-0002
Aliases
Related
Published
2019-05-07T12:00:00Z
Modified
2023-11-08T04:01:13.735681Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Bug in SliceDeque::move_head_unchecked corrupts its memory
Details

Affected versions of this crate entered a corrupted state if mem::size_of::<T>() % allocation_granularity() != 0 and a specific allocation pattern was used: sufficiently shifting the deque elements over the mirrored page boundary.

This allows an attacker that controls controls both element insertion and removal to corrupt the deque, such that reading elements from it would read bytes corresponding to other elements in the deque. (e.g. a read of T could read some bytes from one value and some bytes from an adjacent one, resulting in a T whose value representation is not meaningful). This is undefined behavior.

The flaw was corrected by using a pair of pointers to track the head and tail of the deque instead of a pair of indices. This pair of pointers are represented using a Rust slice.

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

Affected packages

crates.io / slice-deque

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.2.0

Ecosystem specific

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

Database specific

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