Email me

Rust advisories / nalgebra

Vulnerability CriticalRUSTSEC-2021-0070 · nalgebra

RUSTSEC-2021-0070: VecStorage Deserialize Allows Violation of Length Invariant

Short answerA security vulnerability in the nalgebra crate: VecStorage Deserialize Allows Violation of Length Invariant. GitHub rates it Critical. Fixed in 0.27.1: update to a fixed version.

Cratenalgebra
TypeVulnerability (memory-corruption, memory-exposure)
Affected versionsFrom 0.11.0 before 0.27.1.
Fixed in0.27.1
SeverityCritical (GitHub rating)
Published2021-06-06
Last changed2023-11-08
Also known asCVE-2021-38190, GHSA-3w8g-xr3f-2mp8

What to do

  1. See which version you have: cargo tree -i nalgebra (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p nalgebra. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example nalgebra = "0.27.1") 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

The Deserialize implementation for VecStorage did not maintain the invariant that the number of elements must equal nrows * ncols. Deserialization of specially crafted inputs could allow memory access beyond allocation of the vector.

This flaw was introduced in v0.11.0 (086e6e) due to the addition of an automatically derived implementation of Deserialize for MatrixVec. MatrixVec was later renamed to VecStorage in v0.16.13 (0f66403) and continued to use the automatically derived implementation of Deserialize.

This flaw was corrected in commit 5bff536 by returning an error during deserialization if the number of elements does not exactly match the expected size.

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.

Up next

Same cratenalgebra: 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