{"id":"GHSA-924w-mwc9-86m8","aliases":["GHSA-924w-mwc9-86m8","RUSTSEC-2026-0408"],"related":[],"kind":"vulnerability","state":"published","title":"Aliasing violations in splice, mutable iteration and cursors","summary":"Four code paths create a pointer whose permission is later revoked, then\nwrite through it. Miri reports each as undefined behaviour under both the\nTree Borrows and Stacked Borrows aliasing models (CWE-758). All four are\nreachable from safe code with standard `Ord` types.\n\n1. **Splice back-pointer.** `split_off`, `split_off_index` and `append` stored\n   the first spliced node's `prev` pointer from a reference to the head, then\n   wrote through that same reference, invalidating the stored pointer. A later\n   `pop_first` or `pop_front` writes through it. This affects all four\n   collections.\n2. **`SkipMap::range_mut` back pointer.** With an `Included` or `Excluded`\n   upper bound, the back pointer came from a shared reference. `next_back`\n   hands out `&mut V` through it, and writing to that value is undefined\n   behaviour.\n3. **`IterMut::next_back` reads a yielded node.** In `SkipList` and `SkipMap`,\n   `next_back` read the predecessor node even after the front end had yielded\n   it as `&mut`. The read freezes the caller's reference, and the caller's\n   next write through it is undefined behaviour. This affects `iter_mut`,\n   `values_mut` and `range_mut` used from both ends.\n4. **Cursor list pointer.** `lower_bound_mut` and `upper_bound_mut` on\n   `OrderedSkipList` and `SkipSet` (`cursor` feature) took the cursor's list\n   pointer, then searched through `&self`. A comparator with interior-mutable\n   state, such as a `Cell` call counter, wrote to the list's memory through\n   that shared borrow and invalidated the cursor's pointer. The comparator can\n   be a fully consistent order. `SkipMap` cursors are not affected.\n\nNo miscompilation has been observed in an optimised build. A future compiler\nmay still optimise on the violated aliasing assumptions.\n\nThe flaws were corrected in 1.3.0. Each fix derives the pointer used for\nmutation from the collection's long-lived allocation pointers, and each has a\nMiri regression test.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"Four code paths create a pointer whose permission is later revoked, then\nwrite through it. Miri reports each as undefined behaviour under both the\nTree Borrows and Stacked Borrows aliasing models (CWE-758). All four are\nreachable from safe code with standard `Ord` types.\n\n1. **Splice back-pointer.** `split_off`, `split_off_index` and `append` stored\n   the first spliced node's `prev` pointer from a reference to the head, then\n   wrote through that same reference, invalidating the stored pointer. A later\n   `pop_first` or `pop_front` writes through it. This affects all four\n   collections.\n2. **`SkipMap::range_mut` back pointer.** With an `Included` or `Excluded`\n   upper bound, the back pointer came from a shared reference. `next_back`\n   hands out `&mut V` through it, and writing to that value is undefined\n   behaviour.\n3. **`IterMut::next_back` reads a yielded node.** In `SkipList` and `SkipMap`,\n   `next_back` read the predecessor node even after the front end had yielded\n   it as `&mut`. The read freezes the caller's reference, and the caller's\n   next write through it is undefined behaviour. This affects `iter_mut`,\n   `values_mut` and `range_mut` used from both ends.\n4. **Cursor list pointer.** `lower_bound_mut` and `upper_bound_mut` on\n   `OrderedSkipList` and `SkipSet` (`cursor` feature) took the cursor's list\n   pointer, then searched through `&self`. A comparator with interior-mutable\n   state, such as a `Cell` call counter, wrote to the list's memory through\n   that shared borrow and invalidated the cursor's pointer. The comparator can\n   be a fully consistent order. `SkipMap` cursors are not affected.\n\nNo miscompilation has been observed in an optimised build. A future compiler\nmay still optimise on the violated aliasing assumptions.\n\nThe flaws were corrected in 1.3.0. Each fix derives the pointer used for\nmutation from the collection's long-lived allocation pointers, and each has a\nMiri regression test.","format":"markdown","source":"rustsec"}],"published":"2026-10-24T12:00:00.000Z","modified":"2026-10-26T14:00:05.788Z","severities":[{"scorer":"RustSec Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"1.3.0"}],"ecosystem":"crates.io","package":"skiplist","purl":"pkg:cargo/skiplist","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/skiplist","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0408.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/JP-Ellis/rust-skiplist/pull/407","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0408","url":"https://rustsec.org/advisories/RUSTSEC-2026-0408.html","licence":"CC0-1.0","modified":"2026-10-26T14:00:05.788Z"}],"updatedAt":"2026-11-25T22:56:43.453Z"}