RUSTSEC-2025-0166
Multiple soundness issues in `stackvector`
Affected versions of stackvector contained multiple soundness issues that could allow safe Rust code to trigger undefined behavior.
One issue was that StackVec::length was exposed as a public field. Safe Rust code could set length to a value larger than the backing array capacity. Other safe methods, including remove, pop, and truncate, relied on length before performing unsafe pointer operations (ptr::read, ptr::copy, offset/add). If length was corrupted by safe code, these methods could perform out-of-bounds pointer arithmetic, reads, writes, or copies.
The upstream maintainer also identified additional soundness issues, including the use of mem::uninitialized in StackVec::from_vec_unchecked, which was reachable through from_vec, and Miri violations related to MaybeUninit usage.
Version 2.0.0 was released to fix the known soundness issues.
What each source reports
OSV No score
Multiple soundness issues in `stackvector`
Affected versions of stackvector contained multiple soundness issues that could allow safe Rust code to trigger undefined behavior.
One issue was that StackVec::length was exposed as a public field. Safe Rust code could set length to a value larger than the backing array capacity. Other safe methods, including remove, pop, and truncate, relied on length before performing unsafe pointer operations (ptr::read, ptr::copy, offset/add). If length was corrupted by safe code, these methods could perform out-of-bounds pointer arithmetic, reads, writes, or copies.
The upstream maintainer also identified additional soundness issues, including the use of mem::uninitialized in StackVec::from_vec_unchecked, which was reachable through from_vec, and Miri violations related to MaybeUninit usage.
Version 2.0.0 was released to fix the known soundness issues.
- Record
RUSTSEC-2025-0166- Updated
- 2026-11-02
Affected packages
| Package | Affected | Fixed |
|---|---|---|
stackvectorcrates.io |
0.0.0-0 up to 2.0.0 | 2.0.0 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
RUSTSEC-2025-0166 is a vulnerability with no CVSS score yet in stackvector, published October 23, 2025. No source lists public exploit code. Fixed in stackvector 2.0.0.
References
crates.io/crates/stackvector
rustsec.org/advisories/RUSTSEC-2025-0166.html
github.com/Alexhuszagh/rust-stackvector/issues/3
github.com/Alexhuszagh/rust-stackvector/pull/6
github.com/Alexhuszagh/rust-stackvector/commit/02b947afdeeb1be95ec0888354aa76afdd9d0357
github.com/Alexhuszagh/rust-stackvector/issues/5