# RUSTSEC-2026-0409: Use-after-free from a comparator that answers inconsistently


- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 24 Oct 2026
- **Also known as:** GHSA-cc53-p78w-23w9

## What is RUSTSEC-2026-0409?

RUSTSEC-2026-0409 is a vulnerability in skiplist, published on 24 Oct 2026. 

### Official description

`OrderedSkipList`, `SkipSet` and `SkipMap` can free a node that is still
linked when a `Comparator` or `Ord` implementation gives different answers for
the same pair of values during one mutating call. A later call reads the freed
memory (CWE-416). A safe `impl Ord` with the default comparator is enough to
reach it.

The mutating traversals record a precursor at each level: the last node whose
link points at a node comparing not-`Less` than the target. The splice code
assumes every recorded precursor's link points at or past the final position.
If a later comparison reports one of those nodes as `Less`, the walk steps
past it and the assumption breaks. Removals such as `take_first`, `take` and
`remove` then rewire the wrong link and free the target while its real
predecessor still points at it. `insert` builds crossed links and wrong skip
distances from the same precursors.

A comparator that is a pure function of its two arguments cannot trigger
this, even if it is not transitive. The trigger is a stateful or
non-deterministic implementation, for example one that reads a counter, a
cache, a clock or a random source.

The flaw was corrected in 1.3.0. The mutating traversals track the link target
of the lowest recorded precursor and panic with "comparator does not implement
a total order" when a `Less` answer contradicts an earlier one. Every splice
site also checks its precursors before the first write. Each detected
contradiction panics before any link, value or length changes, so the
collection stays valid and safe to drop.

## Which versions are affected by RUSTSEC-2026-0409?

1 open source package ship an affected version, including skiplist.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `skiplist` | crates.io | From 0.0.0-0 | 1.3.0 |

## How do I fix RUSTSEC-2026-0409?

Upgrade skiplist to 1.3.0 or later.

## Is RUSTSEC-2026-0409 being exploited?

There is no known exploitation of RUSTSEC-2026-0409 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for RUSTSEC-2026-0409 and fix it if it is affected.

What it is: RUSTSEC-2026-0409 is a vulnerability in skiplist, published on 24 Oct 2026. 
Exploitation: There is no known exploitation of RUSTSEC-2026-0409 in the wild and no public exploit code.

Affected packages and fixed versions:
- skiplist (crates.io): affected from 0.0.0-0; fixed in 1.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/RUSTSEC-2026-0409/ (Markdown: https://insights.sbomify.com/RUSTSEC-2026-0409/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/RUSTSEC-2026-0409

---
From sbomify Insights: https://insights.sbomify.com/RUSTSEC-2026-0409/
Summaries are generated and may contain mistakes; the official description above is the record.
