{"id":"RUSTSEC-2026-0528","aliases":["RUSTSEC-2026-0528"],"related":[],"kind":"vulnerability","state":"published","title":"UB can be reached from safe code","summary":"The variance of `RefSwap` and `OptionRefSwap` were incorrect, possibly allowing use-after-free.\n\n`OptionRefSwap::into_inner` did not check for null.\n\nThe fix is to make `RefSwap` and `OptionRefSwap` invariant, and to change `OptionRefSwap::into_inner` to return an option.\nIt is available in version 0.1.3.\nIf your project still compiles with 0.1.3 then it is not affected by the unsoundness on version 0.1.2","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"The variance of `RefSwap` and `OptionRefSwap` were incorrect, possibly allowing use-after-free.\n\n`OptionRefSwap::into_inner` did not check for null.\n\nThe fix is to make `RefSwap` and `OptionRefSwap` invariant, and to change `OptionRefSwap::into_inner` to return an option.\nIt is available in version 0.1.3.\nIf your project still compiles with 0.1.3 then it is not affected by the unsoundness on version 0.1.2","format":"markdown","source":"rustsec"}],"published":"2026-11-12T12:00:00.000Z","modified":"2026-11-13T12:45:06.399Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.1.3"}],"ecosystem":"crates.io","package":"ref-swap","purl":"pkg:cargo/ref-swap","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/ref-swap","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0528.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/Nitrokey/ref-swap/releases/tag/v0.1.3","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0528","url":"https://rustsec.org/advisories/RUSTSEC-2026-0528.html","licence":"CC0-1.0","modified":"2026-11-13T12:45:06.399Z"}],"updatedAt":"2026-11-25T22:56:43.501Z"}