# RUSTSEC-2026-0528: UB can be reached from safe code

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-11-12T12:00:00.000Z
- Modified: 2026-11-13T12:45:06.399Z

## Description

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

(As written by RustSec Advisory Database.)

## Affected

- ref-swap (crates.io): from 0.0.0-0 before 0.1.3

## References

- <https://crates.io/crates/ref-swap> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0528.html> (advisory)
- <https://github.com/Nitrokey/ref-swap/releases/tag/v0.1.3> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0528](https://rustsec.org/advisories/RUSTSEC-2026-0528.html), CC0-1.0, modified 2026-11-13

---

Page: https://cve.day/RUSTSEC-2026-0528 · Whole record: https://cve.day/RUSTSEC-2026-0528.json · Rebuilt by cve.day 2026-11-25T22:56:43.501Z
