Email me

Rust advisories / stackvector

UnsoundRUSTSEC-2025-0166 · stackvector

RUSTSEC-2025-0166: Multiple soundness issues in `stackvector`

Short answerstackvector has an API that can cause undefined behaviour from safe code: Multiple soundness issues in `stackvector`. Fixed in 2.0.0.

Cratestackvector
TypeUnsound
Affected versionsBefore 2.0.0.
Fixed in2.0.0
Severitynot scored
Published2025-10-23
Last changed2026-07-02
Also known asnone

What to do

  1. See which version you have: cargo tree -i stackvector (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p stackvector. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example stackvector = "2.0.0") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Other advisories for stackvector

Full security history of stackvector

Up next

Same cratestackvector: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ