# GHSA-h5j3-crg5-8jqm: orx-pinned-vec has undefined behavior in index_of_ptr with empty slices

- Severity: Low (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2025-10-21T12:00:00.000Z
- Modified: 2025-10-28T06:29:24.973Z
- Also known as: RUSTSEC-2025-0106
- Weaknesses: CWE-119, CWE-191

## Description

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.

(As written by GitHub Advisory Database.)

## Affected

- orx-pinned-vec (crates.io): before 3.21.0; from 0.0.0-0 before 3.21.0

## References

- <https://github.com/orxfun/orx-pinned-vec/issues/52> (report, web)
- <https://github.com/orxfun/orx-pinned-vec/pull/53> (web)
- <https://github.com/orxfun/orx-pinned-vec/commit/4a4007a1aaff25cd417853c76163883a7110e276> (web)
- <https://github.com/orxfun/orx-pinned-vec> (package)
- <https://rustsec.org/advisories/RUSTSEC-2025-0106.html> (advisory, web)
- <https://crates.io/crates/orx-pinned-vec> (package)

## Sources

- GitHub Advisory Database: [GHSA-h5j3-crg5-8jqm](https://github.com/advisories/GHSA-h5j3-crg5-8jqm), CC-BY-4.0, modified 2025-10-28
- RustSec Advisory Database: [RUSTSEC-2025-0106](https://rustsec.org/advisories/RUSTSEC-2025-0106.html), CC0-1.0, modified 2025-10-28

---

Page: https://cve.day/GHSA-h5j3-crg5-8jqm · Whole record: https://cve.day/GHSA-h5j3-crg5-8jqm.json · Rebuilt by cve.day 2026-11-25T22:56:43.276Z
