{"id":"GHSA-5x36-7567-3cw6","aliases":["GHSA-5x36-7567-3cw6","RUSTSEC-2023-0016"],"related":[],"kind":"vulnerability","state":"published","title":"partial_sort contains Out-of-bounds Read in release mode","summary":"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.\n\nAll 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.\n\nThe 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.\n\nThis bug has been fixed in v0.2.0.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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.\n\nAll 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.\n\nThe 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.\n\nThis bug has been fixed in v0.2.0.","format":"markdown","source":"ghsa"}],"published":"2023-02-20T12:00:00.000Z","modified":"2023-11-08T04:15:57.343Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.2.0"}],"ecosystem":"crates.io","package":"partial_sort","purl":"pkg:cargo/partial_sort","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.2.0"}],"ecosystem":"crates.io","package":"partial_sort","purl":"pkg:cargo/partial_sort","source":"rustsec"}],"references":[{"url":"https://github.com/sundy-li/partial_sort/issues/7","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/sundy-li/partial_sort","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2023-0016.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/partial_sort","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5x36-7567-3cw6","url":"https://github.com/advisories/GHSA-5x36-7567-3cw6","licence":"CC-BY-4.0","modified":"2023-11-08T04:15:57.343Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2023-0016","url":"https://rustsec.org/advisories/RUSTSEC-2023-0016.html","licence":"CC0-1.0","modified":"2023-11-08T04:15:57.343Z"}],"updatedAt":"2026-11-25T22:56:43.141Z"}