Out of bounds write in ANGLE (CVE-2026-9879)
ANGLE's OpenGL backend workaround for EXT_texture_norm16 readback treated a Pixel Buffer Object byte offset as a host pointer and wrote pixel data to it. An attacker could obtain a fixed-pattern write primitive at a chosen virtual address in the GPU process, potentially leading to code execution.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 55 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 security team.
Overview: An out-of-bounds write vulnerability exists in ANGLE's OpenGL backend when using the EXT_texture_norm16 readback workaround with a Pixel Buffer Object (PBO). The workaround misinterprets an attacker-controlled PBO offset as a host pointer and writes to it directly, potentially leading to an arbitrary write primitive and RCE in the GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp
Estimated timestamp from git blame: 2020-01-03
Description
A vulnerability exists in ANGLE's OpenGL backend implementation of the EXT_texture_norm16 readback workaround, located in src/libANGLE/renderer/gl/FramebufferGL.cpp. This workaround is designed to handle glReadPixels calls using the RGBA/UNSIGNED_SHORT format/type from textures with R16_EXT or RG16_EXT formats, a combination that some native drivers handle incorrectly.
The workaround implementation, specifically RearrangeEXTTextureNorm16Pixels, fails to account for cases where a Pixel Buffer Object (PBO) is bound. When a PBO is bound, the pixels parameter to glReadPixels represents a byte offset into the PBO, not a host memory address. However, the workaround casts this offset to a CPU pointer and writes pixel data directly to it, resulting in a "wild write" at a controlled virtual address.
Bypass Mechanism and Trigger
To exploit this, an attacker must provide a high offset (e.g., 0x70000000) to glReadPixels. Both Blink and ANGLE validate that offset + read_size <= PBO_size. However, an attacker can bypass these checks by requesting a massive buffer allocation (e.g., 2GB) using gl.bufferData().
On constrained systems (like 32-bit Android devices), the native OpenGL driver will likely fail to allocate 2GB and return a GL_OUT_OF_MEMORY error. Crucially, in release builds of ANGLE, the ANGLE_GL_TRY macro is a no-op, meaning BufferGL::setData ignores the native driver's OOM error and reports success to the frontend.
Consequently, both Blink and ANGLE's frontend state incorrectly record the buffer size as 2GB. When the attacker subsequently calls glReadPixels with a high offset, the validation checks pass. The native driver will fail the read operation (because the actual buffer is non-existent), but ANGLE_GL_TRY ignores this error as well. Execution then proceeds to RearrangeEXTTextureNorm16Pixels, which writes to the attacker-controlled offset.
Impact
The write pattern is a fixed 8-byte sequence per pixel: 00 00 00 00 00 00 FF FF. On 32-bit GPU process configurations (common on Android Mali/Adreno devices where this workaround is enabled), this allows a genuine fixed-pattern write primitive against predictable heap structures or executable memory, potentially leading to full Remote Code Execution (RCE) in the GPU process.
Potential Reproduction Steps
Note: These are theoretical steps based on code analysis.
- Initialize a WebGL 2 context and enable the
EXT_texture_norm16extension. - Create an
R16_EXTtexture and attach it to a framebuffer. - Create a WebGL buffer and bind it to
gl.PIXEL_PACK_BUFFER. - Call
gl.bufferData(gl.PIXEL_PACK_BUFFER, 2000000000, gl.STATIC_DRAW)to request a massive buffer, intentionally causing a native driver OOM that ANGLE will ignore. - Call
gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_SHORT, TARGET_OFFSET), whereTARGET_OFFSETis the desired virtual address in the GPU process to be written to.
Suggested Fix
- Workaround Fix: Modify
FramebufferGL::readPixelsto prevent theEXT_texture_norm16workaround from executing when a PBO is bound, or update the workaround to properly handle PBOs by performing the pixel expansion via native OpenGL commands (e.g., using a compute shader or intermediate buffer object) rather than CPU-side pointer manipulation. - Error Handling Fix: Address the systemic issue in
BufferGL::setDatawhere native driver errors (like OOM) are silently ignored in release builds. TheANGLE_GL_TRYmacro or the error handling logic in the backend should ensure critical failures are propagated to the frontend so that internal buffer size tracking remains accurate.
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 the readback workaround did not check whether a Pixel Buffer Object was bound, so it treated the PBO offset as a host pointer, and release builds also silently ignored native driver errors such as out-of-memory.
Impact
On 32-bit GPU process setups this could give a fixed-pattern write primitive against predictable heap or executable memory, potentially leading to code execution in the GPU process; the report notes the steps are theoretical and based on code analysis.
What the attacker needed
Victim loads a crafted web page; WebGL 2 with EXT_texture_norm16; 32-bit GPU process (e.g. some Android devices)
The fix
The workaround should be skipped or reworked when a PBO is bound, and native driver errors should be propagated instead of silently ignored.
How it was found
- Initialise a WebGL 2 context and enable the EXT_texture_norm16 extension.
- Create an R16_EXT texture and attach it to a framebuffer.
- Create a WebGL buffer and bind it as the pixel pack buffer.
- Request a very large buffer allocation so the native driver runs out of memory, which ANGLE ignores.
- Call readPixels with a chosen offset so the workaround writes to that 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.
WebGL lets web pages draw graphics using the GPU. A buffer object is a chunk of GPU-side memory, and code refers to parts of it by a number (an offset), not a real memory address. Here the browser code confused that number with a real address and wrote data there, so a crafted page could write into memory it should never touch.
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.