skiplist
Affected
- introduced
0.0.0-0, fixed1.1.1(semver)
Fixed versions
1.1.1
Fix
- Fixed version
1.1.1cargo update -p skiplist --precise 1.1.1
Advisory
Also known as: GHSA-x6j6-3ffp-qrfr
Use-after-free in clear and retain when an element's Drop panics
SkipList::clear drops the node chain and only then resets tail and len.
The drop runs each element's Drop, and T carries no bounds excluding a
panicking one. If it unwinds, tail still points at the freed node while len
stays non-zero.
back(), back_mut(), last_key_value() and last() dereference tail
through unsafe, so reading the container after the unwind is a use-after-free
(CWE-416). Drop for SkipList calls Box::from_raw on self.head, whichclear already destroyed, so dropping the container is a double free
(CWE-415).
retain, retain_mut and dedup_by reach the same state throughNode::filter_rebuild, which frees nodes and runs a user predicate before the
caller commits tail and len. There the head links are left partially
rewired, so traversal can also reach freed nodes.
Mitigation
Update to 1.1.1.
Not rated by the source.
0.0.0-0, fixed 1.1.1 (semver)1.1.1
1.1.1cargo update -p skiplist --precise 1.1.1Fix 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