Uninitialized resource in ANGLE (CVE-2026-79229)
A validation gap in ANGLE's ES2 sub-image path allows non-WebGL contexts to bypass type-to-internalformat consistency checks. A mismatched type parameter causes the Vulkan backend to fall back to a no-op conversion function, leaving dynamic staging memory uninitialized, which can then be uploaded to a texture and potentially read back by an attacker.
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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential validation gap in ANGLE's ES2 sub-image path allows non-WebGL contexts to bypass type-to-internalformat consistency checks. A mismatched type parameter causes the Vulkan backend to fallback to a no-op conversion function, leaving dynamic staging memory uninitialized. This recycled memory, which can contain cross-origin GPU data, is then uploaded to the texture and can potentially be read back by an attacker.
Affected files:
third_party/angle/src/libANGLE/validationES2.cppthird_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_helpers.cppthird_party/angle/src/libANGLE/Texture.cppthird_party/angle/src/libANGLE/renderer/load_functions_table_autogen.cpp
Estimated timestamp from git blame: 2024-11-25
Description
A potential security vulnerability has been identified in ANGLE's GLES2 validation layer, which may allow a compromised renderer to bypass texture type validation and disclose recycled GPU memory containing cross-origin data.
Root Cause Analysis
In third_party/angle/src/libANGLE/validationES2.cpp, within ValidateES2TexImageParametersBase, the validation path for glTexSubImage2D (isSubImage == true) checks format compatibility but fails to enforce type compatibility for non-WebGL contexts:
bool formatsMatch = format == textureInternalFormat.format;
...
if (!formatsMatch)
{
ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kTextureFormatMismatch);
return false;
}
if (context->isWebGL())
{
...
isValid = (GetInternalFormatInfo(format, type).sizedInternalFormat ==
textureSizedInternalFormat);
...
}
For non-WebGL ES2 contexts (e.g., created with CONTEXT_TYPE_OPENGLES2), context->isWebGL() evaluates to false. This bypasses the strict consistency check between the caller-provided type and the actual texture's internal format.
When this occurs, the Vulkan backend (in TextureVk::setSubImageImpl) attempts to load the update. Because the format and type are mismatched, vkFormat.getTextureLoadFunction(formatSupport, type) maps to UnreachableLoadFunction via the autogenerated load function table (load_functions_table_autogen.cpp).
In official release builds, UNREACHABLE() expands to a no-op because ANGLE_ENABLE_ASSERTS is disabled. Consequently, UnreachableLoadFunction returns immediately without writing anything to the mapped staging buffer memory.
ANGLE allocates staging buffers from a shared vk::BufferPool without zero-initialization. Since the load function does not write to the buffer, the stale, recycled memory contents remain completely unmodified and are directly copied into the destination texture on the GPU.
Potential Steps to Trigger
Note: These are potential steps based on static analysis, as our tooling cannot execute code.
- From a compromised renderer, establish a non-WebGL ES2 context via the Command Buffer Mojo interface.
- Allocate a texture with a standard format (e.g.,
GL_RGBAandGL_UNSIGNED_BYTE). - Call
glTexSubImage2Dwith a mismatched type (e.g.,GL_UNSIGNED_SHORT_4_4_4_4). Validation succeeds due to the WebGL-only guard check. - The backend utilizes the uninitialized staging buffer, copying recycled GPU memory into the texture.
- Bind the texture to a Framebuffer and read back the contents via
glReadPixelsor shader sampling to retrieve stale GPU memory.
Suggested Remediation
We suggest enforcing format and type validation consistency checks for all contexts (not just WebGL contexts) inside ValidateES2TexImageParametersBase when handling sub-image updates, or ensuring that the load function table safely handles or rejects invalid type configurations in non-assert builds instead of executing a no-op UnreachableLoadFunction.
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 validation for sub-image updates only enforces type compatibility when the context is WebGL, so non-WebGL ES2 contexts can pass a mismatched type that leads to an unreachable load function and uninitialized staging memory.
Impact
A compromised renderer could potentially read back recycled GPU memory containing cross-origin data, but the report notes this is based on static analysis and the steps are potential, not confirmed.
What the attacker needed
Compromised renderer; non-WebGL ES2 context; ability to call glTexSubImage2D
The fix
The report suggests enforcing format and type validation consistency checks for all contexts, not just WebGL, or ensuring the load function table safely handles invalid type configurations in non-assert builds.
How it was found
- From a compromised renderer, establish a non-WebGL ES2 context via the Command Buffer Mojo interface.
- Allocate a texture with a standard format (e.g., GL_RGBA and GL_UNSIGNED_BYTE).
- Call glTexSubImage2D with a mismatched type (e.g., GL_UNSIGNED_SHORT_4_4_4_4). Validation succeeds due to the WebGL-only guard check.
- The backend utilizes the uninitialized staging buffer, copying recycled GPU memory into the texture.
- Bind the texture to a Framebuffer and read back the contents via glReadPixels or shader sampling to retrieve stale GPU 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.
This report describes a bug in a graphics library called ANGLE, which helps web browsers talk to graphics hardware. When an application asks to update part of a texture, the library normally checks that the data type matches the texture format. For some non-web contexts, that check is missing, so the library skips copying data and instead uploads whatever was left in memory from previous use. That leftover memory could contain data from other websites, and an attacker might be able to read it back.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.