GHSA-h5j3-crg5-8jqm orx-pinned-vec has undefined behavior in index_of_ptr with empty slices
LowCVSS 2.0
- Published
- Updated
- Exploit status
- No public exploit known
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.
Upgrade path
1 package: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| crates.io orx-pinned-vec(crates.io) | < 3.21.0; >= 0.0.0-0, < 3.21.0 | 3.21.0 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| crates.io orx-pinned-vec(crates.io) | < 3.21.0 | 3.21.0 |
| crates.io orx-pinned-vec(crates.io) | >= 0.0.0-0, < 3.21.0 | 3.21.0 |
References
- github.com issue-tracking
- github.com patch
- github.com patch
- github.com product
- rustsec.org vendor-advisory
- crates.io product
- github.com