Skip to main content

Rust grid crate CVE-2026-42199

| EUVDEUVD-2026-28834 MEDIUM
Integer Overflow or Wraparound (CWE-190)
2026-05-08 GitHub_M
6.2
CVSS 3.1 · GitHub Advisory
Share

Severity by source

GitHub Advisory PRIMARY
6.2 MEDIUM
AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI
6.2 MEDIUM

Local vector because exploitation requires code running in-process; no privileges needed to call the library; impact limited to availability via process crash from undefined behavior.

3.1 AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

4
Source Code Evidence Fetched
Jul 23, 2026 - 22:43 vuln.today
Analysis Generated
Jul 23, 2026 - 22:43 vuln.today
Patch available
May 08, 2026 - 23:18 EUVD
CVE Published
May 08, 2026 - 21:15 nvd
MEDIUM 6.2

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 2 cargo packages depend on grid (2 direct, 0 indirect)

Ecosystem-wide dependent count for version 0.17.0.

DescriptionGitHub Advisory

Grid is a data structure grid for rust. From version 0.17.0 to before version 1.0.1, an integer overflow in Grid::expand_rows() can corrupt the relationship between the grid’s logical dimensions and its backing storage. After the internal invariant is broken, the safe API get() may invoke get_unchecked() with an invalid index, resulting in Undefined Behavior. This issue has been patched in version 1.0.1.

AnalysisAI

Integer overflow in the Rust grid crate's Grid::expand_rows() method (versions 0.17.0 through 1.0.0) corrupts the relationship between logical grid dimensions and physical backing storage, allowing the safe get() API to invoke get_unchecked() with an invalid index and trigger undefined behavior. A publicly available proof-of-concept included in the GHSA advisory demonstrates a process crash (SIGSEGV or illegal instruction trap) using only safe Rust code by passing usize::MAX / 2 to expand_rows(). No CISA KEV listing exists and EPSS sits at 0.01% (2nd percentile), but the SSVC framework confirms poc-level exploitation status; the fix is available in version 1.0.1.

Technical ContextAI

The grid crate (CPE: cpe:2.3:a:becheran:grid:*:*:*:*:*:*:*:*) is a Rust library providing a two-dimensional data structure backed by a contiguous Vec<T>. The root cause is CWE-190 (Integer Overflow or Wraparound): expand_rows() computed new backing-vector lengths using unchecked arithmetic (self.data.len() + rows * self.cols), which silently wraps in Rust release builds when the multiplication or subsequent addition overflows usize. The resulting undersized allocation breaks the invariant that logical grid dimensions must match physical backing storage. For ColumnMajor grids, index computations derived from the now-incorrect total_rows produce invalid slice ranges before metadata is even updated. Finally, self.rows += rows stores the logically correct but physically unsupported row count, causing the safe get() method to invoke the unsafe get_unchecked() with an out-of-bounds index - violating Rust's memory safety guarantees even in entirely #[forbid(unsafe_code)] consumer code. The fix in v1.0.1 replaces all four affected arithmetic sites (expand_rows, expand_cols, prepend_rows, prepend_cols) with checked_add/checked_mul helpers that panic on overflow, preserving grid integrity.

RemediationAI

Upgrade the grid crate dependency to version 1.0.1 or later by updating Cargo.toml to specify grid = "1.0.1" and running cargo update to lock the dependency. The fix is available via the GitHub release at https://github.com/becheran/grid/releases/tag/v1.0.1 and the fixing commit at https://github.com/becheran/grid/commit/be213bd3528727148bef2d523c89e95d1fd9c072. If an immediate upgrade is not possible, add application-level bounds validation before any call to expand_rows(), expand_cols(), prepend_rows(), or prepend_cols() - specifically, verify that the requested dimension count does not cause rows.checked_mul(self.cols) or self.data.len().checked_add(product) to return None before passing user-controlled values to the library. This workaround requires auditing every call site and carries the risk of missed locations; it should be treated as temporary only.

Share

CVE-2026-42199 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy