Rust advisories / orx-pinned-vec
Unsound LowRUSTSEC-2025-0106 · orx-pinned-vec
RUSTSEC-2025-0106: Undefined behavior in index_of_ptr with empty slices
Short answerorx-pinned-vec has an API that can cause undefined behaviour from safe code: Undefined behavior in index_of_ptr with empty slices. Fixed in 3.21.0.
| Crate | orx-pinned-vec |
|---|---|
| Type | Unsound (memory-corruption) |
| Affected versions | Before 3.21.0. |
| Fixed in | 3.21.0 |
| Severity | Low (GitHub rating) |
| Published | 2025-10-21 |
| Last changed | 2025-10-28 |
| Also known as | GHSA-h5j3-crg5-8jqm |
| Affected functions | orx_pinned_vec::utils::slice::index_of_ptr |
What to do
- See which version you have:
cargo tree -i orx-pinned-vec(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p orx-pinned-vec. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for exampleorx-pinned-vec = "3.21.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
The safe function index_of_ptr causes undefined behavior when called with an empty slice.
The issue occurs in the line ptr.add(slice.len() - 1) which underflows when slice.len() is 0, creating a pointer with a massive offset. According to Rust's safety rules, creating such a pointer causes immediate undefined behavior.
References
- Package: crates.io/crates/orx-pinned-vec
- Advisory: rustsec.org/advisories/RUSTSEC-2025-0106.html
- Report: github.com/orxfun/orx-pinned-vec/issues/52
- Web: github.com/orxfun/orx-pinned-vec/pull/53
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?