Security Vulnerability Report
中文
CVE-2026-42199 CVSS 6.2 MEDIUM

CVE-2026-42199

Published: 2026-05-08 22:16:32
Last Modified: 2026-05-11 17:16:33

Description

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.

CVSS Details

CVSS Score
6.2
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

No configuration data available.

Grid >= 0.17.0, < 1.0.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC Concept for CVE-2026-42199: Integer Overflow in Grid::expand_rows // This code demonstrates the scenario leading to Undefined Behavior. use grid::Grid; fn main() { // Initialize a small grid let mut grid = Grid::new(1, 1); grid[0][0] = 42; // In vulnerable versions (< 1.0.1), passing a value that causes // integer overflow in `expand_rows` calculation breaks the internal invariant. // For example, causing the row count calculation to wrap around. let malicious_rows = usize::MAX; // The expand_rows logic fails to check for overflow, // corrupting the relationship between logical size and backing storage. // Note: Actual trigger depends on internal implementation details. // This simulates the condition described in the advisory. // Hypothetical exploitation: // grid.expand_rows(malicious_rows); // After corruption, a standard safe call might invoke get_unchecked with invalid index. match grid.get(0, 0) { Some(val) => println!("Value: {}", val), None => println!("Access failed or crashed due to UB"), } }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42199", "sourceIdentifier": "[email protected]", "published": "2026-05-08T22:16:31.547", "lastModified": "2026-05-11T17:16:32.650", "vulnStatus": "Received", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 6.2, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-190"}]}], "references": [{"url": "https://github.com/becheran/grid/commit/be213bd3528727148bef2d523c89e95d1fd9c072", "source": "[email protected]"}, {"url": "https://github.com/becheran/grid/releases/tag/v1.0.1", "source": "[email protected]"}, {"url": "https://github.com/becheran/grid/security/advisories/GHSA-38c5-483c-4qqp", "source": "[email protected]"}, {"url": "https://github.com/becheran/grid/security/advisories/GHSA-38c5-483c-4qqp", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"}]}}