Grid Integer Overflow Vulnerability in expand_rows Method Leading to Undefined Behavior

Vulnerability

A vulnerability exists in the Grid data structure for Rust, specifically in versions 0.17.0 prior to 1.0.1. The issue arises from an integer overflow in the expand_rows() method, which can disrupt the alignment between the grid's logical dimensions and its underlying storage. Once this internal consistency is violated, the safe API method get() may inadvertently call get_unchecked() with an incorrect index, causing undefined behavior. This vulnerability has been addressed in version 1.0.1.

Impact

Exploitation of this vulnerability can lead to invalid unchecked access through the safe API, causing undefined behavior. This has been confirmed using Miri, a Rust interpreter that detects undefined behavior, which reported that such an access violates Rust's safety guarantees. The vulnerability could also result in a crash or denial-of-service in release builds, such as causing a segmentation fault or illegal instruction.

Reproduction

The vulnerability can be reproduced by creating a Grid instance and calling the expand_rows() method with a large value that causes an overflow. After expanding the rows, the get() method can be called to trigger the undefined behavior, as it will internally use get_unchecked() with an invalid index.

Remediation

Users can upgrade to Grid version 1.0.1 or later, where this vulnerability has been patched.

Added: May 8, 2026, 10:25 PM
Updated: May 8, 2026, 10:25 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
5.0
exploitability
6.0
remediation
0.0
relevance
7.8
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.