Uninitialized Use in WebXR (CVE-2026-14008)
A security clear in WebXR on Android can be bypassed because the clear operation does not disable the page-settable GL_RASTERIZER_DISCARD state, causing ANGLE to skip the clear. This could let a page read uninitialized GPU memory from newly allocated swap chain textures.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 36 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential security clear bypass exists in XRWebGLSwapChain::ClearCurrentTexture when WebXR Layers is used on Android. Because the function does not temporarily disable the GL_RASTERIZER_DISCARD capability before executing clear operations, a page can enable this state to make ANGLE early-return and silently discard the clear. This could allow the page to read uninitialized GPU memory/VRAM from freshly-allocated gralloc swap chain textures.
Affected files:
third_party/blink/renderer/modules/xr/xr_webgl_swap_chain.cc
Estimated timestamp from git blame: 2025-01-17
Summary
A potential security clear bypass vulnerability has been identified in XRWebGLSwapChain::ClearCurrentTexture (located in third_party/blink/renderer/modules/xr/xr_webgl_swap_chain.cc). When utilizing WebXR Layers on Android, swap chain textures are backed by newly allocated AHardwareBuffer SharedImages. If a page enables the GL_RASTERIZER_DISCARD capability prior to accessing a WebXR sub-image, the mandatory security clear of the swap chain texture is bypassed. This can potentially leak uninitialized GPU VRAM memory (such as recycled system-wide gralloc allocations containing cross-origin imagery or system UI) back to the renderer process.
Technical Details & Root Cause
When WebXR Layers is active on Android, AHardwareBuffer SharedImages are imported via AHardwareBufferImageBackingFactory::CreateSharedImage in gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.cc. Upon import, the backing is unconditionally marked as cleared via backing->SetCleared() without performing raw gralloc zero-initialization on the newly allocated buffer.
This bypasses the GPU command decoder's safe clear fallback, transferring the sole responsibility of clearing the texture to Blink's WebXR implementation.
During frame rendering, XRWebGLSwapChain::ClearCurrentTexture is executed to clear the texture before exposing it to the renderer:
void XRWebGLSwapChain::ClearCurrentTexture() {
...
gpu::gles2::GLES2Interface* gl = context()->ContextGL();
...
gl->Disable(GL_SCISSOR_TEST);
...
gl->FramebufferTexture2D(GL_FRAMEBUFFER, attachment, GL_TEXTURE_2D,
texture->Object(), 0);
gl->Clear(clear_bits);
...
}
However, ClearCurrentTexture does not temporarily disable the GL_RASTERIZER_DISCARD capability (which is a page-settable WebGL2 state). If the page has enabled this state, the clear command is forwarded to ANGLE, which early-returns inside Context::clear (in third_party/angle/src/libANGLE/Context.cpp) without executing the clear:
void Context::clear(GLbitfield mask) {
if (mState.isRasterizerDiscardEnabled()) {
return;
}
...
}
Consequently, the security clear is silently discarded, leaving the uninitialized gralloc / GPU VRAM contents intact.
Suggested Steps to Reproduce
Note: The following are potential steps that require testing on a physical device, as our automated analysis tools do not have the ability to execute the code.
-
Serve a page over HTTPS to a compatible Chrome for Android browser.
-
Create a WebGL2 context and request an immersive WebXR session with layers enabled:
JavaScript const gl = canvas.getContext('webgl2', {xrCompatible: true}); const session = await navigator.xr.requestSession('immersive-ar', {requiredFeatures: ['layers']}); const binding = new XRWebGLBinding(session, gl); -
Instantiate a projection layer:
JavaScript const layer = binding.createProjectionLayer({textureType: 'texture'}); session.updateRenderState({layers: [layer]}); -
Within the animation frame loop, enable rasterizer discard before querying the sub-image:
JavaScript gl.enable(gl.RASTERIZER_DISCARD); const sub = binding.getViewSubImage(layer, frame.getViewerPose(refSpace).views[0]); gl.disable(gl.RASTERIZER_DISCARD); -
Bind the returned
sub.colorTextureto a custom framebuffer, and read the pixels usinggl.readPixels(...)or sample it in a custom shader. -
Observe if the read pixels contain uninitialized graphics/VRAM data rather than transparent black.
Proposed Fix
Apply a mechanism to temporarily disable and then restore GL_RASTERIZER_DISCARD inside XRWebGLSwapChain::ClearCurrentTexture. This can be achieved by checking the current state of rasterizer discard on the context, disabling it before gl->Clear(), and restoring the original value afterwards, similar to how it is handled in webgl_rendering_context_base.cc via ScopedDisableRasterizerDiscard or by querying via gl->IsEnabled(GL_RASTERIZER_DISCARD).
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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 clear function does not temporarily disable the page-controllable GL_RASTERIZER_DISCARD capability, so ANGLE skips the clear and the texture remains uninitialized.
Impact
This could allow a page to read uninitialized GPU memory, potentially leaking cross-origin imagery or system UI, though the report notes the steps are potential and require testing on a physical device.
What the attacker needed
Chrome for Android with WebXR Layers; physical Android device; page served over HTTPS
The fix
The clear function should temporarily disable and then restore GL_RASTERIZER_DISCARD around the clear operation.
How it was found
- Serve a page over HTTPS to a compatible Chrome for Android browser.
- Create a WebGL2 context and request an immersive WebXR session with layers enabled.
- Instantiate a projection layer and set it in the session render state.
- In the animation frame loop, enable rasterizer discard before querying the sub-image, then disable it.
- Bind the returned colour texture to a custom framebuffer and read pixels or sample it in a shader.
- Observe whether the read pixels contain uninitialized graphics/VRAM data rather than transparent black.
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 program gives you a new piece of graphics memory, it should wipe it first so you cannot see what was there before. Here, a web page can turn on a graphics setting that makes the wiping step be skipped, so the page might see leftover data from other programs.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.