GHSA-fp5x-7m4q-449f
JSON

low

Direct Ring Buffer has uninitialized memory exposure in create_ring_buffer

Severity
low CVSS:4.0 by GitHub
Published
Last changed
Also known as
RUSTSEC-2025-0105

Description

The safe function create_ring_buffer allocates a buffer using Vec::with_capacity followed by set_len, creating a Box<[T]> containing uninitialized memory.

This leads to undefined behavior when functions like write_slices create typed slices (e.g., &mut [bool]) over the uninitialized memory, violating Rust's validity invariants. The issue has been confirmed using Miri.

Fixed in version 0.2.2 by using resize_with to properly initialize the buffer with T::default(), adding a T: Default bound to ensure sound initialization.

Affected

Product or packageVersionsReported by
direct_ring_buffer (crates.io)before 0.2.2, from 0.0.0-0 before 0.2.2GitHub Advisory Database, RustSec Advisory Database

Classification

References

Sources

SourceRecordLicence
GitHub Advisory DatabaseGHSA-fp5x-7m4q-449f changed 2025-10-28CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2025-0105 changed 2025-10-28CC0-1.0