Advisory

RUSTSEC-2023-0016

Also known as: GHSA-5x36-7567-3cw6

Summary

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

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.

Severity

Not rated by the source.

Dates

Published
2023-02-20 12:00 UTC
Modified
2023-11-08 04:15 UTC

Affected packages and fixes

partial_sort

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.2.0 (semver)

Fixed versions

0.2.0

Fix

  • Fixed version 0.2.0
    cargo update -p partial_sort --precise 0.2.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences