CVE-2021-38190 — Out of bounds write in nalgebra — CVE Details
CRITICAL
Out of bounds write in nalgebra
Published August 25, 2021Updated November 8, 2023Source: osv
Summary
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`](https://github.com/dimforge/nalgebra/commit/086e6e719f53fecba6dadad2e953a487976387f5)) due to the addition of an automatically derived implementation of `Deserialize` for `MatrixVec`. `MatrixVec` was later renamed to `VecStorage` in v0.16.13 ([`0f66403`](https://github.com/dimforge/nalgebra/commit/0f66403cbbe9eeac15cedd8a906c0d6a3d8841f2)) and continued to use the automatically derived implementation of `Deserialize`.
Advisory Timeline
- First published August 25, 2021 (1874 days ago).
- Last revised November 8, 2023 — 804 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
Cargo
Update nalgebra to 0.27.1 or latercargo update -p nalgebra --precise 0.27.1
After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: crates.io (1).
| Package | Ecosystem | Affected | Fixed In |
|---|---|---|---|
| nalgebra | crates.io | All versions | 0.27.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-38190ADVISORY
- https://github.com/dimforge/nalgebra/issues/883WEB
- https://github.com/dimforge/nalgebra/pull/889WEB
- https://github.com/dimforge/nalgebra/commit/a803271fcce75b7c151e92aa099dfa546db4adc5WEB
- https://github.com/dimforge/nalgebraPACKAGE
- https://github.com/dimforge/nalgebra/blob/dev/CHANGELOG.md#0270WEB
- https://rustsec.org/advisories/RUSTSEC-2021-0070.htmlWEB
Frequently Asked Questions
- What is CVE-2021-38190?
- Out of bounds write in nalgebra This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
- How do I check if my project is affected by CVE-2021-38190?
- CVE-2021-38190 affects nalgebra. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-38190 and 200,000+ other known vulnerabilities.
Severity & Exploitability
CVSS Score
9.8
Exploitation is straightforward and causes maximum impact. Patch immediately.
Also Known As
GHSA-3w8g-xr3f-2mp8
RUSTSEC-2021-0070
Related CVEs
- RUSTSEC-2026-0327CRITICAL
Wasmtime component async-lifted callback result count is unvalidated, causing a native stack buffer overflow
- CVE-2026-75856CRITICAL
CodeWhale: SSRF bypass - TOCTOU on DNS failure for DNS pinning
Check if you're affected
Scan your dependencies to see if this vulnerability affects your projects.
Scan Your Dependencies