{"id":"CVE-2021-38190","aliases":["CVE-2021-38190","GHSA-3w8g-xr3f-2mp8","RUSTSEC-2021-0070"],"related":[],"kind":"vulnerability","state":"published","title":"Out of bounds write in nalgebra","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.\n\nThis 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`.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.\n\nThis 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`.\n\nThis flaw was corrected in commit [`5bff536`](https://github.com/dimforge/nalgebra/commit/5bff5368bf38ddfa31416e4ae9897b163031a513) by returning an error during deserialization if the number of elements does not exactly match the expected size.","format":"markdown","source":"rustsec"},{"lang":"es","text":"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","source":"nvd"}],"published":"2021-06-06T12:00:00.000Z","modified":"2026-06-17T04:01:43.627Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-119","CWE-787"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.11.0","status":"affected","fixed":"0.27.1"}],"ecosystem":"crates.io","package":"nalgebra","purl":"pkg:cargo/nalgebra","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.11.0","status":"affected","fixed":"0.27.1"}],"ecosystem":"crates.io","package":"nalgebra","purl":"pkg:cargo/nalgebra","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.27.1"}],"vendor":"dimforge","product":"nalgebra","cpe":"cpe:2.3:a:dimforge:nalgebra:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0070.html","tags":["advisory","exploit","issue-tracking","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/nalgebra/RUSTSEC-2021-0070.md","tags":["third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-38190","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/dimforge/nalgebra/issues/883","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/dimforge/nalgebra/pull/889","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/dimforge/nalgebra/commit/a803271fcce75b7c151e92aa099dfa546db4adc5","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/dimforge/nalgebra","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/dimforge/nalgebra/blob/dev/CHANGELOG.md#0270","tags":["web"],"sources":["ghsa"]},{"url":"https://crates.io/crates/nalgebra","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-38190","url":"https://www.cve.org/CVERecord?id=CVE-2021-38190","licence":"CVE Terms of Use","modified":"2024-08-04T01:37:16.320Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3w8g-xr3f-2mp8","url":"https://github.com/advisories/GHSA-3w8g-xr3f-2mp8","licence":"CC-BY-4.0","modified":"2023-11-08T04:06:25.921Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0070","url":"https://rustsec.org/advisories/RUSTSEC-2021-0070.html","licence":"CC0-1.0","modified":"2023-11-08T04:06:25.921Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-38190","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-38190","licence":"Public domain","modified":"2026-06-17T04:01:43.627Z"}],"updatedAt":"2026-11-25T22:58:03.054Z","epss":{"score":0.01411,"percentile":0.73465,"date":"2026-12-01T12:00:22.000Z"}}