Email me

Rust advisories / stackvector

Vulnerability HighRUSTSEC-2021-0048 · stackvector

RUSTSEC-2021-0048: StackVec::extend can write out of bounds when size_hint is incorrect

Short answerA security vulnerability in the stackvector crate: StackVec::extend can write out of bounds when size_hint is incorrect. High severity (CVSS 7.3). Fixed in 1.0.9: update to a fixed version.

Cratestackvector
TypeVulnerability (memory-corruption)
Affected versionsBefore 1.0.9.
Fixed in1.0.9
SeverityHigh, CVSS 7.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Published2021-02-19
Last changed2023-11-08
Also known asCVE-2021-29939, GHSA-9frf-r7c7-j2vg

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 = "1.0.9") 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

StackVec::extend used the lower and upper bounds from an Iterator's size_hint to determine how many items to push into the stack based vector.

If the size_hint implementation returned a lower bound that was larger than the upper bound, StackVec would write out of bounds and overwrite memory on the stack. As mentioned by the size_hint documentation, size_hint is mainly for optimization and incorrect implementations should not lead to memory safety 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