RUSTSEC-2025-0166

Source
https://rustsec.org/advisories/RUSTSEC-2025-0166
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2025-0166.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2025-0166
Published
2025-10-23T12:00:00Z
Modified
2026-07-02T08:00:03.852602681Z
Summary
Multiple soundness issues in `stackvector`
Details

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.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / stackvector

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
2.0.0

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "functions": [],
        "os": [],
        "arch": []
    }
}

Database specific

source
"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2025-0166.json"
informational
"unsound"
cvss
null
categories
[]