memory_pages crate Division by Zero Vulnerability
Vulnerability
A division by zero vulnerability has been identified in the memory_pages crate version 0.1.0 for Rust. This issue arises from the crate's handling of the PagedVec data structure, which does not properly check for zero-sized types (ZSTs) as elements. The vulnerability can be exploited by creating a PagedVec with a ZST, reserving space, and then attempting to access the vector's length, leading to a runtime error.
Impact
Exploitation of this vulnerability causes a runtime crash due to a division by zero error.
Reproduction
The vulnerability can be reproduced by creating a PagedVec with a zero-sized type, reserving space in the vector, and then accessing its length. This sequence of actions will trigger the division by zero error.
Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM
