peroxide is vulnerable to Out-of-Bounds Write
59
Medium Risk
The Matrix and ComplexMatrix types in peroxide expose their data, row, and col fields publicly, and the internal unsafe code that backs matrix operations trusts these fields without checking that the buffer length matches row * col. Safe code can construct a matrix whose data length disagrees with its dimensions, and operations that reach the raw-pointer, BLAS, and index-arithmetic paths then read and write past the end of the heap buffer. This makes heap out-of-bounds reads and writes reachable without any unsafe in user code, allowing memory corruption and disclosure of adjacent heap memory. The fix makes the fields crate-private and adds a length assertion in the matrix and cmatrix constructors so the invariant can no longer be broken from outside the crate.
You are affected if you are using a version that falls within the vulnerable range and your code sets the public matrix fields to values where the buffer length does not match the row and column counts.
peroxide is vulnerable to Out-of-Bounds Write in versions 0.14.0 - 0.41.2.
Upgrade the peroxide library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

SOC 2Compliant
ISO 27001Compliant