Skip to content

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.

PackageAffectedFixed inStatus
crates.io orx-pinned-vec(crates.io) < 3.21.0; >= 0.0.0-0, < 3.21.0 3.21.0 Fixed

Affected products

ProductAffected versionsFixed 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