Out of bounds read and write in Dawn (CVE-2026-14420)
Dawn's OpenGL backend builds a buffer-size lookup table without filtering by shader stage, while the binding remapper does filter. This lets an inactive storage buffer's size index overwrite an active buffer's entry, so robustness clamping for the active buffer uses the wrong (larger) size, potentially allowing out-of-bounds reads and writes on GPU memory.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 35 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 potential logic flaw in Dawn's OpenGL/GLES backend stage-filtering can cause a mapping collision during Tint's compilation phase. This mismatch allows an inactive shader storage buffer's size lookup configuration to overwrite an active buffer's configuration, potentially causing robustness checks to use an incorrect (larger) buffer size. An attacker could exploit this behavior to perform out-of-bounds memory reads and writes on storage buffers.
Affected files:
third_party/dawn/src/dawn/native/opengl/ShaderModuleGL.cppthird_party/dawn/src/tint/lang/glsl/writer/raise/raise.cc
Estimated timestamp from git blame: 2025-04-10
Description
There is a potential stage-filtering inconsistency in Dawn's OpenGL backend during the translation of WGSL to GLSL. When generating the layout metadata for shader compilation, Dawn constructs remapping tables and uniform-based array length tables. However, the logic that populates these tables handles stage-visibility differently:
-
Active Binding Remapping:
GenerateBindingRemapping(defined inthird_party/dawn/src/dawn/native/TintUtils.h) correctly checks stage-visibility usingStageBit(stage). Non-stage-visible bindings are skipped:C++ for (const auto& [bindingNumber, apiBindingIndex] : bgl->GetBindingMap()) { if (!(bgl->GetAPIBindingInfo(apiBindingIndex).visibility & StageBit(stage))) { continue; } -
Array Length Uniform Options:
GenerateArrayLengthFromuniformData(defined inthird_party/dawn/src/dawn/native/opengl/ShaderModuleGL.cpp) does not check stage-visibility. It populatesbindpoint_to_size_indexfor all storage buffers declared in the pipeline layout, regardless of whether they are active or visible in the current stage:C++ for (BindingIndex binding : bgl->GetBufferIndices()) { const BindingInfo& bindingInfo = bgl->GetBindingInfo(binding); switch (std::get<BufferBindingInfo>(bindingInfo.bindingLayout).type) { case wgpu::BufferBindingType::Storage: // ... tint::BindingPoint srcBindingPoint = {uint32_t(group), uint32_t(bindingInfo.binding)}; options.bindpoint_to_size_index.emplace(srcBindingPoint, uint32_t(ssboIndex));
Potential Exploit Mechanism
An attacker could potentially configure a pipeline layout containing:
- Buffer A (inactive in the compute stage) at Bind Group
0, BindingN(pre-remap:{0, N}). - Buffer B (active in the compute stage) at Bind Group
1, BindingM(pre-remap:{1, M}).
During compilation of a compute shader that only utilizes Buffer B:
-
Remapping Stage:
GenerateBindingRemappingfilters out Buffer A. It remaps Buffer B from{1, M}to a flat 1D binding point (e.g.,{0, N}). Consequently, the remapper data used by Tint (remapper_data) maps{1, M} -> {0, N}. It contains no entries for Buffer A's original binding point{0, N}. -
Array Length Options Stage:
GenerateArrayLengthFromuniformDatapopulates options for both buffers:{1, M} -> index_B(for Buffer B){0, N} -> index_A(for Buffer A)
-
Map Collision in Tint: During Tint's raise phase in
third_party/dawn/src/tint/lang/glsl/writer/raise/raise.cc, Tint resolves the pre-remapped keys ofbindpoint_to_size_indexto their post-remapped targets to build a finalsize_indicesmap:C++ std::unordered_map<BindingPoint, uint32_t> size_indices; for (auto& pair : options.array_length_from_uniform.bindpoint_to_size_index) { auto& bp = pair.first; auto& index = pair.second; where = remapper_data.find(bp); if (where != remapper_data.end()) { size_indices[where->second] = index; } else { size_indices[bp] = index; } }- When processing Buffer B (
{1, M}), Tint resolves it viaremapper_datato{0, N}and setssize_indices[{0, N}] = index_B. - When processing Buffer A (
{0, N}), Tint does not find it inremapper_dataand falls back to theelseblock, settingsize_indices[{0, N}] = index_A. - This causes a key collision inside the
std::unordered_map. Buffer A's entry overwrites Buffer B's size index configuration, setting it toindex_Ainstead ofindex_B.
- When processing Buffer B (
-
Robustness Bypass: When Tint substitutes
.length()calls or injects robustness-clamping bound checks for Buffer B (binding point{0, N}), it retrieves the size fromindex_A(the index corresponding to Buffer A). If the attacker binds a very large buffer to Buffer A and a small buffer to Buffer B, the runtime clamping checks for Buffer B will clamp against the size of Buffer A, allowing out-of-bounds reads and writes on the memory backing Buffer B.
Note: These steps are based on static code analysis; our tooling does not currently have the environment or capability to run a live dynamic Proof-of-Concept to verify execution.
Impact
This flaw allows a shader to bypass WebGPU/Tint's software robustness safety guarantees. On GLES backends (such as older Android devices with PowerVR or Nvidia GPUs), the GPU process is typically unsandboxed, potentially allowing GPU memory corruption or sandbox escape.
Suggested Fix
Modify GenerateArrayLengthFromuniformData in third_party/dawn/src/dawn/native/opengl/ShaderModuleGL.cpp to filter out storage buffers that are not visible to the shader stage currently being compiled, matching the visibility filter used in GenerateBindingRemapping:
for (BindingIndex binding : bgl->GetBufferIndices()) {
const BindingInfo& bindingInfo = bgl->GetBindingInfo(binding);
if (!(bindingInfo.visibility & StageBit(stage))) {
continue;
}
// ...
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 the array-length uniform table is populated for every storage buffer in the pipeline layout without the stage-visibility filter that the binding remapper applies, so a remapped active binding collides with an inactive binding's key in Tint's size-index map.
Impact
A shader could bypass the software robustness checks and cause out-of-bounds reads and writes on GPU memory; on GLES backends such as older Android devices the GPU process is typically unsandboxed, potentially allowing memory corruption or sandbox escape, though the report notes this comes from static analysis without a live proof of concept.
What the attacker needed
Ability to submit WebGPU shaders; GLES backend (e.g. older Android GPU); no live PoC was built
The fix
The array-length uniform generation should skip storage buffers that are not visible to the stage being compiled, matching the filter already used in the binding remapper.
How it was found
- Create a pipeline layout with an inactive storage buffer at one bind group and binding, and an active storage buffer at a different bind group and binding.
- Compile a compute shader that uses only the active buffer, so the remapper flattens its binding point onto the inactive buffer's coordinates.
- Let Tint resolve the size-index map, where the inactive buffer's entry overwrites the active buffer's entry.
- Bind a large buffer to the inactive slot and a small one to the active slot so the clamping check for the active buffer uses the larger size.
- Perform accesses past the end of the small buffer to read or write out of bounds.
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.
A shader is a small program that runs on the graphics card. WebGPU tries to keep shaders safe by checking every memory access against the buffer's real size, so a shader cannot read or write past the end. Here two pieces of code disagree about which buffers count for a given shader stage, so the safety check ends up comparing against the wrong buffer's size and the limit can be too generous.
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.