Out of bounds read in Dawn (CVE-2026-11006)
Dawn's indirect draw validation mutates persistent RenderBundle command objects, so when the same bundle is used in multiple render passes, later passes overwrite the validation buffer pointers used by earlier passes. This causes the GPU to read unvalidated or uninitialised indirect draw parameters, bypassing WebGPU's security clamping and potentially leading to out-of-bounds VRAM access.
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.
Overview: Dawn's indirect draw validation pipeline incorrectly mutates persistent command objects owned by RenderBundles. If a bundle is executed in multiple render passes, later passes overwrite the validation buffer pointers used by earlier passes, leading to the GPU reading unvalidated or uninitialized indirect draw parameters. This bypasses WebGPU's security clamping and can lead to out-of-bounds VRAM access.
Affected files:
third_party/dawn/src/dawn/native/IndirectDrawValidationEncoder.cppthird_party/dawn/src/dawn/native/IndirectDrawMetadata.hthird_party/dawn/src/dawn/native/ScratchBuffer.cppthird_party/dawn/src/dawn/native/RenderBundle.cpp
Estimated timestamp from git blame: 2024-08-16
Summary
A logic flaw exists in Dawn's indirect draw validation pipeline where validation-time code mutates persistent command objects owned by RenderBundles. When an indirect draw is processed, Dawn rewrites the command's indirectBuffer and indirectOffset to point into a device-level scratch buffer that holds compute-shader-validated (clamped) parameters. However, for RenderBundles, these mutations persist across render passes. This results in state corruption that allows bypassing WebGPU's security clamping.
Technical Details
1. Persistent Mutation of RenderBundle Commands
In IndirectDrawValidationEncoder.cpp, the validation logic rewrites the indirect draw command directly in the command stream:
// IndirectDrawValidationEncoder.cpp
draw.cmd->indirectBuffer = outputParamsBuffer.GetBuffer();
draw.cmd->indirectOffset = outputParamsOffset;
The draw.cmd pointer is a raw_ptr that points into the command stream baked into a RenderBundle (RenderBundleBase::mCommands). Unlike a RenderPassEncoder where the command stream is transient, a RenderBundle's command stream persists until the bundle is destroyed.
2. Cross-Draw Parameter Confusion and Uninitialized VRAM Access
When a CommandEncoder encodes multiple render passes that use the same RenderBundle, the following occurs:
- Pass 1: Validation code mutates the bundle's
DrawIndirectCmdto point to the current scratch buffer at Offset A. Pass 1's compute shader is recorded to write clamped parameters to this location. - Pass 2: Validation code runs again. If Pass 2 requires more validation space,
ScratchBuffer::EnsureCapacityreallocates the scratch buffer. It explicitly callsmBuffer->SetInitialized(true), suppressing Dawn's lazy-clearing mechanism. The new scratch buffer contains uninitialized VRAM. - Pass 2 Mutation: Validation code mutates the same
DrawIndirectCmdin the bundle to point to the new scratch buffer at Offset B.
When the CommandBuffer is submitted to the GPU:
- Pass 1's compute shader writes clamped parameters to the old scratch buffer.
- Pass 1's render pass executes the bundle. However, the bundle's
DrawIndirectCmdnow points to the new scratch buffer at Offset B. - The GPU reads uninitialized, unvalidated VRAM from the new scratch buffer and uses it as the
vertexCount,instanceCount, etc.
Impact
An attacker can trigger out-of-bounds GPU memory access from the sandboxed GPU process. By bypassing WebGPU's indirect draw security clamping, the attacker can cause the GPU to read or write arbitrary VRAM, potentially leaking cross-origin data or triggering driver-level vulnerabilities.
Suggested Steps to Trigger
(Note: These are potential steps as our setup cannot run code)
- Create a
RenderBundlecontaining anindirectDrawcommand. - Create a
CommandEncoder. - Begin a
RenderPassEncoder(Pass 1). CallexecuteBundles()with the created bundle. End Pass 1. - Begin a second
RenderPassEncoder(Pass 2). Encode additional indirect draws to force the scratch buffer to grow and reallocate. CallexecuteBundles()with the same bundle. End Pass 2. - Call
finish()on theCommandEncoderandsubmit()the resulting command buffer to the queue. - Pass 1 will execute using the uninitialized scratch buffer allocated during Pass 2's validation, using unvalidated parameters for its draw call.
Suggested Fix
Do not mutate DrawIndirectCmd or MultiDrawIndirectCmd objects within a RenderBundle's persistent command stream. Instead, maintain a side-table in the per-pass state that maps bundle commands to their validated scratch buffer and offset, and have the backend apply these validated parameters dynamically during bundle execution. Alternatively, RenderBundles may need their own dedicated, immutable validation buffers that are updated by the compute shader prior to execution.
Evaluated with Chrome root at commit: 9760e6c70cd33a320713361f17c6dcca85648c0f
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. Please feel free to reach out to me if you have concerns or feedback.
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 validation code mutates persistent command objects inside RenderBundles instead of using per-pass state, so reusing a bundle across passes corrupts the validation buffer pointers.
Impact
An attacker could trigger out-of-bounds GPU memory access from the sandboxed GPU process, potentially leaking cross-origin data or triggering driver-level vulnerabilities.
What the attacker needed
Ability to run WebGPU code in a browser; crafted WebGPU commands
The fix
The validation code should not mutate DrawIndirectCmd or MultiDrawIndirectCmd objects in a RenderBundle's persistent command stream; instead it should use a per-pass side-table or dedicated immutable validation buffers.
How it was found
- Create a RenderBundle containing an indirectDraw command.
- Create a CommandEncoder.
- Begin a RenderPassEncoder (Pass 1), execute the bundle, and end Pass 1.
- Begin a second RenderPassEncoder (Pass 2), encode additional indirect draws to force the scratch buffer to grow and reallocate, execute the same bundle, and end Pass 2.
- Finish the CommandEncoder and submit the command buffer to the queue.
- Pass 1 executes using the uninitialised scratch buffer allocated during Pass 2's validation.
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 is a browser API for graphics. Dawn is its implementation. Indirect draws let the GPU read draw parameters from memory. Dawn normally clamps these values for safety. A bug in how it validates draws inside reusable command bundles means that when the same bundle is used twice, the second use can make the first use read uninitialised memory, which could let an attacker access 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.