low2.0No CVE yet
GHSA-h5j3-crg5-8jqm
orx-pinned-vec has undefined behavior in index_of_ptr with empty slices
Impact
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.
An attacker can exploit this with local access to the system, without logging in, without any action by a user. If it succeeds: low risk of outages.
Affected packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| rust | orx-pinned-vec | < 3.21.0 | 3.21.0 |
Weakness classification
References
- GitHub advisory
- https://github.com/advisories/GHSA-h5j3-crg5-8jqm
- https://github.com/orxfun/orx-pinned-vec/issues/52
- https://github.com/orxfun/orx-pinned-vec/pull/53
- https://github.com/orxfun/orx-pinned-vec/commit/4a4007a1aaff25cd417853c76163883a7110e276
- https://rustsec.org/advisories/RUSTSEC-2025-0106.html