RUSTSEC-2023-0016
MEDIUMpartial_sort contains Out-of-bounds Read in release mode
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.
- Published
- 20 Feb 2023
- Last modified
- 8 Nov 2023
- Weakness
- CWE-125
- Also known as
- GHSA-5x36-7567-3cw6
- Sources
- OSV GHSA-5x36-7567-3cw6JSONOSVJSON
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | partial_sort | < 0.2.0 | 0.2.0 |
| OSV | crates.io | partial_sort | >= 0.0.0-0, < 0.2.0 | 0.2.0 |
References
- https://github.com/sundy-li/partial_sort/issues/7 · WEB, REPORT
- https://github.com/sundy-li/partial_sort · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2023-0016.html · WEB, ADVISORY
- https://crates.io/crates/partial_sort · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 20 Feb 2023)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 28 Feb 2023)