Advisory

GHSA-3qm2-rfqw-fmrw

Also known as: CVE-2021-28031, RUSTSEC-2021-0030

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: The source's own band: CRITICAL

Dates

Published
2022-05-24 17:43 UTC
Modified
2023-11-08 04:05 UTC

Affected packages and fixes

scratchpad

crates.io · All systems

Affected

  • introduced 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: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences