Advisory

RUSTSEC-2021-0030

Also known as: CVE-2021-28031, GHSA-3qm2-rfqw-fmrw

Summary

move_elements can double-free objects on panic

Details

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.

Severity

Critical Basis: CVSS v3 score 9.8, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Dates

Published
2021-02-18 12:00 UTC
Modified
2023-11-08 04:05 UTC

Affected packages and fixes

scratchpad

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 1.3.1 (semver)

Fixed versions

1.3.1

Fix

  • Fixed version 1.3.1
    cargo update -p scratchpad --precise 1.3.1

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