Insufficient validation of untrusted input in ANGLE (CVE-2026-7943)
The passthrough command decoder in Chromium's GPU process treats a zero data_shm_id as a raw pointer offset without checking that a pixel buffer object is bound, and ANGLE's validation skips size checks when imageSize is negative one. A compromised renderer can send a crafted command to read from an arbitrary address in the low 4 GB of the GPU process, potentially exfiltrating data via a texture.
86ac1f1587b71893ed2ad792cd7dde32 Follow
Originally disclosed on Chrome VRP
- Fix shipped in 44 days
Summary
The passthrough command decoder's handlers for CompressedTexImage3D and CompressedTexSubImage3D reinterpret the command's data_shm_offset field as a raw GPU-process pointer when data_shm_id is zero. This encoding is intended for Pixel Buffer Object offsets, but the handler performs no check that a PBO is actually bound. ANGLE's compressed texture validators pass a hardcoded imageSize of negative one to the internal ValidImageDataSize helper, which then skips all host-memory size validation when no PBO is present. Every ANGLE backend dereferences this fabricated pointer during texture upload: D3D11 through Image11::loadCompressedData, Vulkan through TextureVk::stageSubresourceUpdate, and Metal through TextureMtl::setImageImpl. A compromised renderer can therefore read from any address in the low 4 GB of the GPU process address space by sending a single crafted command buffer entry. Platform: Windows, macOS, Linux, ChromeOS; any GPU.
Bisect
Introducing Commit: 95f938225bec04fe8e3d87bcc692f67c6388cf06
- Date: 2017-04-12
- Author: Corentin Wallez
- Review: https://codereview.chromium.org/2811693005
This commit added PBO offset support to the passthrough command decoder's compressed texture upload handlers. The original code (from d00f0b244d1bb, 2016-06-03) treated all nonzero data_shm_id or data_shm_offset combinations as shared-memory lookups. The 95f938225bec0 change split the data_shm_id == 0 case into a new branch that reinterprets data_shm_offset as a raw pointer for PBO offsets, but omitted a check that a pixel unpack buffer is actually bound. The legacy (non-passthrough) command decoder contains the corresponding guard: it rejects data_shm_id == 0 when no PBO is bound by returning error::kInvalidArguments. The passthrough decoder never acquired an equivalent check.
Root Cause
The vulnerability arises from a mismatch between the command buffer's data encoding convention and the validation performed downstream in ANGLE.
When the GPU-side passthrough handler receives a CompressedTexImage3D command, it branches on the data_shm_id field. A nonzero id triggers a validated shared-memory lookup with bounds checking. An id of zero, however, causes the handler to synthesize a pointer directly from data_shm_offset:
// gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
const void* data = nullptr;
if (data_shm_id != 0) {
unsigned int data_size = 0;
data = GetSharedMemoryAndSizeAs<const void*>(data_shm_id, data_shm_offset,
image_size, &data_size);
if (data == nullptr) {
return error::kOutOfBounds;
}
} else {
data =
reinterpret_cast<const void*>(static_cast<intptr_t>(data_shm_offset));
}
The zero-id path exists to encode PBO offsets, where the data argument to glCompressedTexImage3D is treated as a byte offset into the currently bound pixel unpack buffer rather than a host pointer. The handler does not verify that a PBO is actually bound before constructing this pointer; it unconditionally forwards the fabricated address to DoCompressedTexImage3D, which passes it straight through to ANGLE:
// gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
api()->glCompressedTexImage3DFn(target, level, internalformat, width, height,
depth, border, image_size, data);
Inside ANGLE, the ValidateCompressedTexImage3D function verifies format parameters and that imageSize matches the computed block size, then delegates to the shared ValidateES3TexImage3DParameters with a hardcoded imageSize argument of negative one:
// third_party/angle/src/libANGLE/validationES3.cpp
if (!ValidateES3TexImage3DParameters(context, entryPoint, target, level,
internalformat, true, false, 0, 0, 0,
width, height, depth, border, GL_NONE,
GL_NONE, -1, data))
That negative-one value reaches ValidImageDataSize, which contains an early return that was designed to skip validation when the caller has already verified the compressed image size separately:
// third_party/angle/src/libANGLE/validationES.cpp
Buffer *pixelUnpackBuffer =
context->getState().getTargetBuffer(BufferBinding::PixelUnpack);
if (pixelUnpackBuffer == nullptr && imageSize < 0)
{
return true;
}
When no PBO is bound and imageSize is negative one, validation returns immediately without examining the data pointer at all. In standard OpenGL semantics a non-null data without a PBO is a valid client pointer upload, so ANGLE has no reason to reject it. The pointer proceeds through the D3D11 texture backend, where GetUnpackPointer returns it verbatim when no unpack buffer is present:
// third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp
if (unpackBuffer)
{
// ... read from PBO ...
}
else
{
*pointerOut = pixels;
}
The pointer finally reaches Image11::loadCompressedData, which maps a D3D11 staging texture and copies data from the pointer via a format-specific load function:
// third_party/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
loadFunction(context11->getImageLoadContext(), area.width, area.height,
area.depth, static_cast<const uint8_t *>(input),
inputRowPitch, inputDepthPitch, offsetMappedData,
mappedImage.RowPitch, mappedImage.DepthPitch);
For a 4x4 DXT5 block this resolves to LoadCompressedToNative<4,4,1,16>, which performs a 16-byte memcpy from the attacker-supplied address into the staging texture. On a 64-bit build the fabricated pointer is zero-extended from 32 bits, restricting the read range to the low 4 GB of the GPU process virtual address space. This is sufficient to read mapped code sections and portions of static data, and the read content lands in a GPU texture that could in principle be exfiltrated back to the renderer via readPixels.
The passthrough decoder is the only command decoder compiled on non-Android platforms. The build system sets enable_validating_command_decoder = is_android in ui/gl/features.gni, so on Windows, macOS, Linux, and ChromeOS the passthrough path is always active and this vulnerability is always reachable.
The same data_shm_id == 0 pointer fabrication pattern appears in all four compressed texture upload handlers: HandleCompressedTexImage2D, HandleCompressedTexSubImage2D, HandleCompressedTexImage3D, and HandleCompressedTexSubImage3D.
Reproduce
The bug was tested on Chromium commit d633da0f560b561113ef431f228063b059b0c896 on macOS, Ubuntu22.04 and Windows 11.
This is a compromised-renderer attack against the GPU process. The renderer-side command buffer client is patched to bypass the normal bucket transfer path for compressed texture uploads and instead send a raw CompressedTexImage3D command with data_shm_id set to zero and data_shm_offset set to an arbitrary 32-bit address. The GPU process passthrough handler interprets this offset as a client pointer and forwards it to ANGLE, which dereferences it during texture upload. Apply the patch to the Chromium source tree from the repository root.
Configure an ASAN build with out/asan/args.gn as follows, then build:
is_asan = true
is_debug = false
dcheck_always_on = false
git apply patch.diff
autoninja -C out/asan chrome
Launch Chrome with the PoC page:
# Windows(poc.html uses an absolute path)
$ out\asan\chrome.exe --enable-logging=stderr --user-data-dir=/tmp/poc /path/to/poc.html 2>/tmp/asan.txt
$ cat /tmp/asan.txt
# Linux
out/asan/chrome --enable-logging=stderr --user-data-dir=./user poc.html
The GPU process will crash immediately when the WebGL2 page issues compressedTexImage3D. AddressSanitizer reports an access-violation READ at address 0x000041414141 inside angle::LoadCompressedToNative, called from rx::Image11::loadCompressedData. The full stack trace is preserved in asan.txt.
ASAN log:
=================================================================
==23904==ERROR: AddressSanitizer: access-violation on unknown address 0x000041414141 (pc 0x7ffb3f47dc26 bp 0x0026eedfd200 sp 0x0026eedfd178 T0)
==23904==The signal is caused by a READ memory access.
==23904==*** WARNING: Failed to initialize DbgHelp! ***
==23904==*** Most likely this means that the app is already ***
==23904==*** using DbgHelp, possibly with incompatible flags. ***
==23904==*** Due to technical reasons, symbolization might crash ***
==23904==*** or produce wrong results. ***
#0 0x7ffb3f47dc25 in memcpy+0x125 (C:\Windows\System32\ucrtbase.dll+0x1800edc25)
#1 0x7ffac8ecb532 in _asan_memcpy+0x422 (D:\src\chromium\src\out\asan\clang_rt.asan_dynamic-x86_64.dll+0x18004b532)
#2 0x7ffab7786e9c in angle::LoadCompressedToNative<4,4,1,16> D:\src\chromium\src\third_party\angle\src\image_util\loadimage.inc:402
#3 0x7ffab7872070 in rx::Image11::loadCompressedData D:\src\chromium\src\third_party\angle\src\libANGLE\renderer\d3d\d3d11\Image11.cpp:352
#4 0x7ffab79d0c73 in rx::TextureD3D_2DArray::setCompressedImage D:\src\chromium\src\third_party\angle\src\libANGLE\renderer\d3d\TextureD3D.cpp:3450
#5 0x7ffab76a4f36 in gl::Texture::setCompressedImage D:\src\chromium\src\third_party\angle\src\libANGLE\Texture.cpp:1470
......
Credit
Please use 86ac1f1587b71893ed2ad792cd7dde32 as the credit for this vulnerability. Thank you.
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 passthrough command decoder's compressed texture handlers reinterpret data_shm_offset as a raw pointer when data_shm_id is zero, without verifying a pixel unpack buffer is bound, and ANGLE's validation skips size checks for negative imageSize, allowing the fabricated pointer to be dereferenced.
What the attacker needed
Compromised renderer; ability to send crafted command buffer entries
The fix
The passthrough decoder should reject data_shm_id == 0 when no pixel unpack buffer is bound, as the legacy decoder does.
How it was found
- Patch the renderer-side command buffer client to bypass the normal bucket transfer path for compressed texture uploads.
- Send a raw CompressedTexImage3D command with data_shm_id set to zero and data_shm_offset set to an arbitrary 32-bit address.
- Build Chromium with AddressSanitizer and apply the patch.
- Launch Chrome with the PoC page that issues compressedTexImage3D.
- Observe the GPU process crash and ASAN report showing an access-violation READ at the chosen address.
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 compromised renderer (the part of the browser that runs web pages) can send a special command to the GPU process that makes it read memory from an address the attacker chooses. Because the GPU process has access to sensitive data, this could leak information. The bug is that the code trusts a number as a memory address without checking it is safe.
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.