{"id":"CVE-2021-38190","aliases":["AZL-41989","EUVD-2021-1552","GHSA-3w8g-xr3f-2mp8","RUSTSEC-2021-0070"],"status":"published","title":"Out of bounds write in nalgebra","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.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-11","score":0.01411,"percentile":0.73027,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-119","CWE-787"],"published":"2021-06-06T12:00:00Z","modified":"2026-06-17T04:01:43Z","fixes":[{"ecosystem":"crates.io","package":"nalgebra","fixed_in":["0.27.1"],"sources":["ghsa","osv"]},{"ecosystem":"Azure Linux:3","package":"librsvg2","fixed_in":["2.58.1-1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"nalgebra","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.11.0"},{"fixed":"0.27.1"}]}]},{"source":"osv","ecosystem":"Azure Linux:3","package":"librsvg2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.58.1-1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"nalgebra","ranges":[{"type":"SEMVER","events":[{"introduced":"0.11.0"},{"fixed":"0.27.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"nalgebra","ranges":[{"type":"SEMVER","events":[{"introduced":"0.11.0"},{"fixed":"0.27.1"}]}]}],"products":[{"vendor":"dimforge","product":"nalgebra"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0070.html","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","Patch","Third Party Advisory","web","advisory"]},{"url":"https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/nalgebra/RUSTSEC-2021-0070.md","tags":["x_refsource_MISC","x_transferred","Third Party Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-38190","tags":["web","advisory"]},{"url":"https://github.com/dimforge/nalgebra/issues/883","tags":["web","report"]},{"url":"https://github.com/dimforge/nalgebra/pull/889","tags":["web"]},{"url":"https://github.com/dimforge/nalgebra/commit/a803271fcce75b7c151e92aa099dfa546db4adc5","tags":["web"]},{"url":"https://github.com/dimforge/nalgebra/blob/dev/CHANGELOG.md#0270","tags":["web"]},{"url":"https://github.com/advisories/GHSA-3w8g-xr3f-2mp8"},{"url":"https://github.com/dimforge/nalgebra","tags":["package"]},{"url":"https://crates.io/crates/nalgebra","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-38190","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.","status":"published","published":"2021-08-08T05:09:59Z","modified":"2024-08-04T01:37:16.32Z","updated_at":"2026-11-02T14:33:07.349244Z"}],"euvd":[{"id":"EUVD-2021-1552","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.","status":"published","published":"2021-08-08T05:09:59Z","modified":"2024-08-04T01:37:16Z","updated_at":"2026-11-03T03:24:25.244479Z"}],"ghsa":[{"id":"GHSA-3w8g-xr3f-2mp8","title":"Out of bounds write in nalgebra","description":"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`.","status":"published","published":"2021-08-25T20:55:49Z","modified":"2023-02-01T05:05:52Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-119","CWE-787"],"updated_at":"2026-11-02T14:36:35.781528Z"}],"nvd":[{"id":"CVE-2021-38190","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.","status":"published","published":"2021-08-08T06:15:08.93Z","modified":"2026-06-17T04:01:43.627Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"cwes":["CWE-119"],"updated_at":"2026-11-02T14:06:56.562207Z"}],"osv":[{"id":"AZL-41989","title":"CVE-2021-38190 affecting package librsvg2 for versions less than 2.58.1-1","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.","status":"published","published":"2021-08-08T06:15:08Z","modified":"2026-04-21T04:50:06.366054Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:28:04.893995Z"},{"id":"GHSA-3w8g-xr3f-2mp8","title":"Out of bounds write in nalgebra","description":"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`.","status":"published","published":"2021-08-25T20:55:49Z","modified":"2023-11-08T04:06:25.921387Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-119","CWE-787"],"updated_at":"2026-11-02T15:46:36.092962Z"},{"id":"RUSTSEC-2021-0070","title":"VecStorage Deserialize Allows Violation of Length Invariant","description":"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.","status":"published","published":"2021-06-06T12:00:00Z","modified":"2023-11-08T04:06:25.921387Z","updated_at":"2026-11-02T15:53:39.492624Z"}]}}
