All reports
Critical

move_elements can double-free objects on panic

Affected versions

Version ranges need review.

Rust / Cargoscratchpad
Affected versions
>=0.0.0-0 <1.3.1
Fixed version
1.3.1
Rust / Cargoscratchpad
Affected versions
< 1.3.1
Fixed version
1.3.1

Exploitation

CVE-2021-28031

Probability of exploitation in the next 30 days: 1.36%

FIRST EPSS · 2026-11-21

Description

Affected versions of scratchpad used ptr::read to read elements while calling a user provided function f on them. Since the pointer read duplicates ownership, a panic inside the user provided f function could cause a double free when unwinding.

The flaw was fixed in commit 891561bea by removing the unsafe block and using a plain iterator.

Links