rustsec-2026-0001
Vulnerability from osv_rustsec
Published
2026-01-05 12:00
Modified
2026-01-06 15:33
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.
{
"affected": [
{
"database_specific": {
"categories": [
"memory-corruption"
],
"cvss": null,
"informational": null
},
"ecosystem_specific": {
"affected_functions": null,
"affects": {
"arch": [],
"functions": [],
"os": []
}
},
"package": {
"ecosystem": "crates.io",
"name": "rkyv",
"purl": "pkg:cargo/rkyv"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "0.7.46"
},
{
"introduced": "0.8.0"
},
{
"fixed": "0.8.13"
}
],
"type": "SEMVER"
}
],
"versions": []
}
],
"aliases": [],
"database_specific": {
"license": "CC0-1.0"
},
"details": "The `SharedPointer::alloc` implementation for `sync::Arc\u003cT\u003e` and `rc::Rc\u003cT\u003e` 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\u0027s safety guarantees.",
"id": "RUSTSEC-2026-0001",
"modified": "2026-01-06T15:33:19Z",
"published": "2026-01-05T12:00:00Z",
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/rkyv"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2026-0001.html"
},
{
"type": "REPORT",
"url": "https://github.com/rkyv/rkyv/issues/644"
}
],
"related": [],
"severity": [],
"summary": "Potential Undefined Behaviors in `Arc\u003cT\u003e`/`Rc\u003cT\u003e` impls of `from_value` on OOM"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…