RUSTSEC-2025-0105

Source
https://rustsec.org/advisories/RUSTSEC-2025-0105
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2025-0105.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2025-0105
Published
2025-10-21T12:00:00Z
Modified
2025-10-21T19:00:18Z
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.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / direct_ring_buffer

Package

Name
direct_ring_buffer
View open source insights on deps.dev
Purl
pkg:cargo/direct_ring_buffer

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.2.2

Ecosystem specific

{
    "affects": {
        "arch": [],
        "os": [],
        "functions": [
            "direct_ring_buffer::create_ring_buffer"
        ]
    },
    "affected_functions": null
}

Database specific

categories

[
    "memory-exposure"
]

informational

"unsound"

cvss

null