Integer overflow in Dawn (CVE-2026-10921)
An integer overflow in Dawn's command processing allows a 4GB debug marker string to desynchronise the command iterator, causing attacker-controlled data to be interpreted as command IDs. This can lead to control-flow hijacking and potential remote code execution in the GPU process.
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. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the security team.
Overview: An integer overflow exists in Dawn's command processing when handling large debug marker strings. By supplying a string of length 0xFFFFFFFF, an attacker can desynchronize the command iterator. This causes the execution loop to interpret attacker-controlled string data as command IDs, triggering an unreachable code path that can be leveraged for Remote Code Execution.
Affected files:
third_party/dawn/src/dawn/native/Commands.cppthird_party/dawn/src/dawn/native/d3d12/CommandBufferD3D12.cppthird_party/dawn/src/dawn/native/vulkan/CommandBufferVk.cppthird_party/dawn/src/dawn/native/CommandAllocator.hthird_party/dawn/src/dawn/native/Commands.h
Estimated timestamp from git blame: 2025-11-17
Description
A potential integer overflow vulnerability exists in Dawn's handling of debug marker and group wire messages (e.g., CommandEncoderInsertDebugMarker). This vulnerability can be triggered to corrupt the command stream iterator and execute attacker-controlled data as a function pointer jump, leading to potential Remote Code Execution (RCE) in the GPU process.
When a large string is provided to AddNullTerminatedString (in third_party/dawn/src/dawn/native/Commands.cpp), the string's length is explicitly cast and stored in a 32-bit integer: cmd->length = static_cast<uint32_t>(view.length());. However, the memory allocation uses 64-bit arithmetic: allocator->AllocateData<char>(view.length() + 1);.
If an attacker supplies a string of exactly 0xFFFFFFFF (4GB) non-NUL bytes, the 4GB block is successfully allocated and populated. Later, when the backend command execution loops (e.g., in CommandBufferD3D12::RecordComputePass or FreeCommands) attempt to skip this data, they call:
mCommands.NextData<char>(cmd->length + 1);
Since cmd->length is a uint32_t (0xFFFFFFFF), the addition of 1 causes a 32-bit integer overflow, resulting in 0. Consequently, NextData<char>(0) is called. The command iterator consumes the internal kAdditionalData marker but advances its internal pointer by 0 bytes, failing to skip the 4GB string data.
On the next iteration, the command loop reads the next 4 bytes to determine the next Command ID. Because the pointer was not advanced, it reads directly from the attacker-controlled string data. The resulting invalid command ID falls through to the default: case in the execution loop's switch statement, which calls DAWN_UNREACHABLE().
In standard Chromium release builds, DAWN_UNREACHABLE() expands to __builtin_unreachable(). Compilers (like Clang) use this as a hint to elide bounds checks on switch jump tables. As a result, the attacker-controlled command ID is used as an out-of-bounds index for the jump table, enabling control-flow hijacking.
Potential Attacker Steps
Note: Our tooling does not yet have the ability to run code, so these are theoretical steps an attacker might follow based on code analysis.
- Bypass Client Constraints: From a compromised renderer, manually construct Dawn chunked wire commands to bypass client-side buffer serializers, sending an
InsertDebugMarkercommand with a total size of0xFFFFFFFFbytes of non-NUL data. - Server Assembly: The GPU process's
ChunkedCommandHandlerallocates a 4GB buffer (which succeeds on 64-bit systems with sufficient memory) and reconstructs the chunked payload. - Command Deserialization: The Dawn wire server deserializes the
WGPUStringView, preserving the0xFFFFFFFFlength (as it is bounded byWGPU_STRLEN, which isSIZE_MAX). - Trigger Overflow: The command is recorded into the native command buffer. The string is stored, but the
lengthfield in the command struct truncates. - Execution Desync: Upon submission, the GPU process attempts to execute the command buffer. The
cmd->length + 1overflow causes the iterator to stall exactly at the attacker's payload. - Control Flow Hijack: The switch statement reads the attacker's payload as a command ID, falling through to
DAWN_UNREACHABLE(). The compiler-optimized jump table reads an out-of-bounds function pointer dictated by the attacker's fake ID, granting RCE.
Suggested Fix
- Validate String Lengths: Reject any
StringViewwith a length exceeding a reasonable upper bound (e.g., a few megabytes) early inNormalizeMessageStringor during Wire deserialization. - Use Checked Arithmetic: Modify
CommandAllocator::NextDataand iterator offset calculations to usebase::CheckedNumericto prevent overflow wrap-around. - Fix Struct Types: Change the
lengthfield in structures likeInsertDebugMarkerCmdandPushDebugGroupCmdtosize_trather thanuint32_t.
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
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
Likely a 32-bit integer overflow when adding 1 to a length field stored as uint32_t, causing the command iterator to fail to skip the string data.
Impact
An attacker could achieve remote code execution in the GPU process, but this requires a compromised renderer and sufficient memory to allocate a 4GB buffer.
What the attacker needed
Compromised renderer; 64-bit system with sufficient memory
The fix
The report suggests validating string lengths, using checked arithmetic, and changing the length field to size_t; it does not state that a fix was applied.
How it was found
- From a compromised renderer, manually construct Dawn chunked wire commands to bypass client-side buffer serializers, sending an InsertDebugMarker command with a total size of 0xFFFFFFFF bytes of non-NUL data.
- The GPU process's ChunkedCommandHandler allocates a 4GB buffer and reconstructs the chunked payload.
- The Dawn wire server deserializes the WGPUStringView, preserving the 0xFFFFFFFF length.
- The command is recorded into the native command buffer; the string is stored but the length field truncates.
- Upon submission, the GPU process attempts to execute the command buffer; the cmd->length + 1 overflow causes the iterator to stall at the attacker's payload.
- The switch statement reads the attacker's payload as a command ID, falling through to DAWN_UNREACHABLE(); the compiler-optimized jump table reads an out-of-bounds function pointer dictated by the attacker's fake ID, granting RCE.
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 helps web pages talk to the graphics card. A bug in how it handles very long text messages could let an attacker trick the program into running their own code, but only if they can already run some code on the system.
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.