Insufficient validation of untrusted input in Dawn (CVE-2026-17651)
Dawn's OpenGLES backend creates an EGL context without the hardened ANGLE attribute, so ANGLE's large-variable size validation is skipped. A web page can submit a WebGPU shader with a storage buffer block close to 4GB, which Tint accepts and forwards to the native Android GLES vendor compiler, potentially causing integer overflow or memory corruption in the driver.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: Dawn's OpenGLES backend creates its EGL context without requesting a hardened ANGLE context, which disables ANGLE's large-variable size validation checks. This allows Tint-generated storage buffer blocks up to 4GB to pass validation and reach the native Android GLES vendor shader compiler, potentially triggering integer-overflow or memory corruption vulnerabilities.
Affected files:
third_party/dawn/src/dawn/native/opengl/ContextEGL.cppthird_party/dawn/src/tint/lang/wgsl/resolver/resolver.cc
Estimated timestamp from git blame: 2026-01-13
Root Cause Analysis
In third_party/dawn/src/dawn/native/opengl/ContextEGL.cpp, Dawn's OpenGLES backend creates its EGL context via egl.CreateContext without specifying either the EGL_CONTEXT_HARDENED_ANGLE or EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE attributes:
if (egl.HasExt(EGLExt::CreateContext)) {
switch (backend) {
case wgpu::BackendType::OpenGLES:
AddAttrib(EGL_CONTEXT_MAJOR_VERSION, 3);
AddAttrib(EGL_CONTEXT_MINOR_VERSION, 1);
break;
...
}
}
Unlike Chrome's passthrough command-buffer path (which enforces context hardening), Dawn's directly created EGL context bypasses this mitigation. As a result, in ANGLE's context initialization (third_party/angle/src/libANGLE/Context.cpp), mHardenedContext remains false:
bool GetHardenedContext(const egl::AttributeMap &attribs) {
return (attribs.get(EGL_CONTEXT_HARDENED_ANGLE, EGL_FALSE) == EGL_TRUE);
}
When ANGLE compiles a shader, options.rejectWebglShadersWithLargeVariables is only set to true if context->isWebGL() || context->isHardenedContext() (third_party/angle/src/libANGLE/Shader.cpp). Because both are false on Dawn's OpenGLES context, ANGLE's variable size validation in ParseContext.cpp (checkVariableSize) is bypassed:
if (!mCompileOptions.rejectWebglShadersWithLargeVariables || numErrors() > 0 ||
(mShaderType != GL_VERTEX_SHADER && mShaderType != GL_FRAGMENT_SHADER)) {
return true; // Unconditionally bypassed for Dawn's OpenGLES context
}
Attacker-Controlled Shader Sizes (Tint 4GB Limit)
In third_party/dawn/src/tint/lang/wgsl/resolver/resolver.cc, Tint's WGSL resolver explicitly exempts storage address space arrays from the standard 65,536-element cap, validating only that the total block byte size is under 4GB:
if (auto* arr = ty->As<sem::Array>()) {
if (address_space != core::AddressSpace::kStorage) {
...
if (count.has_value() && count.value() >= internal_limits::kMaxArrayElementCount) { ... }
}
}
At shader translation time, the GLSL writer emits the literal element count inside an std430 buffer block, creating a structure that can be up to 4GB (e.g., layout(binding=0, std430) buffer f_block { mat4 inner[67108863]; } v; which translates to 4,294,967,232 bytes).
Suggested / Potential Attack Steps
Note: These are potential steps, as our tooling agent has not executed this code to verify a functional proof-of-concept.
- A web page requests a WebGPU adapter with
featureLevel: "compatibility"on Android (where Vulkan is blocklisted or unavailable), which falls back to OpenGLES. - The attacker's page submits a shader containing an exceptionally large array (e.g., ~4GB) in the
<storage>address space. - Tint verifies that the array is under 4GB and successfully translates the WGSL shader into a GLSL block with a massive literal dimension.
- Because
rejectWebglShadersWithLargeVariablesisfalse, the 4GB SSBO structure bypasses ANGLE's variable-size validation. - During
glCompileShader, ANGLE's GL backend (ShaderGL::postTranslate) forwards the translated GLSL containing the oversized block to the native Android GLES GPU vendor driver prior to link-time checks. - Delivered to a vendor driver compiler in the unsandboxed GPU process on Android, block size calculations exceeding
INT32_MAXbytes can overflow signed 32-bit integers, potentially causing memory corruption or heap buffer overflow in the driver.
Proposed Fix
Dawn's OpenGLES backend should query and pass EGL_CONTEXT_HARDENED_ANGLE during context creation inside ContextEGL.cpp when the display extension is supported, or otherwise clamp maximum shader interface variable sizes to prevent them from approaching driver integer overflow limits on non-hardened compatibility contexts.
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, Dawn's OpenGLES backend creates its EGL context without the EGL_CONTEXT_HARDENED_ANGLE attribute, so ANGLE treats the context as non-hardened and skips its large-variable validation.
Impact
A malicious web page could potentially trigger integer overflow or memory corruption in the Android GLES vendor driver, though the report notes the steps are potential and were not executed.
What the attacker needed
Android device without Vulkan or with Vulkan blocklisted; Victim visits a malicious web page; WebGPU compatibility feature level available
The fix
Dawn's OpenGLES backend should request EGL_CONTEXT_HARDENED_ANGLE when creating the context, or clamp maximum shader interface variable sizes.
How it was found
- A web page requests a WebGPU adapter with compatibility feature level on Android, falling back to OpenGLES.
- The page submits a shader with an exceptionally large array in the storage address space.
- Tint accepts the array because it is under 4GB and translates it into a GLSL block with a huge literal dimension.
- ANGLE's variable-size validation is skipped because the context is not hardened.
- During shader compilation, ANGLE forwards the oversized GLSL block to the native Android GLES vendor driver.
- The vendor driver may overflow a signed 32-bit integer when calculating the block size, potentially causing memory corruption.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
WebGPU lets web pages run small programs called shaders on the graphics card. Before the shader reaches the graphics driver, a component called ANGLE normally checks that variables are not too large. Here that check was switched off for one code path, so a page could send an enormous shader that the driver might mishandle.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.