Skip to content
Memory corruption Advisory Advanced CVE-2026-87621

Out of bounds write in ANGLE (CVE-2026-87621)

ANGLE's D3D11 backend only used debug-only assertions to check that a destination mipmap level in texture copy operations fits within the allocated D3D11 storage. In release builds, an out-of-bounds level could produce a spec-invalid subresource index passed to the driver, potentially causing out-of-bounds GPU memory writes.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 51 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: In ANGLE's D3D11 backend, destination mipmap level boundaries during texture copies are guarded against the underlying D3D11 storage levels solely by debug-only ASSERTs. In release builds, this allows an out-of-bounds destination level to calculate a spec-invalid subresource index, which is passed directly to ID3D11DeviceContext::CopySubresourceRegion. This results in undefined driver behavior and potentially out-of-bounds GPU memory writes within the GPU process.

Affected files:

  • third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp
  • third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
  • third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp

Estimated timestamp from git blame: 2018-04-12

  1. Summary of the Issue (Meant for Human Triage)

In ANGLE's D3D11 backend, the TextureD3D_Cube and TextureD3D_2D texture copy methods (copyTexture and copySubTexture) rely on a debug-only ASSERT to ensure that the user-supplied destination mipmap level (destLevel) fits within the limits of the allocated D3D11 texture storage (mTexStorage).

During front-end API validation (ValidateCopyTextureCHROMIUM), destLevel is only bounded against implementation-defined global caps (e.g., caps.maxCubeMapTextureSize), rather than the destination texture's actual base dimensions. As a result, a validated API call can specify a destLevel that vastly exceeds the texture's actual allocated mipmap storage.

In release builds, the ASSERT macro expands to a no-op. On the D3D11 fast-path (when texture formats match and no flip is required), the out-of-bounds destLevel proceeds to Renderer11::copyTexture. There, it calculates a subresource index via the D3D11CalcSubresource macro. This produces a subresource index far beyond the allocated bounds. This index is passed directly to ID3D11DeviceContext::CopySubresourceRegion. Per the DirectX 11 specification, the runtime does not validate destination subresource indices on this call for performance reasons. This passes a spec-invalid index directly to the User-Mode Driver (UMD), leading to undefined behavior and potential out-of-bounds memory writes into driver-managed GPU memory allocations.

(Note: The steps and exploitation scenarios described below are potential and theoretical, as our automated tooling agent does not have the ability to execute live code or driver-level PoCs.)


  1. Proof-of-Concept & Detailed Execution Flow

Theoretical Attacker Steps to Trigger the Vulnerability

The attacker can initiate this flow either via a compromised renderer process sending forged IPCs, or potentially via WebGL2 texImage2D manipulating an accelerated canvas source (A-SERVER).

  1. Destination Texture Creation: The attacker creates a cube map texture with a small base size. For example, gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, data). This defines a 4x4 RGBA8 image.
  2. Source Texture Creation: The attacker initializes a 1x1 source texture. For example, gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data).
  3. Trigger Command: The attacker issues a CopyTextureCHROMIUM command targeting an out-of-bounds dest_level. Parameters: source_id=src, source_level=0, dest_target=TEXTURE_CUBE_MAP_NEGATIVE_Z, dest_id=cube, dest_level=10, unpack_flip_y=0.

Step-by-Step Execution Flow

  1. Front-End Validation Gap: The command reaches third_party/angle/src/libANGLE/validationES2.cpp:ValidateCopyTextureCHROMIUM. It calls IsValidCopyTextureDestinationLevel, which checks the destLevel against global capabilities:

    C++
    // validationES2.cpp:268-270
    case TextureType::CubeMap:
        return width <= (caps.maxCubeMapTextureSize >> level) &&
               height <= (caps.maxCubeMapTextureSize >> level);
    

    Since caps.maxCubeMapTextureSize is 16384 on D3D11, 16384 >> 10 = 16. The source width (1) is <= 16, so validation incorrectly succeeds despite the destination texture's base size only being 4x4.

  2. Backend Processing & Redefinition: Execution proceeds to TextureD3D_Cube::copyTexture (third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp:2123). It calls redefineImage with level=10. This successfully defines mImageArray[5][10] on the host without overflowing, as mImageArray is a statically sized std::array containing IMPLEMENTATION_MAX_TEXTURE_LEVELS (16) slots.

  3. Storage Allocation: The render-target fast path evaluates canCreateRenderTargetForImage to true and calls ensureRenderTarget(context). Since mTexStorage is initially null, this triggers initializeStorage -> createCompleteStorage. Storage size is computed based on the base-level image (4x4), resulting in mMipLevels = log2(4) + 1 = 3. The TextureStorage11_Cube is instantiated with 6 faces and 3 mips (18 subresources total).

  4. The Flawed Release-Build Guard: Execution returns to TextureD3D_Cube::copyTexture:

    C++
    // TextureD3D.cpp:2154-2156
    ANGLE_TRY(ensureRenderTarget(context));
    ASSERT(isValidFaceLevel(faceIndex, index.getLevelIndex()));
    ANGLE_TRY(updateStorageFaceLevel(context, faceIndex, index.getLevelIndex()));
    

    The only bounds check ensuring destLevel < mTexStorage->getLevelCount() is the ASSERT(isValidFaceLevel(faceIndex, index.getLevelIndex())). In production release builds, this expands to a no-op, allowing the out-of-bounds destLevel = 10 to bypass safety checks.

  5. Subresource Calculation Sink: The out-of-bounds level is passed to Renderer11::copyTexture (third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp). The fast-path conditions are met (!unpackFlipY and matching formats). It calculates the subresource index via destStorage11->getSubresourceIndex:

    C++
    // TextureStorage11.cpp:213-225
    UINT mipSlice = static_cast<UINT>(index.getLevelIndex() + mTopLevel);   // 10
    UINT arraySlice = static_cast<UINT>(...);  // 5 (Negative Z)
    UINT subresource = D3D11CalcSubresource(mipSlice, arraySlice, mMipLevels);  // 10 + 5 * 3 = 25
    

    The computed subresource 25 greatly exceeds the 18 subresources actually allocated.

  6. Undefined Behavior Execution:

    C++
    // Renderer11.cpp:2696
    mDeviceContext->CopySubresourceRegion(
        destResource->get(), destSubresource, destOffset.x, destOffset.y, destOffset.z,
        sourceResource->get(), sourceSubresource, &d3dBox);
    

    The DstSubresource = 25 is passed directly to the D3D11 driver. This induces undefined driver behavior and potential out-of-bounds GPU memory writes.

Potential Fix

Replace the debug-only ASSERT in TextureD3D_Cube::copyTexture, TextureD3D_Cube::copySubTexture, TextureD3D_2D::copyTexture, and TextureD3D_2D::copySubTexture with actual runtime checks.

C++
if (!isValidFaceLevel(faceIndex, index.getLevelIndex()))
{
    return angle::Result::Stop; // Or emit GL_INVALID_VALUE / internal error
}

Alternatively, ValidateCopyTextureCHROMIUM should strictly evaluate destLevel against the initialized bounds of the target texture if it is already allocated, rather than relying exclusively on global caps.maxCubeMapTextureSize.


  1. Technical Verification Details (Automated Audit Logs - Reviewers may skip this section)

The report accurately identifies a validating-layer gap in ANGLE's D3D11 backend. Front-end validation (ValidateCopyTextureCHROMIUM / ValidateCopySubTextureCHROMIUM) bounds destLevel against global caps rather than the destination texture's actual base-level dimensions. In TextureD3D_Cube::copyTexture and TextureD3D_2D, the destination level's bound against the allocated D3D11 storage levels is only guarded by a debug-only ASSERT(isValidFaceLevel(...)). In release builds, this is a no-op, allowing an out-of-bounds destLevel to flow into D3D11CalcSubresource, generating an out-of-bounds destSubresource index.

Applying the KB 'GPU/media driver-sink triage' checklist: (a) Validation function ValidateCopyTextureCHROMIUM misses the parameter bound check against the texture's true mip levels. (b) The backend call site is mDeviceContext->CopySubresourceRegion in Renderer11.cpp (fast-path). (c) The DstSubresource parameter is explicitly listed as a bounds-bearing parameter in the KB triage table. Since (a), (b), and (c) hold from source, this qualifies for S1 per the GPU validating-layer gap row.

Severity calculation:

  • The vulnerability is reachable via A-SERVER (WebGL texImage2D with an accelerated canvas source) or A-RENDERER.
  • The D3D11 backend is Windows-only, so it is rated on Windows.
  • The GPU process is sandboxed on Windows, so memory corruption ceilings at High (S1).
  • The previous critic downgraded to S2 because 'driver behavior varies', but the guidelines explicitly state that 'requires a specific driver version/vendor' or 'majority of drivers tolerate it' is NOT a downgrade factor. If the (a)/(b)/(c) test passes and it ships on >=1 platform, we rate at that platform's tier.

Probability of being real and exploitable: 100%. The code trace is completely accurate, and the missing validation allows a spec-invalid index to trigger undefined driver behavior.

Codebase Investigator Verification Logs:

  • ValidateCopyTextureCHROMIUM Flow Verified: Extensively checked third_party/angle/src/libANGLE/validationES2.cpp (lines 3533-3662) and IsValidCopyTextureDestinationLevel (lines 251-274). The validator confirmed destLevel is exclusively verified against caps.maxCubeMapTextureSize >> level without factoring in actual dest dimensions, precisely aligning with the vulnerability claim.
  • Storage and ASSERT Interaction Verified: Analyzed TextureD3D.cpp (TextureD3D_Cube::copyTexture). redefineImage releases storage if level >= storageLevels, but then createCompleteStorage rebuilds it matching the base-level size, meaning the storage level count remains strictly 3 for a 4x4 image. Confirmed the only boundary gate protecting the D3D call from destLevel=10 is ASSERT(isValidFaceLevel(...)).
  • D3D11CalcSubresource Context Verified: Traced TextureStorage11::getSubresourceIndex usage of mMipLevels. mMipLevels is set via TextureStorage11_Cube constructor as mTopLevel + levels (e.g., 3). Passing a destLevel of 10 deterministically produces an OOB destSubresource parameter calculation.
  • Architectural Bounds: Confirmed host bounds are safe because mImageArray sizes dynamically pad to IMPLEMENTATION_MAX_TEXTURE_LEVELS = 16, ensuring no host heap overflow occurs despite the backend driver overflow.

Evaluated with Chrome root at commit: b96d2ec58f4f5f92b540a723966b199d6e9951b4


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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 front-end validation only bounded the destination level against global capability limits rather than the destination texture's actual allocated mip levels, and the backend relied on a debug-only assertion for the real bound.

Impact

This could lead to undefined driver behaviour and potentially out-of-bounds GPU memory writes within the GPU process, though the report notes the exploitation scenarios are theoretical and the GPU process is sandboxed on Windows.

What the attacker needed

Windows with D3D11 backend; Ability to issue WebGL or IPC commands; No live PoC executed

The fix

The debug-only assertions should be replaced with runtime checks that reject invalid destination levels, or front-end validation should check against the destination texture's actual bounds.

How it was found

  1. Create a small cube map texture as the destination.
  2. Create a 1x1 source texture.
  3. Issue a CopyTextureCHROMIUM command with an out-of-bounds destination level.
  4. The front-end validation passes because it only checks global caps.
  5. The backend assertion is a no-op in release builds, so the out-of-bounds level reaches subresource calculation.
  6. The invalid subresource index is passed to CopySubresourceRegion, causing undefined driver behaviour.

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 copies part of one texture to another, it must check that the destination level exists. Here, that check was only active in debug builds, so in normal builds a bad level number could slip through and be handed to the graphics driver. The driver may then write outside the intended memory, which is dangerous.

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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.