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 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Control grid dimension input
  2. Delivery
    Supply near-usize::MAX row count to expand_rows()
  3. Exploit
    Overflow wraps backing-vector resize to undersized allocation
  4. Install
    Logical row metadata updated to full value
  5. C2
    Invoke safe get() on corrupted grid
  6. Execute
    get_unchecked() called with invalid index
  7. Impact
    UB triggers process crash (SIGSEGV/illegal instruction)

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The vulnerability triggers when: (1) the target application links the grid crate at version 0.17.0 through 1.0.0 compiled in release mode - debug builds panic on integer overflow before corruption occurs; and (2) an attacker-controlled value can flow into the rows or cols parameter of Grid::expand_rows(), Grid::expand_cols(), Grid::prepend_rows(), or Grid::prepend_cols(). Exploitation is limited by the application-specific data path required to reach these methods with near-usize::MAX arguments, the fact that debug builds are immune due to Rust's default overflow panics, and the SSVC 'Automatable: no' finding confirming that mass automated exploitation is not feasible without knowledge of the target application's internal data flow. No special OS privileges are required to trigger the overflow in a running process.

Impact

Real-world risk is moderate-to-low. The CVSS base score of 6.2 (AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) characterizes this as a local availability impact: an attacker or malicious input must reach expand_rows() with a near-maximal usize argument, which depends entirely on how the consuming application exposes this API to external data. EPSS at 0.01% (2nd percentile) confirms that widespread automated exploitation is not observed. The SSVC assessment of Exploitation:poc, Automatable:no, Technical Impact:partial aligns with a vulnerability that has a working PoC but requires application-specific data-flow conditions to trigger. No CISA KEV listing exists. The primary confirmed impact is a process crash (denial of service) in Rust applications that pass externally influenced values to grid expansion methods; arbitrary code execution via undefined behavior is theoretically possible but not independently confirmed beyond Miri output. Applications using grid for user-supplied dimension data in release builds should treat this as a real priority upgrade.

Exploit ScenarioDerived

An attacker who can influence the number of rows passed to grid.expand_rows() - for example through a network API or file format that specifies grid dimensions - submits a value near usize::MAX / 2. In release builds, the multiplication silently overflows, causing the backing vector to be undersized while the logical row count is updated to the full value. A subsequent call to grid.get(0, 0) from safe code then invokes get_unchecked with an invalid index, producing undefined behavior that manifests as a SIGSEGV or illegal instruction trap; a public PoC demonstrating this exact three-line flow is included in GHSA-38c5-483c-4qqp and was confirmed by Miri.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 23, 2026

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.

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.

Affected VersionsENISA

Grid 0.17.0, < 1.0.1

Affected Packages

cargo grid fix: 1.0.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in cargo

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when Grid gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) 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 Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

2
Patch available
May 08, 2026 - 23:18 EUVD
CVE Published
May 08, 2026 - 21:15 nvd
MEDIUM 6.2

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 98% exploitable
Prevalence
Low
niche Rust data structure library, limited production footprint
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

31
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +31
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

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