GHSA-5x36-7567-3cw6 json
partial_sort contains Out-of-bounds Read in release mode
published 3y ago modified 3y ago also RUSTSEC-2023-0016
- cvss
- —
- not scored
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- —
- no score, EPSS covers CVEs only
- public exploits
- 0
- none known
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.
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.
Patch / fix
- crates.io partial_sort 0.2.0
Is GHSA-5x36-7567-3cw6 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerAffected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | partial_sort | <0.2.0 >=0.0.0-0, <0.2.0 |
0.2.0 |
Classification
- Weakness
-
- CWE-125 Out-of-bounds Read
References
-
github.com
/sundy-li/partial_sort/issues/7
web, report
-
github.com
/sundy-li/partial_sort
package
-
rustsec.org
/advisories/RUSTSEC-2023-0016.html
web, advisory
-
crates.io
/crates/partial_sort
package
Sources
- GitHub Advisory GHSA-5x36-7567-3cw6
- OSV RUSTSEC-2023-0016
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.