Insufficient validation of untrusted input in Dawn (CVE-2026-10968)
A state machine flaw in Dawn's BufferBase::Unmap allows a buffer in the SharedMemoryNoAccess state to incorrectly transition to Unmapped, bypassing validation and synchronisation. A compromised renderer could exploit this to perform unauthorised concurrent access to shared GPU resources, potentially leaking cross-origin information or causing driver-level undefined behaviour.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 24 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 Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A state machine flaw in Dawn's BufferBase::Unmap allows a buffer in the SharedMemoryNoAccess state to incorrectly transition to the Unmapped state. This bypasses state validation and synchronization logic, potentially enabling a compromised renderer to perform unauthorized concurrent access to shared GPU resources.
Affected files:
third_party/dawn/src/dawn/native/Buffer.cppthird_party/dawn/src/dawn/native/SharedResourceMemory.cppgpu/command_buffer/service/webgpu_decoder_impl.ccgpu/command_buffer/service/shared_image/d3d_image_backing.ccthird_party/dawn/src/dawn/native/d3d12/BufferD3D12.cpp
Estimated timestamp from git blame: 2025-03-25
Summary
A state machine vulnerability exists in Dawn's BufferBase::Unmap() implementation. When a buffer is in the SharedMemoryNoAccess state (typically after a Shared Image has been dissociated), the Unmap function incorrectly falls through a switch statement, resulting in an unconditional transition to the Unmapped state. This bypasses state validation and synchronization logic intended for shared resources. A compromised renderer could potentially exploit this to perform unauthorized, unbarriered concurrent access to shared GPU resources, leading to cross-origin information leaks or driver-level undefined behavior.
Vulnerability Details
In third_party/dawn/src/dawn/native/Buffer.cpp, the BufferBase::Unmap(bool forDestroy) function contains the following logic:
switch (mState.load(std::memory_order::acquire)) {
// ... other cases ...
case BufferState::Unmapped:
return {};
case BufferState::SharedMemoryNoAccess:
break;
// ... error cases ...
}
mState.store(BufferState::Unmapped, std::memory_order::release);
When the state is SharedMemoryNoAccess, the break statement causes the execution to fall through to the unconditional mState.store(BufferState::Unmapped, ...) call at the end of the function.
Normally, the SharedMemoryNoAccess state indicates that the buffer's access to shared memory has been terminated via EndAccess. Transitioning back to Unmapped (and subsequently to InUse) should only happen through BeginAccess, which enforces mutual exclusion and sets up necessary synchronization fences.
Potential Attack Scenario
A compromised renderer could potentially trigger this flaw through the following sequence of GPU command buffer operations:
- Associate Mailbox: The attacker issues an
AssociateMailboxForBufferImmediatecommand to the WebGPU decoder with a shared image mailbox. The decoder injects the buffer into the Dawn wire server, which retains a strong reference to the buffer object. - Dissociate Mailbox: The attacker sends
DissociateMailboxForBuffer. This callsEndAccesson the shared resource, which sets the buffer's state toSharedMemoryNoAccess, drains the pending synchronization fences from the buffer, and releases the mutual exclusion lock on the Shared Image. - Bypass via Unmap: The attacker sends a
BufferUnmapwire command using the server-side ID retained in Step 1. This invokesBufferBase::APIUnmap(), which hits the vulnerable fall-through inBufferBase::Unmap()and erroneously sets the buffer state toUnmapped. - Concurrent Access: The attacker queues a GPU command (e.g.,
CopyBufferToBuffer) using the buffer.ValidateCanUseOnQueueNow()succeeds because the state isUnmapped(avoiding the validation error thatSharedMemoryNoAccesswould trigger). - Synchronization Bypass: When Dawn prepares the command,
SynchronizeBufferBeforeUseOnGPU()skips waiting on fences because they were already drained during Step 2. - Meanwhile, the attacker (or another process) legitimately begins access to the same Shared Image. This results in concurrent, unbarriered access to the same underlying GPU resource from different queues, violating synchronization guarantees and potentially leaking stale GPU memory.
(Note: These are potential steps based on code analysis; our tooling agent does not yet have the capability to execute a live proof of concept.)
Suggested Fix
In third_party/dawn/src/dawn/native/Buffer.cpp within BufferBase::Unmap(), the case BufferState::SharedMemoryNoAccess: should return a validation error rather than breaking out of the switch statement. For example:
case BufferState::SharedMemoryNoAccess:
return DAWN_VALIDATION_ERROR("%s cannot be unmapped without shared memory access.", this);
Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955
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, the switch statement in BufferBase::Unmap lacks a return or error for the SharedMemoryNoAccess case, causing a fall-through to an unconditional state change to Unmapped.
Impact
A compromised renderer could potentially perform unauthorised concurrent access to shared GPU resources, leading to cross-origin information leaks or driver-level undefined behaviour.
What the attacker needed
Compromised renderer; ability to send WebGPU commands
The fix
The SharedMemoryNoAccess case in BufferBase::Unmap should return a validation error instead of breaking out of the switch statement.
How it was found
- Issue an AssociateMailboxForBufferImmediate command with a shared image mailbox to inject the buffer into the Dawn wire server.
- Send a DissociateMailboxForBuffer command to call EndAccess, setting the buffer state to SharedMemoryNoAccess and draining fences.
- Send a BufferUnmap wire command using the retained server-side ID to trigger the vulnerable fall-through and set state to Unmapped.
- Queue a GPU command such as CopyBufferToBuffer using the buffer; validation succeeds because the state is Unmapped.
- Dawn skips waiting on fences during SynchronizeBufferBeforeUseOnGPU because they were already drained.
- Concurrently, legitimate access to the same Shared Image begins, resulting in unbarriered concurrent access to the GPU resource.
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 use the graphics card (GPU). A buffer is a chunk of memory the GPU uses. The code that manages the buffer's state (like 'in use' or 'unmapped') had a mistake: when the buffer was in a special 'no access' state, calling unmap would wrongly mark it as 'unmapped' instead of rejecting the call. This could let a malicious web page (if it already compromised the browser's renderer process) access GPU memory it shouldn't, possibly reading data from other sites.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.