9.8critical
Out of bounds write in nalgebra
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 1.41% (higher than 73% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-3w8g-xr3f-2mp8RUSTSEC-2021-0070
Description
An issue was discovered in the nalgebra crate before 0.27.1 for Rust. It allows out-of-bounds memory access because it does not ensure that the number of elements is equal to the product of the row count and column count.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| nalgebra (crates.io) | from 0.11.0 before 0.27.1 | GitHub Advisory Database, RustSec Advisory Database |
| dimforge nalgebra | before 0.27.1 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
An issue was discovered in the nalgebra crate before 0.27.1 for Rust. It allows out-of-bounds memory access because it does not ensure that the number of elements is equal to the product of the row count and column count.
GitHub Advisory Database
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.
RustSec Advisory Database
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.
NVD (es)
Se ha detectado un problema en la crate nalgebra versiones anteriores a 0.27.1 de Rust. Permite un acceso a la memoria fuera de límites porque no garantiza que el número de elementos sea igual al producto del recuento de filas y el recuento de columnas
References
| https://rustsec.org/advisories/RUSTSEC-2021-0070.html | advisory, exploit, issue-tracking, patch, third-party-advisory, web | |
| https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/nalgebra/RUSTSEC-2021-0070.md | third-party-advisory | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-38190 | advisory | |
| https://github.com/dimforge/nalgebra/issues/883 | report, web | |
| https://github.com/dimforge/nalgebra/pull/889 | web | |
| https://github.com/dimforge/nalgebra/commit/a803271fcce75b7c151e92aa099dfa546db4adc5 | web | |
| https://github.com/dimforge/nalgebra | package | |
| https://github.com/dimforge/nalgebra/blob/dev/CHANGELOG.md#0270 | web | |
| https://crates.io/crates/nalgebra | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-38190 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3w8g-xr3f-2mp8 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0070 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-38190 changed 2026-06-17 | Public domain |