GHSA-5x36-7567-3cw6
JSON

medium

partial_sort contains Out-of-bounds Read in release mode

Severity
medium rating by GitHub
Published
Last changed
Also known as
RUSTSEC-2023-0016

Description

Affected versions of this crate were using a debug assertion to validate the last parameter of partial_sort(). This would allow invalid inputs to cause an out-of-bounds read instead of immediately panicking, when compiled without debug assertions.

All writes are bounds-checked, so the out-of-bounds memory access is read-only. This also means that the first attempted out-of-bounds write will panic, limiting the possible reads.

The accessible region is further limited by an initial bounds-checked read at (last / 2) - 1, i.e., it is proportional to the size of the vector.

This bug has been fixed in v0.2.0.

Affected

Product or packageVersionsReported by
partial_sort (crates.io)before 0.2.0, from 0.0.0-0 before 0.2.0GitHub Advisory Database, RustSec Advisory Database

Classification

References

Sources

SourceRecordLicence
GitHub Advisory DatabaseGHSA-5x36-7567-3cw6 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2023-0016 changed 2023-11-08CC0-1.0