Advisory

RUSTSEC-2025-0105

Also known as: GHSA-fp5x-7m4q-449f

Summary

Uninitialized memory exposure in create_ring_buffer

Details

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.

Severity

Not rated by the source.

Dates

Published
2025-10-21 12:00 UTC
Modified
2025-10-28 06:29 UTC

Affected packages and fixes

direct_ring_buffer

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.2.2 (semver)

Fixed versions

0.2.2

Fix

  • Fixed version 0.2.2
    cargo update -p direct_ring_buffer --precise 0.2.2

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