Integer overflow in Dawn (CVE-2026-7973)
An integer overflow in Dawn's D3D12 backend workaround for Intel Gen12 GPUs causes an undersized GPU texture allocation while Dawn's validation still uses the original larger size. An attacker could then issue WebGPU commands that access layers beyond the allocated capacity, leading to out-of-bounds reads and writes in GPU memory.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 38 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: An integer overflow exists in Dawn's D3D12 backend when applying a memory allocation workaround for Intel Gen12 GPUs. A 32-bit padding size is added to a 16-bit texture dimension field without bounds checking, causing the allocation of an undersized GPU buffer. Dawn's validation relies on the original requested size, allowing WebGPU commands to perform out-of-bounds reads and writes in GPU memory.
Affected files:
third_party/dawn/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.cppthird_party/dawn/src/dawn/native/d3d12/TextureD3D12.cppthird_party/dawn/src/dawn/native/Texture.cppthird_party/dawn/src/dawn/native/d3d12/UtilsD3D12.cpp
Estimated timestamp from git blame: 2022-12-14
Description
A potential vulnerability exists in Dawn's D3D12 backend where an integer overflow can lead to the allocation of undersized GPU textures on systems with Intel Gen12 GPUs (e.g., Tiger Lake) running older drivers.
In third_party/dawn/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.cpp, the AllocateMemory function implements a workaround for a legacy bug in Intel Gen12 GPU drivers (Toggle::D3D12AllocateExtraMemoryFor2DArrayColorTexture). This workaround increases the number of layers in a 2D array texture to avoid corruption:
// ResourceAllocatorManagerD3D12.cpp
revisedDescriptor.DepthOrArraySize += ComputeExtraArraySizeForIntelGen12(
resourceDescriptor.Width, resourceDescriptor.Height,
resourceDescriptor.DepthOrArraySize, resourceDescriptor.MipLevels,
resourceDescriptor.SampleDesc.Count, colorFormatBytesPerBlock);
The vulnerability occurs because ComputeExtraArraySizeForIntelGen12 returns a uint32_t, but revisedDescriptor.DepthOrArraySize is a UINT16 field (as defined in the D3D12_RESOURCE_DESC struct). There are no bounds or overflow checks on this addition.
An attacker can request a texture with dimensions that cause ComputeExtraArraySizeForIntelGen12 to return a very large value. When added to the requested DepthOrArraySize, the resulting sum overflows the 16-bit integer and is truncated. Consequently, D3D12 allocates a resource with a much smaller capacity than requested. However, Dawn's internal representation (TextureBase::mBaseSize) retains the original, larger size. When the attacker accesses layers beyond the allocated capacity, Dawn's frontend validation permits the access, passing the out-of-bounds subresource index to the D3D12 runtime, which performs an out-of-bounds memory access in the GPU heap.
Potential Attacker Steps
Note: These steps are theoretical as our tooling agent does not run exploit code directly.
- Meet Preconditions: The victim must be using an Intel Gen12 GPU with a Windows driver older than 30.0.101.1692, triggering the workaround toggle.
- Request Malicious Texture: The attacker requests a 2D array texture via WebGPU. For example, a texture of size
1x8192with1793layers and formatr16uint.- Dawn validates this against the device's
maxTextureArrayLayerslimit (usually 2048), which passes.
- Dawn validates this against the device's
- Trigger Overflow: Inside
AllocateMemory,ComputeExtraArraySizeForIntelGen12calculates the required padding. For the above dimensions, it returns457,215.- The addition
1793 + 457215 = 459008overflows theUINT16type. - The value wraps around modulo 65536:
459008 % 65536 = 256.
- The addition
- Undersized Allocation: D3D12 creates a physical GPU resource with only 256 layers, but Dawn's internal state continues to track it as having 1793 layers.
- Out-of-Bounds Access: The attacker invokes a WebGPU copy command (e.g.,
copyTextureToBuffer) targeting layer1700. Dawn's validation permits this (1700 < 1793). - Memory Corruption: Dawn issues an
ID3D12GraphicsCommandList::CopyTextureRegioncommand for subresource1700. The GPU driver computes the memory address, pointing far past the allocated 256 layers, resulting in an out-of-bounds read/write in GPU memory (a GPU process sandbox escape primitive).
Suggested Fix
Check for integer overflow before assigning the value to the UINT16 field. If the required size exceeds the capacity of a UINT16, the allocation should fail gracefully (return an out-of-memory error).
uint32_t extraSize = ComputeExtraArraySizeForIntelGen12(...);
uint32_t newSize = resourceDescriptor.DepthOrArraySize + extraSize;
if (newSize > std::numeric_limits<UINT16>::max()) {
return DAWN_OUT_OF_MEMORY_ERROR("Texture array size with Intel Gen12 workaround exceeds UINT16 max");
}
revisedDescriptor.DepthOrArraySize = static_cast<UINT16>(newSize);
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from 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 padding value is added to a 16-bit texture array size field without checking for overflow, so the sum wraps around and the allocation is smaller than the size Dawn tracks internally.
Impact
An attacker could cause out-of-bounds reads and writes in GPU memory, potentially leading to a GPU process sandbox escape, but only on systems with an Intel Gen12 GPU and an older Windows driver.
What the attacker needed
Intel Gen12 GPU; Windows driver older than 30.0.101.1692; WebGPU access
The fix
The fix should check for integer overflow before assigning to the UINT16 field and return an out-of-memory error if the size exceeds the maximum.
How it was found
- The victim must use an Intel Gen12 GPU with a Windows driver older than 30.0.101.1692 to trigger the workaround.
- The attacker requests a 2D array texture via WebGPU with dimensions that pass Dawn's validation but cause a large padding value.
- Inside AllocateMemory, the padding is added to the array size, overflowing the 16-bit field and wrapping to a small number.
- D3D12 allocates a physical GPU resource with only the wrapped number of layers, while Dawn's internal state keeps the original larger size.
- The attacker invokes a WebGPU copy command targeting a layer beyond the allocated capacity, which Dawn's validation permits.
- The GPU driver performs an out-of-bounds memory access in GPU memory.
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 GPU texture is like a grid of pixels stored in memory. A bug in a workaround for certain Intel graphics cards makes the program allocate a smaller texture than it thinks it did, so later commands can read or write outside the allocated memory. This could let an attacker corrupt GPU memory.
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.