Skip to content

Commit 1cbc645

Browse files
shinmaodjc
authored andcommitted
Add RUSTSEC advisory for rkyv issue #644
1 parent c7f8c39 commit 1cbc645

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

crates/rkyv/RUSTSEC-0000-0000.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```toml
2+
[advisory]
3+
id = "RUSTSEC-0000-0000"
4+
package = "rkyv"
5+
date = "2026-01-05"
6+
url = "https://github.com/rkyv/rkyv/issues/644"
7+
categories = ["memory-corruption"]
8+
keywords = ["oom", "undefined-behavior"]
9+
10+
[versions]
11+
patched = [">= 0.8.13"]
12+
```
13+
14+
# Potential Undefined Behaviors in `Arc<T>`/`Rc<T>` impls of `from_value` on OOM
15+
16+
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).
17+
18+
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.
19+
20+
The issue is reachable through safe code and violates Rust's safety guarantees.

0 commit comments

Comments
 (0)