Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS01eDM2LTc1NjctM2N3Ns4AAx3a

partial_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.

Permalink: https://github.com/advisories/GHSA-5x36-7567-3cw6
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS01eDM2LTc1NjctM2N3Ns4AAx3a
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 1 year ago
Updated: about 1 year ago


Identifiers: GHSA-5x36-7567-3cw6
References: Repository: https://github.com/sundy-li/partial_sort
Blast Radius: 0.0

Affected Packages

cargo:partial_sort
Dependent packages: 2
Dependent repositories: 71
Downloads: 1,264,213 total
Affected Version Ranges: < 0.2.0
Fixed in: 0.2.0
All affected versions: 0.1.0, 0.1.1, 0.1.2
All unaffected versions: 0.2.0