Advisory

RUSTSEC-2026-0001

Also known as: None

Summary

Potential Undefined Behaviors in Arc<T>/Rc<T> impls of from_value on OOM

Details

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

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

The issue is reachable through safe code and violates Rust's safety guarantees.

Severity

Not rated by the source.

Dates

Published
2026-01-05 12:00 UTC
Modified
2026-01-06 15:50 UTC

Affected packages and fixes

rkyv

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.7.46, introduced 0.8.0, fixed 0.8.13 (semver)

Fixed versions

0.7.46, 0.8.13

Fix

  • Fixed version 0.7.46
    cargo update -p rkyv --precise 0.7.46
  • Fixed version 0.8.13
    cargo update -p rkyv --precise 0.8.13

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