Advisory

RUSTSEC-2026-0528

Also known as: None

Summary

UB can be reached from safe code

Details

The variance of RefSwap and OptionRefSwap were incorrect, possibly allowing use-after-free.

OptionRefSwap::into_inner did not check for null.

The fix is to make RefSwap and OptionRefSwap invariant, and to change OptionRefSwap::into_inner to return an option.
It is available in version 0.1.3.
If your project still compiles with 0.1.3 then it is not affected by the unsoundness on version 0.1.2

Severity

Not rated by the source.

Dates

Published
2026-11-12 12:00 UTC
Modified
2026-11-13 12:45 UTC

Affected packages and fixes

ref-swap

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.1.3 (semver)

Fixed versions

0.1.3

Fix

  • Fixed version 0.1.3
    cargo update -p ref-swap --precise 0.1.3

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