{"id":"GHSA-fp5x-7m4q-449f","aliases":["GHSA-fp5x-7m4q-449f","RUSTSEC-2025-0105"],"related":[],"kind":"vulnerability","state":"published","title":"Direct Ring Buffer has uninitialized memory exposure in create_ring_buffer","summary":"The safe function `create_ring_buffer` allocates a buffer using `Vec::with_capacity` followed by `set_len`, creating a `Box<[T]>` containing uninitialized memory.\n\nThis 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.\n\nFixed 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.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"The safe function `create_ring_buffer` allocates a buffer using `Vec::with_capacity` followed by `set_len`, creating a `Box<[T]>` containing uninitialized memory.\n\nThis 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.\n\nFixed 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.","format":"markdown","source":"ghsa"}],"published":"2025-10-21T12:00:00.000Z","modified":"2025-10-28T06:29:24.396Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"LOW"},"severities":[{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"LOW"}],"cwes":["CWE-908"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.2.2"}],"ecosystem":"crates.io","package":"direct_ring_buffer","purl":"pkg:cargo/direct_ring_buffer","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.2.2"}],"ecosystem":"crates.io","package":"direct_ring_buffer","purl":"pkg:cargo/direct_ring_buffer","source":"rustsec"}],"references":[{"url":"https://github.com/ain1084/direct_ring_buffer/issues/1","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/ain1084/direct_ring_buffer/pull/2","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/ain1084/direct_ring_buffer","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2025-0105.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/direct_ring_buffer","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fp5x-7m4q-449f","url":"https://github.com/advisories/GHSA-fp5x-7m4q-449f","licence":"CC-BY-4.0","modified":"2025-10-28T06:29:24.396Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2025-0105","url":"https://rustsec.org/advisories/RUSTSEC-2025-0105.html","licence":"CC0-1.0","modified":"2025-10-28T06:29:24.396Z"}],"updatedAt":"2026-11-25T22:56:43.275Z"}