Out of bounds read in ANGLE (CVE-2026-13819)
A logic error in ANGLE's Metal backend allows a compromised renderer to set a non-zero base mipmap level on an IOSurface-backed texture, creating a Metal texture view with an out-of-bounds mipmap range. This could trigger an out-of-bounds read in the GPU process, potentially leaking cross-origin or cross-process memory on macOS.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 49 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A logic error in ANGLE's Metal backend allows a compromised renderer to create a Metal texture view with an out-of-bounds mipmap range. By setting a non-zero GL_TEXTURE_BASE_LEVEL on an IOSurface-backed texture, an attacker can potentially trigger an out-of-bounds read in the GPU process. This could lead to a cross-origin or cross-process information leak on macOS.
Affected files:
third_party/angle/src/libANGLE/renderer/metal/TextureMtl.mmthird_party/angle/src/libANGLE/renderer/metal/mtl_resources.mm
Estimated timestamp from git blame: Unknown (Google3 checkout)
Root Cause Analysis
A vulnerability exists in ANGLE's Metal backend due to insufficient validation of the mipmap level range when creating texture views. Specifically, in TextureMtl::createViewFromBaseToMaxLevel(), the code attempts to compute a valid maxLevel but fails to account for cases where the effective base level exceeds the native storage's maximum supported level.
In third_party/angle/src/libANGLE/renderer/metal/TextureMtl.mm:
angle::Result TextureMtl::createViewFromBaseToMaxLevel()
{
ASSERT(mNativeTextureStorage);
uint32_t maxLevel =
std::min(mNativeTextureStorage->getMaxSupportedGLLevel(), mState.getEffectiveMaxLevel());
// In edge case where base level > max level, clamp up to base level.
maxLevel = std::max(maxLevel, mState.getEffectiveBaseLevel());
...
else
{
uint32_t baseToMaxLevels = maxLevel - mState.getEffectiveBaseLevel() + 1;
nativeViewFromBaseToMaxLevelRef =
mNativeTextureStorage->createMipsView(mState.getEffectiveBaseLevel(), baseToMaxLevels);
}
}
When a texture is backed by an egl::Surface (such as an IOSurface SharedImage), TextureMtl::bindTexImage() sets mBoundSurface. This causes TextureMtl::isImmutableOrPBuffer() to return true. When a user changes the texture's parameters, TextureMtl::onBaseMaxLevelsChanged() avoids reallocating the underlying native texture and directly calls createViewFromBaseToMaxLevel().
If the attacker sets GL_TEXTURE_BASE_LEVEL to a value N that is greater than the IOSurface's getMaxSupportedGLLevel() (which is 0, since IOSurfaces only have 1 mip level), maxLevel is improperly clamped up to N. This results in baseToMaxLevels being calculated as 1, and a call to createMipsView(N, 1) is issued.
This call propagates to mtl::Texture::createMipsView, which creates an Objective-C NSRange using the out-of-bounds base level: NSMakeRange(N, 1). The resulting range is passed to the Apple Metal API -[MTLTexture newTextureViewWithPixelFormat:textureType:levels:slices:]. Apple's documentation requires that levels.location + levels.length <= parent.mipmapLevelCount. Violating this precondition results in undefined behavior at the driver level, often returning an aliased texture view pointing to adjacent, unowned GPU memory.
Potential Exploitation Steps
Note: These are suggested theoretical steps, as our tooling agent does not currently have the ability to execute code or build a working proof-of-concept.
- From a compromised macOS renderer process, use the
CreateSharedImageIPC to allocate aSharedImagebacked by an IOSurface, requestingSHARED_IMAGE_USAGE_GLES2_READusage. - Issue a
CreateAndTexStorage2DSharedImageINTERNALcommand to map theSharedImageto aGL_TEXTURE_2Dtexture ID. - Issue a
BeginSharedImageAccessDirectCHROMIUMcommand on this texture ID. This binds the IOSurface to the GL texture in ANGLE, settingmBoundSurface. - Issue a
TexParametericommand to setGL_TEXTURE_BASE_LEVELto a non-zero value (e.g., 5). Because the surface is bound, ANGLE takes the immutable path and creates an out-of-bounds Metal texture view (NSMakeRange(5, 1)). - Bind the texture to a texture unit and compile a WebGL fragment shader that samples from it using
sampler2D. - Issue a draw call to a WebGL framebuffer. The GPU fragment shader samples from the out-of-bounds texture view, reading adjacent GPU heap memory.
- Call
glReadPixels()on the framebuffer to read the leaked GPU memory back into the compromised renderer process, completing the cross-origin information leak.
Impact
This vulnerability allows a compromised renderer to trigger an out-of-bounds read in the GPU process. Depending on the macOS Metal driver's handling of the invalid NSRange, the driver may return a texture view that aliases adjacent GPU heap memory. Sampling from this view allows an attacker to read cross-origin or cross-process memory, resulting in a high-severity Information Leak.
Suggested Fix
In TextureMtl::createViewFromBaseToMaxLevel(), validate that the effective base level does not exceed the native storage's maximum supported level before attempting to create the view. If mState.getEffectiveBaseLevel() > mNativeTextureStorage->getMaxSupportedGLLevel(), the code should safely clamp the effective base level to the maximum supported level, or safely fallback to a 1x1 default texture if the base level is completely out of bounds for the current storage.
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 code clamps the maximum mipmap level up to the base level without checking that the base level is within the native storage's supported range, so an out-of-bounds range is passed to the Metal API.
Impact
A compromised renderer could trigger an out-of-bounds read in the GPU process, potentially leaking cross-origin or cross-process memory on macOS, though the text notes the driver's handling of the invalid range determines whether an aliased view is returned.
What the attacker needed
Compromised macOS renderer process; IOSurface-backed SharedImage support; macOS Metal driver
The fix
The code should validate that the effective base level does not exceed the native storage's maximum supported level, clamping it or falling back to a safe default texture.
How it was found
- From a compromised macOS renderer process, allocate an IOSurface-backed SharedImage with GLES2 read usage via IPC.
- Map the SharedImage to a GL_TEXTURE_2D texture ID using the internal command.
- Bind the IOSurface to the GL texture with BeginSharedImageAccessDirectCHROMIUM, setting mBoundSurface.
- Set GL_TEXTURE_BASE_LEVEL to a non-zero value with TexParameteri, causing an out-of-bounds Metal texture view.
- Bind the texture and compile a WebGL fragment shader that samples from it.
- Draw to a WebGL framebuffer and call glReadPixels to read leaked GPU memory back into the renderer.
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.
A texture is an image used by the graphics card, and it can have smaller copies called mipmaps. The code that prepares these copies did not check that the requested starting copy actually exists, so it asked the graphics driver for a range outside the texture. The driver may then hand back a view into nearby memory, letting a malicious program read data it should not see.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.