Insufficient validation of untrusted input in Dawn (CVE-2026-17867)
A validation function for storage texture bindings in Dawn omitted the dimension-match check that its sampled-texture counterpart enforces, so a texture view whose dimension differs from the parent texture's compatibility binding view dimension could be bound. On the OpenGL/GLES backend this could bind a cube-map texture to an image unit used as a 2D array, which the specification leaves undefined and which could cause driver-level out-of-bounds memory access or a GPU process crash.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 55 days
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: A validation omission in Dawn's storage texture binding validation potentially allows texture views with dimensions mismatching their compatibility view dimension to be bound. In compatibility mode on the OpenGL/GLES backend, this can lead to type mismatches during GL image binding, resulting in driver-level undefined behavior and potential GPU out-of-bounds memory access.
Affected files:
third_party/dawn/src/dawn/native/BindGroup.cpp
Estimated timestamp from git blame: 2023-11-06
Technical Details
In WebGPU compatibility mode (such as on the OpenGL/GLES backend), DeviceBase::HasFlexibleTextureViews() returns false. This requires that the dimension of a texture view used in a bind group match the resolved compatibility texture binding view dimension of its parent texture.
While ValidateSampledTextureBinding (third_party/dawn/src/dawn/native/BindGroup.cpp:238-245) strictly validates this dimension-match condition:
if (!device->HasFlexibleTextureViews()) {
DAWN_INVALID_IF(
view->GetDimension() != texture->GetCompatibilityTextureBindingViewDimension(),
"Dimension (%s) of %s must match textureBindingViewDimension (%s) of "
"%s in compatibility mode.",
view->GetDimension(), view, texture->GetCompatibilityTextureBindingViewDimension(),
texture);
DAWN_TRY(ValidateCompatibilityModeTextureViewArrayLayer(device, view, texture));
}
the companion function ValidateStorageTextureBinding (third_party/dawn/src/dawn/native/BindGroup.cpp:311-314) only invokes ValidateCompatibilityModeTextureViewArrayLayer and completely omits the GetCompatibilityTextureBindingViewDimension matching check:
if (!device->HasFlexibleTextureViews()) {
DAWN_TRY(ValidateCompatibilityModeTextureViewArrayLayer(device, view, texture));
}
Potential Impact and Mechanism
On the OpenGL backend, texture targets are determined by the compatibility texture binding view dimension during creation. When a texture view is created in compatibility mode, RequiresCreatingNewTextureView (third_party/dawn/src/dawn/native/opengl/TextureGL.cpp:85-87) always returns false, causing the view to reuse the parent texture's underlying GL handle.
An attacker could potentially exploit this validation omission via the following steps:
- Create a 2D texture with 6 array layers,
usage = GPUTextureUsage.STORAGE_BINDING, andtextureBindingViewDimension = 'cube'. This results in the allocation of a physicalGL_TEXTURE_CUBE_MAPresource. - Create a texture view with
dimension = '2d-array'andarrayLayerCount = 6. This view reuses the underlyingGL_TEXTURE_CUBE_MAPhandle. - Create a bind group with a storage texture entry expecting a
2d-arrayview, passing the above view. This bypasses validation because of the missing check inValidateStorageTextureBinding. - Execute a compute shader that accesses the resource as
texture_storage_2d_array(image2DArrayin GLES GLSL).
When dispatching commands, CommandBufferGL.cpp:497-500 invokes BindImageTexture to bind the physical GL_TEXTURE_CUBE_MAP texture to an image unit that the shader executes operations against using image2DArray instructions. Per OpenGL ES 3.1 Specification (§8.22), binding mismatching texture targets to image uniforms results in undefined instruction execution. On unhardened GPU drivers, this could potentially lead to out-of-bounds memory writes or a GPU process crash.
Note: These steps are suggested based on static code analysis. Our tooling does not currently support running dynamic execution to provide a working proof-of-concept.
Suggested Fix
To fix this vulnerability, add the missing dimension-match validation check to ValidateStorageTextureBinding in third_party/dawn/src/dawn/native/BindGroup.cpp to ensure parity with ValidateSampledTextureBinding:
if (!device->HasFlexibleTextureViews()) {
DAWN_INVALID_IF(
view->GetDimension() != texture->GetCompatibilityTextureBindingViewDimension(),
"Dimension (%s) of %s must match textureBindingViewDimension (%s) of "
"%s in compatibility mode.",
view->GetDimension(), view, texture->GetCompatibilityTextureBindingViewDimension(),
texture);
DAWN_TRY(ValidateCompatibilityModeTextureViewArrayLayer(device, view, texture));
}
Evaluated with Chrome root at commit: e9507a33bb4148ee071aaaf8a7e9ad68770359bf
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 the storage-texture binding validation path was not updated alongside the sampled-texture path, so it lacks the compatibility-mode dimension-match check and only validates array layers.
Impact
On unhardened GPU drivers this could lead to out-of-bounds memory writes or a GPU process crash; the report notes the steps come from static analysis and no working proof-of-concept was run.
What the attacker needed
WebGPU compatibility mode; OpenGL/GLES backend; unhardened GPU driver
The fix
The missing dimension-match check should be added to the storage texture binding validation so it matches the sampled texture path.
How it was found
- Create a 2D texture with six array layers, storage binding usage and a cube compatibility binding view dimension, which allocates a cube-map GL resource.
- Create a 2D-array texture view over that texture, which reuses the parent's GL handle.
- Create a bind group with a storage texture entry expecting a 2D-array view and pass the mismatched view, which passes validation.
- Run a compute shader that accesses the resource as a 2D array storage texture, causing the cube-map texture to be bound to an image unit.
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 a program describe how a texture should be read, and the browser library Dawn checks those descriptions before handing them to the graphics driver. One check was missing for textures used as writable storage, so a mismatched description could reach the driver. Drivers assume the description is correct, so a wrong one can make them misbehave, in the worst case reading or writing memory they should not.
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.