stable-vec
Affected
- introduced
0.0.0-0, fixed0.4.3(semver)
Fixed versions
0.4.3
Fix
- Fixed version
0.4.3cargo update -p stable-vec --precise 0.4.3
Advisory
Also known as: GHSA-mr2v-63pc-gmr4
Panic-safety unsoundness in BitVecCore::clear (double-free / use-after-free)
BitVecCore::clear drops every occupied element with drop_in_place and only
afterwards clears the occupancy bits and resets len. If an element's Drop
panics, those metadata updates are skipped, so the slot of the already-dropped
element stays marked as occupied. BitVecCore::drop calls clear() again,
visits the same slot, and drops the element a second time — a double-free /
use-after-free reachable from safe Rust.
Reachable via the public StableVec::clear and ExternStableVec::clear, which
delegate to BitVecCore::clear.
Impact
Drop.Reachable entirely from safe Rust via catch_unwind with element types whoseDrop can panic. Confirmed under AddressSanitizer on 0.4.2.
Fix
Fixed in stable-vec 0.4.3 by removing each element via remove_at, which
clears the occupancy bit before taking the value out.
Release 0.4.3 also fixes several other panic-safety issues found by the
maintainer; see GHSA-mr2v-63pc-gmr4
and the 0.4.3 changelog for the full list.
Not rated by the source.
0.0.0-0, fixed 0.4.3 (semver)0.4.3
0.4.3cargo update -p stable-vec --precise 0.4.3Fix 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
Source: RustSec Advisory Database · CC0-1.0