GHSA-5x36-7567-3cw6: Partial sort Partial_sort Contains Out-of-bounds Read Vulnerability
MODERATEGHSA-5x36-7567-3cw6 is a MODERATE partial_sort contains out-of-bounds read vulnerability (CWE-125: Out-of-bounds Read) affecting Partial sort libraries in the crates.io ecosystem. The issue involves partial_sort contains out-of-bounds read in release mode. Remediation is available by upgrading affected packages to version 0.2.0.
GHSA-5x36-7567-3cw6 at a Glance
How to Fix GHSA-5x36-7567-3cw6
To remediate this vulnerability, upgrade all affected Partial sort dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade partial_sort to 0.2.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for partial_sort
How to Check if You Are Affected
To determine whether your application is affected by GHSA-5x36-7567-3cw6, inspect your project dependencies for Partial sort:
inspect dependencies for partial_sort
Analyze the terminal output to locate any version of Partial sort in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Partial sort, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-5x36-7567-3cw6 Affected Partial sort Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
partial_sort
|
crates.io |
< 0.2.0
|
0.2.0
|
References
Frequently Asked Questions
What is GHSA-5x36-7567-3cw6?
Which Partial sort versions are affected?
What version fixes GHSA-5x36-7567-3cw6?
Is partial_sort affected?
What CWE is associated with GHSA-5x36-7567-3cw6?
How can I check crates.io dependencies for GHSA-5x36-7567-3cw6?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5x36-7567-3cw6",
"modified" : "2023-02-28T20:31:05Z",
"published" : "2023-02-28T20:31:05Z",
"aliases" : [ ],
"summary" : "partial_sort contains Out-of-bounds Read in release mode",
"details" : "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.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "partial_sort"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sundy-li/partial_sort/issues/7"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sundy-li/partial_sort"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2023-0016.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-125" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-02-28T20:31:05Z",
"nvd_published_at" : null
}
}