Skip to content

RUSTSEC-2026-0001: Potential Undefined Behaviors in Arc<T>/Rc<T> impls of from_value on OOM #1993

@github-actions

Description

@github-actions

Potential Undefined Behaviors in Arc&lt;T&gt;/Rc&lt;T&gt; impls of from_value on OOM

Details
Package rkyv
Version 0.8.12
URL rkyv/rkyv#644
Date 2026-01-05
Patched versions >=0.8.13

The SharedPointer::alloc implementation for sync::Arc&lt;T&gt; and rc::Rc&lt;T&gt; 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.

See advisory page for additional details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions