Uninitialized Use in ANGLE (CVE-2026-17667)
ANGLE's framebuffer invalidation does not update the robust resource initialization state, so a WebGL context can read uninitialized GPU memory after a clear is discarded. An attacker could potentially leak cross-origin data from stale GPU memory.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 months
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 potential vulnerability in ANGLE's Metal and GL backends allows framebuffer invalidation to bypass robust resource initialization. This can lead to a cross-origin information leak by allowing a WebGL context to read uninitialized GPU memory. The issue affects platforms using tile-based rendering architectures, including macOS (Metal) and Android (GL).
Affected files:
third_party/angle/src/libANGLE/renderer/metal/FrameBufferMtl.mmthird_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cppthird_party/angle/src/libANGLE/Framebuffer.cpp
Estimated timestamp from git blame: 2017-10-03
Description
A potential vulnerability has been identified in ANGLE's Metal and GL backends where the implementation of glInvalidateFramebuffer (and glDiscardFramebufferEXT) fails to correctly maintain the robust resource initialization state. Robust resource initialization is a security feature designed to ensure that GPU memory is zero-initialized before it can be read by a WebGL context, preventing the leakage of stale data from other origins or the system.
On tile-based architectures (such as Apple Silicon and many mobile GPUs), this logic gap can be exploited to read uninitialized GPU memory because the backend may discard a pending clear operation while the frontend still considers the resource to be initialized.
Technical Analysis
The issue stems from a logic gap in the ANGLE frontend and its interaction with specific backends:
- Frontend State Tracking: ANGLE uses a bitset
mState.mResourceNeedsInitinthird_party/angle/src/libANGLE/Framebuffer.cppto track which attachments require initialization before being read. When a resource is first created, it is marked as needing initialization. - Clear Operation: When
gl.clear()is called, ANGLE's frontend marks the affected attachments as initialized by resetting the corresponding bits inmResourceNeedsInit(viaFramebuffer::markAttachmentsInitialized). - Invalidate Logic Gap: When
gl.invalidateFramebuffer()is called, the frontend passes the command to the backend but fails to update themResourceNeedsInitstate. A comment inthird_party/angle/src/libANGLE/Framebuffer.cppat line 1618 (and 1607 fordiscard) explicitly acknowledges this:// TODO(jmadill): WebGL behaviour, and robust resource init behaviour without WebGL. - Backend Optimization: In backends like Metal (
third_party/angle/src/libANGLE/renderer/metal/FrameBufferMtl.mm), an invalidation sets the store action toMTLStoreActionDontCare. On Tile-Based Deferred Rendering (TBDR) hardware, if aclearand aninvalidateoccur in the same render pass, the GPU may discard the results of the clear in its local tile memory instead of committing the cleared values to the texture's backing memory in system RAM. - Information Leak: Because the frontend metadata incorrectly indicates the resource is still "initialized," a subsequent
gl.readPixels()or similar operation bypasses the robust initialization check inFramebuffer::ensureReadAttachmentsInitialized(third_party/angle/src/libANGLE/Framebuffer.cpp:2612). The backend then reads the uninitialized backing memory, which contains stale GPU data.
Potential Steps to Reproduce (Suggested)
- Initialize a WebGL2 context (robust resource initialization is enabled by default in Chrome).
- Create a texture and attach it to a Framebuffer Object (FBO).
- Perform a full
gl.clear(gl.COLOR_BUFFER_BIT). This causes ANGLE to mark the resource as initialized in its internal metadata. - Call
gl.invalidateFramebuffer()for the color attachment. In the Metal or GL backend, this causes the previously requested clear to be discarded from the GPU's tile buffer. - Call
gl.readPixels(). Because the frontend believes the resource is already initialized, it skips the safety clear. The backend reads and returns the uninitialized stale memory from the texture's backing store.
Suggested Fix
The Framebuffer::invalidate, Framebuffer::invalidateSub, and Framebuffer::discard methods in third_party/angle/src/libANGLE/Framebuffer.cpp should be updated to mark the invalidated attachments as needing initialization (e.g., by resetting their InitState to MayNeedInit and updating the mResourceNeedsInit bitset) when robust resource initialization is enabled. This ensures that any subsequent read operation will correctly trigger a robust clear if the content has been invalidated.
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
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 frontend's resource-initialization bitset is not updated when a framebuffer attachment is invalidated, so a later read skips the safety clear while the backend has discarded the cleared tile data.
Impact
A WebGL context could potentially read stale GPU memory from other origins, leading to a cross-origin information leak on tile-based Metal and GL platforms.
What the attacker needed
WebGL2 context; tile-based GPU (Metal or GL); robust resource init enabled
The fix
The invalidate and discard methods should mark the affected attachments as needing initialization when robust resource initialization is enabled, so a later read triggers a robust clear.
How it was found
- Create a WebGL2 context with robust resource initialization enabled.
- Create a texture and attach it to a framebuffer object.
- Clear the colour buffer, which marks the resource as initialized.
- Invalidate the colour attachment, which discards the clear on the GPU.
- Read pixels; the frontend skips the safety clear and returns uninitialized 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.
WebGL lets web pages draw 3D graphics using the GPU. To stop one website reading another website's leftover GPU memory, browsers zero that memory before a page can read it. This report says a certain sequence of WebGL commands can skip that zeroing, so a page might read old data left by another page.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.