{"id":"RUSTSEC-2023-0016","summary":"Possible out-of-bounds read in release mode","details":"Affected versions of this crate were using a debug assertion to validate the\n`last` parameter of `partial_sort()`. This would allow invalid inputs to cause\nan out-of-bounds read instead of immediately panicking, when compiled without\ndebug assertions.\n\nAll writes are bounds-checked, so the out-of-bounds memory access is read-only.\nThis also means that the first attempted out-of-bounds write will panic,\nlimiting the possible reads.\n\nThe accessible region is further limited by an initial bounds-checked read\nat `(last / 2) - 1`, i.e., it is proportional to the size of the vector.\n\nThis bug has been fixed in v0.2.0.","aliases":["GHSA-5x36-7567-3cw6"],"modified":"2023-11-08T04:15:57.343834Z","published":"2023-02-20T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/partial_sort"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2023-0016.html"},{"type":"REPORT","url":"https://github.com/sundy-li/partial_sort/issues/7"}],"affected":[{"package":{"name":"partial_sort","ecosystem":"crates.io","purl":"pkg:cargo/partial_sort"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.2.0"}]}],"ecosystem_specific":{"affects":{"functions":[],"arch":[],"os":[]},"affected_functions":null},"database_specific":{"informational":"unsound","source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2023-0016.json","cvss":null,"categories":["memory-exposure"]}}],"schema_version":"1.7.3"}