Security Vulnerability Report
中文
CVE-2026-40393 CVSS 8.1 HIGH

CVE-2026-40393

Published: 2026-04-12 19:16:21
Last Modified: 2026-04-16 16:17:07

Description

In Mesa before 25.3.6 and 26 before 26.0.1, out-of-bounds memory access can occur in WebGPU because the amount of to-be-allocated data depends on an untrusted party, and is then used for alloca.

CVSS Details

CVSS Score
8.1
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:mesa3d:mesa:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:mesa3d:mesa:26.0.0:*:*:*:*:*:*:* - VULNERABLE
Mesa < 25.3.6
Mesa 26 < 26.0.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#include <stdio.h> #include <stdlib.h> // Simulated vulnerable function in Mesa WebGPU void vulnerable_webgpu_handler(unsigned int untrusted_size) { // FLAW: The size is controlled by an untrusted party (attacker) // and used directly in alloca(), causing stack overflow/OOB. // If untrusted_size is very large, it crashes or overwrites stack. char *buffer = (char *)alloca(untrusted_size); // Use the buffer... for(int i = 0; i < untrusted_size; i++) { buffer[i] = 'A'; } } int main() { printf("PoC for CVE-2026-40393: Mesa WebGPU OOB via alloca\n"); // Simulate sending a malicious large size from an untrusted web context unsigned int malicious_size = 0xFFFFFFFF; // Or a size specifically crafted to jump over guard pages vulnerable_webgpu_handler(malicious_size); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40393", "sourceIdentifier": "[email protected]", "published": "2026-04-12T19:16:20.797", "lastModified": "2026-04-16T16:17:06.870", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In Mesa before 25.3.6 and 26 before 26.0.1, out-of-bounds memory access can occur in WebGPU because the amount of to-be-allocated data depends on an untrusted party, and is then used for alloca."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 5.9}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:mesa3d:mesa:*:*:*:*:*:*:*:*", "versionEndExcluding": "25.3.6", "matchCriteriaId": "89D70296-F399-4480-B0DE-63B0B30626E3"}, {"vulnerable": true, "criteria": "cpe:2.3:a:mesa3d:mesa:26.0.0:*:*:*:*:*:*:*", "matchCriteriaId": "0AA825BC-1256-4D8E-96E1-3E67CC9867EB"}]}]}], "references": [{"url": "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39866", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://lists.freedesktop.org/archives/mesa-dev/2026-February/226597.html", "source": "[email protected]", "tags": ["Issue Tracking", "Mailing List"]}]}}