Skip to content
Memory corruption Advisory Advanced CVE-2026-10927

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.cpp
  • third_party/dawn/src/dawn/native/metal/CommandBufferMTL.mm
  • third_party/dawn/src/dawn/native/opengl/CommandBufferGL.cpp
  • third_party/dawn/src/dawn/native/CommandEncoder.cpp
  • third_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:

  1. Encoding: In CommandEncoder::APIWriteBuffer (CommandEncoder.cpp), the encoder calls allocator->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.
  2. Validation: ValidateWriteBuffer allows a size of 0 as it is a valid WebGPU operation.
  3. Backend Execution Flaw: During command recording in the D3D12 (CommandBufferD3D12.cpp), Metal (CommandBufferMTL.mm), and OpenGL (CommandBufferGL.cpp) backends, the loop encounters the WriteBuffer command. The code checks if (size == 0) and executes continue;. This critically skips the call to mCommands.NextData<uint8_t>(size), failing to consume the kAdditionalData marker from the stream.
  4. Desynchronization: On the next iteration of the while (mCommands.NextCommandId(&type)) loop, the iterator reads the unconsumed 0xFFFFFFFE marker as the next command ID. In the C++ Command enum, this value is interpreted as -2.
  5. Undefined Behavior: The switch (type) statement does not have a case for -2 and falls to the default case, which calls DAWN_UNREACHABLE(). In release builds, this macro expands to __builtin_unreachable() or __assume(false).
  6. Exploitation via Optimization: Because __builtin_unreachable() tells the compiler the path is impossible, the compiler optimizes the sparse switch statement (e.g., jump tables) without bounds checks. Executing -2 through this optimized switch deterministically forces execution into a valid, attacker-selected command case (e.g., Command::BeginRenderPass).
  7. Type Confusion & RCE: The incorrectly reached handler calls NextCommand<BeginRenderPassCmd>(). Because BeginRenderPassCmd is 8-byte aligned, the internal AlignPtr skips 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., SetImmediates data). This raw data is interpreted as the BeginRenderPassCmd struct, which contains unprotected raw pointers inside Ref<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.

  1. From a compromised renderer, serialize a CommandEncoderWriteBuffer wire command with size=0.
  2. Immediately follow this command in the wire stream with a command that accepts arbitrary data (e.g., RenderPassEncoderSetImmediates).
  3. Structure the arbitrary data payload to perfectly mimic a Dawn command struct (e.g., BeginRenderPassCmd), containing a forged Ref<AttachmentState> pointer targeting a fake vtable in renderer-sprayed memory.
  4. 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:

C++
if (size == 0) {
    continue;
}
Buffer* dstBuffer = ToBackend(write->buffer.Get());
uint8_t* data = mCommands.NextData<uint8_t>(size);

To:

C++
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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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

  1. From a compromised renderer, serialize a CommandEncoderWriteBuffer wire command with size=0.
  2. Immediately follow this command in the wire stream with a command that accepts arbitrary data (e.g., RenderPassEncoderSetImmediates).
  3. Structure the arbitrary data payload to mimic a Dawn command struct (e.g., BeginRenderPassCmd) with a forged Ref<AttachmentState> pointer targeting a fake vtable.
  4. 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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.