{"id":"RUSTSEC-2026-0001","aliases":["RUSTSEC-2026-0001"],"related":[],"kind":"vulnerability","state":"published","title":"Potential Undefined Behaviors in `Arc<T>`/`Rc<T>` impls of `from_value` on OOM","summary":"The `SharedPointer::alloc` implementation for `sync::Arc<T>` and `rc::Rc<T>` in `rkyv/src/impls/alloc/rc/atomic.rs` (and `rc.rs`) does not check if the allocator returns a null pointer on OOM (Out of Memory).\n\nThis null pointer can flow through to `SharedPointer::from_value`, which calls `Box::from_raw(ptr)` with the null pointer. This triggers undefined behavior when utilizing safe deserialization APIs (such as `rkyv::from_bytes` or `rkyv::deserialize_using`) if an OOM condition occurs during the allocation of the shared pointer.\n\nThe issue is reachable through safe code and violates Rust's safety guarantees.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"The `SharedPointer::alloc` implementation for `sync::Arc<T>` and `rc::Rc<T>` in `rkyv/src/impls/alloc/rc/atomic.rs` (and `rc.rs`) does not check if the allocator returns a null pointer on OOM (Out of Memory).\n\nThis null pointer can flow through to `SharedPointer::from_value`, which calls `Box::from_raw(ptr)` with the null pointer. This triggers undefined behavior when utilizing safe deserialization APIs (such as `rkyv::from_bytes` or `rkyv::deserialize_using`) if an OOM condition occurs during the allocation of the shared pointer.\n\nThe issue is reachable through safe code and violates Rust's safety guarantees.","format":"markdown","source":"rustsec"}],"published":"2026-01-05T12:00:00.000Z","modified":"2026-01-06T15:50:23.269Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.7.46"},{"type":"semver","introduced":"0.8.0","status":"affected","fixed":"0.8.13"}],"ecosystem":"crates.io","package":"rkyv","purl":"pkg:cargo/rkyv","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/rkyv","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0001.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/rkyv/rkyv/issues/644","tags":["report"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0001","url":"https://rustsec.org/advisories/RUSTSEC-2026-0001.html","licence":"CC0-1.0","modified":"2026-01-06T15:50:23.269Z"}],"updatedAt":"2026-11-25T22:56:43.298Z"}