Use after free in Dawn (CVE-2026-14424)
A race condition in Dawn's wire server on macOS lets a compromised renderer trigger a use-after-free read: a background Metal driver thread can still be copying from a mapped buffer while the main thread destroys the device and clears the buffer's backing allocation. This could leak reclaimed GPU driver memory into memory the renderer can see.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 33 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential race condition in the Dawn wire server allows a compromised renderer to bypass mapState synchronization during DeviceDestroy. When spontaneous callbacks are enabled, a background driver thread can execute OnBufferMapAsyncCallback and read from the driver-mapped pointer of an MTLBuffer while the main thread concurrently destroys the buffer and clears its backing allocation.
Affected files:
third_party/dawn/src/dawn/wire/server/ServerBuffer.cppthird_party/dawn/src/dawn/dawn_wire.jsonthird_party/dawn/src/dawn/native/metal/BufferMTL.mmthird_party/dawn/src/dawn/native/Device.cpp
Estimated timestamp from git blame: 2025-09-03
Description
A potential Use-After-Free (UAF) read vulnerability exists in the WebGPU/Dawn graphics component of Chromium on the macOS/Metal platform. The issue arises from a synchronization mismatch between Dawn's wire server-side mutex (ServerBase::mMutex) and native Dawn device/buffer destruction sequence.
Root Cause Analysis
- When the Dawn wire server is instantiated on macOS, it is typically configured with
useSpontaneousCallbacks = truebecausefeatures::kWebGPUSpontaneousWireServeris enabled by default (seegpu/command_buffer/service/webgpu_decoder_impl.ccline 137). - Spontaneous mapping callbacks (like
OnBufferMapAsyncCallback) are invoked via theForwardToServerHelper::Callbackhelper which acquires the server-side mutex viaauto serverGuard = server.get()->GetGuard();(seethird_party/dawn/src/dawn/wire/server/Server.hline 103). This serializes spontaneous callbacks against other wire server commands. - However,
DeviceDestroydoes not acquire the wire server-side mutex. When a compromised renderer sends aDeviceDestroycommand, the GPU main thread directly executes nativeDeviceBase::APIDestroy()(inthird_party/dawn/src/dawn/native/Device.cppline 642). - During
DeviceBase::Destroy(), the GPU main thread blocks inmQueue->WaitForIdleForDestruction()(line 595), waiting on themCompletedSerialcondition variable for outstanding commands to finish. - Once the command buffer finishes executing, the background Metal driver thread fires the completion block registered via
addCompletedHandler:(inthird_party/dawn/src/dawn/native/metal/QueueMTL.mmline 236), which callsUpdateCompletedSerialToon the background thread. - On the background thread,
UpdateCompletedSerialTodoes two things concurrently/sequentially:- It marks the
MapAsyncEventas ready, which triggers spontaneous execution ofOnBufferMapAsyncCallbackon the background thread. The callback enters the server critical section (GetGuard()) and begins copying data frommMtlBuffercontents. - It updates
mCompletedSerialto the completed serial, which immediately wakes up the main thread waiting inWaitForIdleForDestruction().
- It marks the
- Since the GPU main thread's destruction sequence does not hold the wire server mutex (
ServerBase::mMutex), the main thread resumes and proceeds immediately toDestroyObjects()(line 577), iterating toBuffer::DestroyImpl()and settingmMtlBuffer = nullptr(line 237). - The background thread, still executing
OnBufferMapAsyncCallback, is left reading from the deallocated/clearedid<MTLBuffer>resource, resulting in a use-after-free read of GPU driver-allocated memory.
Potential Attack Scenario / Steps to Reproduce
Note: These steps are theoretical as our environment does not support executing or validating live graphics exploits.
- From a compromised renderer, create a large mappable buffer (e.g., 128 MB) with
MapReadandCopyDstusage. - Submit a queue operation touching the buffer, then issue
BufferMapAsync(READ, 0, size)and flush. - Wait until the Metal completion handler is about to execute.
- Send a
DeviceDestroycommand and flush. - The GPU main thread executes
DeviceDestroyand frees theMTLBufferbacking on the main thread while the background thread is copying memory from the mapping pointer, leaking reclaimed driver-allocated bytes into the shared memory backing visible to the renderer.
Suggested Fix
To remediate this issue, ensure that DeviceDestroy is listed under server_custom_pre_handler_commands in third_party/dawn/src/dawn/dawn_wire.json (line 357). This will generate a custom pre-handler for DeviceDestroy that acquires the appropriate locks and cleans up pending client/server mapping handles before initiating backend device destruction.
Evaluated with Chrome root at commit: 5133b93d189b383c37805b1cf3a9d2dbfe8d7379
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
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 DeviceDestroy wire command does not take the wire server mutex, so native device and buffer destruction can run concurrently with a spontaneous map callback that is still reading the buffer.
Impact
A compromised renderer could read reclaimed GPU driver-allocated bytes through the shared memory backing, though the report notes the steps are theoretical and were not executed or validated.
What the attacker needed
Compromised renderer; macOS with Metal backend; spontaneous wire server callbacks enabled
The fix
DeviceDestroy should be listed under server_custom_pre_handler_commands so a generated pre-handler takes the locks and cleans up pending mapping handles before backend destruction begins.
How it was found
- From a compromised renderer, create a large mappable buffer with read and copy-destination usage.
- Submit a queue operation on the buffer, then request an asynchronous read mapping and flush.
- Wait until the Metal completion handler is about to run.
- Send a device destroy command and flush.
- The main thread frees the buffer backing while the background thread is still copying from the mapping pointer.
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.
A use-after-free is when one part of a program frees a chunk of memory while another part is still reading it, so the reader may see data that has since been reused for something else. Here two threads in the graphics layer act at the same time: one is copying out of a buffer, the other is tearing the buffer down. The report says a renderer that is already compromised could exploit this timing to read memory it should not see.
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.