Advisory

RUSTSEC-2019-0002

Also known as: CVE-2019-15543, GHSA-c3m3-c39q-pv23

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.

Severity

Critical Basis: CVSS v3 score 9.8, vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Dates

Published
2019-05-07 12:00 UTC
Modified
2026-02-04 04:35 UTC

Affected packages and fixes

slice-deque

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.2.0 (semver)

Fixed versions

0.2.0

Fix

  • Fixed version 0.2.0
    cargo update -p slice-deque --precise 0.2.0

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