Uninitialized Use in ANGLE (CVE-2026-11138)
A logic error in ANGLE's Vulkan backend fails to flush a pending deferred depth clear when a depth-stencil attachment transitions to a read-only layout for stencil texturing. This causes the Vulkan driver to drop the clear, leaving the depth buffer uninitialized and allowing a WebGL context to read uninitialized GPU memory, potentially leaking cross-origin data.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 53 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 Chrome Security team.
Overview: A logic error in ANGLE's Vulkan backend prevents deferred depth clears from flushing when a depth-stencil attachment transitions to a read-only layout during stencil texturing. This results in an invalid Vulkan render pass state where a clear operation is requested on a read-only layout, which drivers drop. This bypasses robust resource initialization, exposing uninitialized VRAM content.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cpp
Estimated timestamp from git blame: 2024-11-15
Summary
In ANGLE's Vulkan backend, ContextVk::switchToReadOnlyDepthStencilMode handles transitioning depth-stencil attachments to read-only layouts to allow for feedback loops (like sampling from the texture while it is attached to a framebuffer). Because Vulkan render passes cannot clear an attachment (a write operation) while it is in a read-only layout, pending deferred clears must be flushed explicitly before the transition.
A logic error in this function fails to flush pending deferred depth clears when stencil texturing is active. Consequently, the render pass begins in an invalid Vulkan state (loadOp=VK_ATTACHMENT_LOAD_OP_CLEAR with a layout like VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL). Vulkan drivers typically drop the invalid clear operation, allowing a WebGL context to read uninitialized GPU memory, resulting in a potential cross-origin information leak.
Technical Details
When an attacker binds a depth-stencil texture, defers a clear, disables depth writes, and configures the texture for stencil texturing, ANGLE triggers ContextVk::switchToReadOnlyDepthStencilMode with isStencilTexture = true.
Inside this function, ANGLE correctly identifies that depth writes are disabled and sets the vk::RenderPassUsage::DepthReadOnlyAttachment flag on mDepthStencilAttachmentFlags.
However, the subsequent logic to flush deferred clears is flawed:
if ((!isStencilTexture && drawFramebuffer->hasDeferredDepthClear()) ||
(isStencilTexture && drawFramebuffer->hasDeferredStencilClear()))
{
ANGLE_TRY(drawFramebuffer->flushDepthStencilDeferredClear(
this, isStencilTexture ? VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_DEPTH_BIT));
}
If isStencilTexture is true, the left side of the || short-circuits. If there is a pending depth clear, it is completely ignored and not flushed.
When the draw call continues, FramebufferVk::startNewRenderPass consumes the unflushed depth clear by setting the depth attachment's loadOp to VK_ATTACHMENT_LOAD_OP_CLEAR. Simultaneously, updateStartedRenderPassWithDepthStencilMode reads the previously set DepthReadOnlyAttachment flag and forces the attachment into a read-only mode.
Finally, finalizeDepthStencilImageLayout chooses a read-only layout. The render pass starts with a clear operation on a read-only layout, violating Vulkan specifications (e.g., VUID-VkAttachmentDescription2-format-06244). The Vulkan driver will drop the clear operation to prevent undefined behavior.
Suggested Reproduction Steps
Note: These are potential steps as our tooling agent cannot execute code to provide a working PoC.
- Initialize a WebGL 2 context and enable the
WEBGL_stencil_texturingextension. - Create a depth-stencil texture (e.g.,
gl.DEPTH24_STENCIL8) and attach it to a framebuffer. - Issue a depth clear via
gl.clearBufferfv(gl.DEPTH, ...)to trigger a deferred clear in ANGLE. - Call
gl.depthMask(false)to disable depth writes and enable depth testing. - Configure the texture for stencil texturing (
ext.DEPTH_STENCIL_TEXTURE_MODEtoext.STENCIL_INDEX) and ensure it is sampler-complete. - Execute a draw call that samples from the texture.
- The Vulkan driver drops the clear, leaving the depth buffer uninitialized. The attacker's draw call can conditionally render pixels based on this uninitialized depth data and read it back via
gl.readPixels().
Suggested Fix
The condition in ContextVk::switchToReadOnlyDepthStencilMode should be updated to independently check and flush the depth and stencil aspects if they are transitioning to read-only, regardless of the value of isStencilTexture.
if (drawFramebuffer->hasDeferredDepthClear() && mDepthStencilAttachmentFlags.test(vk::RenderPassUsage::DepthReadOnlyAttachment))
{
ANGLE_TRY(drawFramebuffer->flushDepthStencilDeferredClear(this, VK_IMAGE_ASPECT_DEPTH_BIT));
}
if (drawFramebuffer->hasDeferredStencilClear() && mDepthStencilAttachmentFlags.test(vk::RenderPassUsage::StencilReadOnlyAttachment))
{
ANGLE_TRY(drawFramebuffer->flushDepthStencilDeferredClear(this, VK_IMAGE_ASPECT_STENCIL_BIT));
}
Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b
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 a logic error in the condition that checks whether to flush a deferred depth clear: when stencil texturing is active, the check only looks for a deferred stencil clear and ignores a pending depth clear.
Impact
A WebGL context could read uninitialized GPU memory, potentially leaking cross-origin information.
What the attacker needed
WebGL 2 context; WEBGL_stencil_texturing extension; depth-stencil texture attached to framebuffer
The fix
The condition in `ContextVk::switchToReadOnlyDepthStencilMode` should be updated to independently check and flush the depth and stencil aspects if they are transitioning to read-only, regardless of the value of `isStencilTexture`.
How it was found
- Initialize a WebGL 2 context and enable the WEBGL_stencil_texturing extension.
- Create a depth-stencil texture and attach it to a framebuffer.
- Issue a depth clear to trigger a deferred clear in ANGLE.
- Disable depth writes and enable depth testing.
- Configure the texture for stencil texturing and ensure it is sampler-complete.
- Execute a draw call that samples from the texture, then read back pixels.
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.
When a web page uses WebGL to draw 3D graphics, the browser's graphics layer (ANGLE) sometimes delays clearing a depth buffer until later. A bug means that under a specific combination of settings, the clear is never performed, so the buffer contains leftover data from other programs. A malicious page could then read that leftover data, which might belong to another website.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.