Inappropriate implementation in ANGLE (CVE-2026-17676)
ANGLE's Vulkan backend calculated a framebuffer's sample count using only enabled draw buffers, so calling glDrawBuffers(GL_NONE) on a framebuffer with a multisampled render-to-texture attachment cached the count as one. The resulting mismatch between the Vulkan render pass and framebuffer could cause driver-level memory corruption in the unsandboxed GPU process on Android.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 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 logic error in ANGLE's Vulkan backend leads to a sample count mismatch between VkRenderPass and VkFramebuffer when glDrawBuffers(GL_NONE) is used with Multisampled Render-to-Texture (MSRTT) attachments. This issue specifically affects Android devices utilizing MSRTT emulation on tile-based GPUs. The resulting Vulkan VUID violations may cause exploitable memory corruption in the unsandboxed GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_cache_utils.cppthird_party/angle/src/libANGLE/renderer/vulkan/TextureVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/RenderTargetVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cppthird_party/angle/src/libANGLE/Framebuffer.cpp
Estimated timestamp from git blame: 2021-03-09
Summary
A potential vulnerability has been identified in ANGLE's Vulkan backend where the sample count for a framebuffer is incorrectly calculated when draw buffers are disabled. Specifically, FramebufferVk::getSamplesImpl() derives the framebuffer's sample count by iterating only over enabled draw buffers. However, subsequent logic that populates the Vulkan RenderPass and Framebuffer attachments iterates over all color attachments in the mask, regardless of their draw buffer state.
When glDrawBuffers(GL_NONE) is called on a framebuffer with a Multisampled Render-to-Texture (MSRTT) attachment, the sample count is incorrectly cached as 1. This leads to a VkRenderPass where the attachment is declared with 1 sample, while a multisampled VkImageView (e.g., 4 samples) is bound to that same attachment in the VkFramebuffer. This mismatch results in undefined behavior in the GPU driver.
Technical Details
In third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp, the getSamplesImpl() function filters by the enabled draw buffer state:
// lines 4103-4114
for (size_t colorIndexGL : mState.getEnabledDrawBuffers() & mState.getColorAttachmentsMask())
{
const gl::FramebufferAttachment *color = mState.getColorAttachment(colorIndexGL);
if (color->isRenderToTexture())
{
return color->getSamples(); // Skipped if draw buffer is GL_NONE
}
lastAttachment = color;
}
When glDrawBuffers(GL_NONE) is set, mRasterizationSamples is cached as 1. However, updateRenderPassDesc still iterates over the full colorAttachmentMask to pack attachments (lines 2880-2911), leading to a VkRenderPass configuration that expects a single-sampled attachment. Simultaneously, updateAttachmentsAndRenderTargets binds the actual multisampled VkImageView to the framebuffer.
This results in several Vulkan Validation Layer (VUID) violations, including:
- VUID-VkFramebufferCreateInfo-pAttachments-00881: Bound
VkImageViewsample count does not matchVkAttachmentDescriptionsample count. - VUID-VkGraphicsPipelineCreateInfo-rasterizationSamples-06853: Pipeline
rasterizationSamplesdoes not match the bound attachment's sample count.
Impact
This issue is reachable from a compromised renderer process via standard GLES2 command buffer IPC. It affects the GPU process, which is unsandboxed on Android. On tile-based deferred rendering (TBDR) GPUs common in Android devices (Adreno, Mali, PowerVR), these metadata mismatches can lead to driver-level memory corruption during tile-to-memory operations, such as resolves. An attacker could potentially leverage this corruption to achieve code execution in the context of the GPU process.
Potential Reproduction Steps
Note: These are suggested steps; our analysis is based on code review.
- Use an Android device where ANGLE utilizes MSRTT emulation (typically those lacking
VK_EXT_multisampled_render_to_single_sampled). - Create a texture and an FBO.
- Attach the texture to the FBO using
glFramebufferTexture2DMultisampleEXTwith a sample count > 1. - Set draw buffers to
GL_NONEusingglDrawBuffers(1, {GL_NONE}). - Issue a draw call (e.g.,
glDrawArrays). - The resulting Vulkan calls will contain mismatched sample counts between the RenderPass and Framebuffer, triggering the violation.
Suggested Fix
Modify FramebufferVk::getSamplesImpl() in third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp to iterate over the entire mState.getColorAttachmentsMask() instead of intersecting it with mState.getEnabledDrawBuffers(). The physical structure of the RenderPass and Framebuffer should reflect the attached resources regardless of the current draw buffer enablement state.
Evaluated with Chrome root at commit: 1a8d40fc44df2088d5945c0bf53584038aa1614a
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 sample count was derived only from enabled draw buffers while the render pass and framebuffer attachments were built from all colour attachments, so disabling draw buffers produced inconsistent metadata.
Impact
An attacker who already controls the renderer process could potentially turn the driver-level memory corruption into code execution in the GPU process, which is unsandboxed on Android; the report notes the steps are suggested and based on code review, not a demonstrated exploit.
What the attacker needed
Android device with MSRTT emulation; control of the renderer process
The fix
The sample count calculation should consider all colour attachments rather than only the enabled draw buffers, so the render pass and framebuffer always agree.
How it was found
- Use an Android device where ANGLE emulates multisampled render-to-texture.
- Create a texture and a framebuffer object.
- Attach the texture with a sample count greater than one.
- Set the draw buffers to none.
- Issue a draw call.
- Observe mismatched sample counts between the render pass and framebuffer.
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 graphics library called ANGLE translates drawing commands into Vulkan, the low-level interface used to talk to the graphics chip. It described a framebuffer (the surface being drawn into) as having one sample while actually attaching a surface with several samples, which breaks the driver's assumptions. On Android the graphics driver runs without the usual sandbox, so a bug there is more serious than one in a normal app.
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.