# GHSA-fp5x-7m4q-449f: Direct Ring Buffer has uninitialized memory exposure in create_ring_buffer

- Severity: Low (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2025-10-21T12:00:00.000Z
- Modified: 2025-10-28T06:29:24.396Z
- Also known as: RUSTSEC-2025-0105
- Weaknesses: CWE-908

## 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.

(As written by GitHub Advisory Database.)

## Affected

- direct_ring_buffer (crates.io): before 0.2.2; from 0.0.0-0 before 0.2.2

## References

- <https://github.com/ain1084/direct_ring_buffer/issues/1> (report, web)
- <https://github.com/ain1084/direct_ring_buffer/pull/2> (web)
- <https://github.com/ain1084/direct_ring_buffer> (package)
- <https://rustsec.org/advisories/RUSTSEC-2025-0105.html> (advisory, web)
- <https://crates.io/crates/direct_ring_buffer> (package)

## Sources

- GitHub Advisory Database: [GHSA-fp5x-7m4q-449f](https://github.com/advisories/GHSA-fp5x-7m4q-449f), CC-BY-4.0, modified 2025-10-28
- RustSec Advisory Database: [RUSTSEC-2025-0105](https://rustsec.org/advisories/RUSTSEC-2025-0105.html), CC0-1.0, modified 2025-10-28

---

Page: https://cve.day/GHSA-fp5x-7m4q-449f · Whole record: https://cve.day/GHSA-fp5x-7m4q-449f.json · Rebuilt by cve.day 2026-11-25T22:56:43.275Z
