Out of bounds read in Dawn (CVE-2026-10927)
A logic error in Dawn's command stream handling allows a compromised renderer to cause a command iterator desync in the GPU process by sending a WriteBuffer command with size zero, leaving an unconsumed marker. This can lead to undefined behaviour and potential remote code execution via type confusion in the D3D12, Metal, and OpenGL backends.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 58 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 without the security team.
Overview: A logic error in Dawn's command stream handling allows a compromised renderer to cause a command iterator desync in the GPU process. By sending a WriteBuffer command with a size of zero, an unconsumed marker is left in the stream, leading to undefined behavior and potential Remote Code Execution (RCE) via type confusion in the D3D12, Metal, and OpenGL backends.
Affected files:
third_party/dawn/src/dawn/native/d3d12/CommandBufferD3D12.cppthird_party/dawn/src/dawn/native/metal/CommandBufferMTL.mmthird_party/dawn/src/dawn/native/opengl/CommandBufferGL.cppthird_party/dawn/src/dawn/native/CommandEncoder.cppthird_party/dawn/src/dawn/native/CommandAllocator.h
Estimated timestamp from git blame: 2025-12-30
Summary
A vulnerability in Dawn's command stream handling allows a compromised renderer to cause a command iterator desync in the GPU process. When CommandEncoder.WriteBuffer is called with a size of 0, an internal kAdditionalData marker is written to the command stream but is not properly consumed by the D3D12, Metal, and OpenGL backends during execution. This causes the next iteration of the command loop to interpret the marker as a command ID, triggering a DAWN_UNREACHABLE() fallback. Due to compiler optimizations on undefined behavior, this can deterministically redirect execution to a valid command handler, leading to type confusion, arbitrary pointer dereference, and potential Remote Code Execution (RCE).
Technical Details
When a renderer sends a CommandEncoderWriteBuffer command with size == 0 over the WebGPU wire protocol, the following sequence occurs:
- Encoding: In
CommandEncoder::APIWriteBuffer(CommandEncoder.cpp), the encoder callsallocator->AllocateData<uint8_t>(0). This helper unconditionally writes a 4-byte marker (detail::kAdditionalData/0xFFFFFFFE) into the native command stream, even when the size is 0. - Validation:
ValidateWriteBufferallows a size of 0 as it is a valid WebGPU operation. - Backend Execution Flaw: During command recording in the D3D12 (
CommandBufferD3D12.cpp), Metal (CommandBufferMTL.mm), and OpenGL (CommandBufferGL.cpp) backends, the loop encounters theWriteBuffercommand. The code checksif (size == 0)and executescontinue;. This critically skips the call tomCommands.NextData<uint8_t>(size), failing to consume thekAdditionalDatamarker from the stream. - Desynchronization: On the next iteration of the
while (mCommands.NextCommandId(&type))loop, the iterator reads the unconsumed0xFFFFFFFEmarker as the next command ID. In the C++Commandenum, this value is interpreted as-2. - Undefined Behavior: The
switch (type)statement does not have a case for-2and falls to thedefaultcase, which callsDAWN_UNREACHABLE(). In release builds, this macro expands to__builtin_unreachable()or__assume(false). - Exploitation via Optimization: Because
__builtin_unreachable()tells the compiler the path is impossible, the compiler optimizes the sparseswitchstatement (e.g., jump tables) without bounds checks. Executing-2through this optimized switch deterministically forces execution into a valid, attacker-selected command case (e.g.,Command::BeginRenderPass). - Type Confusion & RCE: The incorrectly reached handler calls
NextCommand<BeginRenderPassCmd>(). BecauseBeginRenderPassCmdis 8-byte aligned, the internalAlignPtrskips the 4-byte ID of the actual next command in the stream. The iterator lands perfectly on the attacker-controlled data payload of the next command (e.g.,SetImmediatesdata). This raw data is interpreted as theBeginRenderPassCmdstruct, which contains unprotected raw pointers insideRef<T>members. Dereferencing these forged pointers during execution leads to vtable hijacking and immediate RCE in the GPU process.
Note: The Vulkan backend is partially protected because its default case uses break instead of DAWN_UNREACHABLE(), and D3D11 is protected because it explicitly returns an error.
Potential Reproduction Steps
Please note these are suggested steps, as we do not have a working Proof of Concept.
- From a compromised renderer, serialize a
CommandEncoderWriteBufferwire command withsize=0. - Immediately follow this command in the wire stream with a command that accepts arbitrary data (e.g.,
RenderPassEncoderSetImmediates). - Structure the arbitrary data payload to perfectly mimic a Dawn command struct (e.g.,
BeginRenderPassCmd), containing a forgedRef<AttachmentState>pointer targeting a fake vtable in renderer-sprayed memory. - Submit the command buffer. The GPU process will hit
DAWN_UNREACHABLE(), desync, parse the fake struct, dereference the forged pointer, and execute the ROP chain.
Suggested Fix
Remove the early continue in the backend execution loops for WriteBuffer. The marker must be consumed regardless of the data size.
Change the backend implementations (D3D12, Metal, OpenGL) from:
if (size == 0) {
continue;
}
Buffer* dstBuffer = ToBackend(write->buffer.Get());
uint8_t* data = mCommands.NextData<uint8_t>(size);
To:
uint8_t* data = mCommands.NextData<uint8_t>(size);
if (size == 0) {
continue;
}
Buffer* dstBuffer = ToBackend(write->buffer.Get());
Additionally, the helper SkipCommand in Commands.cpp:423 shares this bug and should be similarly fixed.
Evaluated with Chrome root at commit: f200f57a19490707ff8bc7aa5de3cbc443a3afad
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. 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
The backend execution loops skip consuming the additional data marker when the WriteBuffer size is zero, causing the command iterator to desynchronise.
Impact
A compromised renderer could potentially achieve remote code execution in the GPU process on the D3D12, Metal, and OpenGL backends, though the Vulkan and D3D11 backends are protected.
What the attacker needed
Compromised renderer
The fix
The early continue in the backend execution loops for WriteBuffer should be removed so the marker is consumed regardless of data size, and the SkipCommand helper should be similarly fixed.
How it was found
- From a compromised renderer, serialize a CommandEncoderWriteBuffer wire command with size=0.
- Immediately follow this command in the wire stream with a command that accepts arbitrary data (e.g., RenderPassEncoderSetImmediates).
- Structure the arbitrary data payload to mimic a Dawn command struct (e.g., BeginRenderPassCmd) with a forged Ref<AttachmentState> pointer targeting a fake vtable.
- Submit the command buffer, causing the GPU process to hit DAWN_UNREACHABLE(), desync, parse the fake struct, dereference the forged pointer, and execute the ROP chain.
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.
Dawn is a component that translates WebGPU commands into native graphics API calls. When a command with size zero is sent, a marker is left in the command stream, and the GPU process misinterprets it as a new command, potentially allowing an attacker to execute arbitrary code.
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.