Type Confusion in ANGLE (CVE-2026-17687)
ANGLE's Vulkan backend can resolve a wrapped external VkImage to a fallback format of a different class when the driver lacks full support for the original format, then create an image view with that mismatched format on an image created without mutable format flags. A compromised renderer could request a SharedImage that leads to this state, and depending on driver behaviour this could cause out-of-bounds GPU memory reads and writes.
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: ANGLE's Vulkan backend can resolve a wrapped external VkImage to a mismatched fallback format when full format capabilities are not supported by the driver. This leads to the creation of a VkImageView with an incompatible format class on an image created without mutable format flags, violating Vulkan specifications and potentially causing GPU-process memory corruption. This issue can potentially be triggered by a compromised renderer process via GLES2 SharedImage requests.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/VkImageImageSiblingVk.cpp
Estimated timestamp from git blame: 2021-12-03
Root Cause Analysis
In third_party/angle/src/libANGLE/renderer/vulkan/VkImageImageSiblingVk.cpp, VkImageImageSiblingVk::initImpl wraps an external VkImage and resolves its actual internal format using ANGLE's driver-specific fallback table instead of enforcing compatibility with the original format:
// third_party/angle/src/libANGLE/renderer/vulkan/VkImageImageSiblingVk.cpp
angle::Result VkImageImageSiblingVk::initImpl(DisplayVk *displayVk)
{
const angle::FormatID formatID = vk::GetFormatIDFromVkFormat(mVkImageInfo.format);
...
const vk::Format &vkFormat = renderer->getFormat(formatID);
const vk::ImageFormatSupport formatSupport = isRenderable(nullptr)
? vk::ImageFormatSupport::Renderable
: vk::ImageFormatSupport::SampleOnly;
angle::FormatID actualImageFormatID = vkFormat.getActualImageFormatID(formatSupport);
...
mImage->init2DWeakReference(displayVk, mVkImage.release(), getSize(), false, intendedFormatID,
actualImageFormatID, mVkImageInfo.flags, mVkImageInfo.usage, 1,
kIsRobustInitEnabled, imageFormats);
When importing a VkImage created with VK_FORMAT_R4G4B4A4_UNORM_PACK16 (16-bit, 2 bpp), if the underlying Vulkan driver supports the format for attachment usage but lacks full blending or filtering support, vkFormat.getActualImageFormatID(formatSupport) resolves to the fallback format VK_FORMAT_R8G8B8A8_UNORM (32-bit, 4 bpp) based on the mapping defined in vk_format_table_autogen.cpp:
static constexpr ImageFormatInitInfo kInfo[] = {
{angle::FormatID::R4G4B4A4_UNORM, nullptr},
{angle::FormatID::R8G8B8A8_UNORM, nullptr},
};
This mismatched format is stored as mActualFormatID in the ImageHelper instance. Consequently, during subsequent rendering or sampling operations, ANGLE creates image views targeting the underlying VkImage using mActualFormatID via initLayerImageViewImpl:
angle::Result ImageHelper::initLayerImageViewImpl(...) const {
VkImageViewCreateInfo viewInfo = {};
viewInfo.image = mImage.getHandle(); // Underlying R4G4B4A4 image
viewInfo.format = imageFormat; // VK_FORMAT_R8G8B8A8_UNORM
Because the underlying VkImage was allocated without VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT (and since R4G4B4A4 and R8G8B8A8 belong to entirely different, incompatible format classes), this directly violates VUID-VkImageViewCreateInfo-image-01762 and VUID-VkImageViewCreateInfo-image-01761.
Depending on how the underlying Vulkan driver handles image views and memory strides, sampling or rendering through this mismatched view can cause out-of-bounds GPU memory reads and writes, potentially leading to memory corruption or a GPU process compromise.
Potential Trigger Path
An attacker in control of a compromised renderer process could potentially trigger this issue through the following sequence:
- The compromised renderer requests a SharedImage with
format = viz::SinglePlaneFormat::kRGBA_4444andusagecontaining GLES2 read/write flags. - In the GPU process,
AngleVulkanImageBackingFactorycreates aVulkanImageusing the formatVK_FORMAT_R4G4B4A4_UNORM_PACK16andflags = 0(no mutable format bit). - During GL representation initialization,
InitializePassthroughTexturecallsCreateEGLImagewith the native image metadata. - Inside ANGLE,
DisplayVk::createExternalImageSiblinginstantiates aVkImageImageSiblingVkto wrap the importedVkImage. - On affected Vulkan drivers where
R4G4B4A4_UNORMlacks full support (e.g. failingHasFullTextureFormatSupport),VkImageImageSiblingVk::initImplresolvesactualImageFormatIDtoVK_FORMAT_R8G8B8A8_UNORM. - When the renderer performs sampling or drawing operations on the texture, ANGLE invokes
vkCreateImageViewusing the mismatchedVK_FORMAT_R8G8B8A8_UNORMformat on the 16-bitR4G4B4A4image, triggering undefined driver behavior.
Note: These steps are based on static analysis of the codebase and represent a potential execution flow, as our tooling environment does not currently have the capability to compile or run proof-of-concept exploit code.
Suggested Remediation
When wrapping an external VkImage via VkImageImageSiblingVk, ANGLE cannot alter the physical allocation or creation flags of the underlying image. Therefore, ANGLE must not fallback to an incompatible format class during initImpl if the driver does not support the requested capabilities for the original format.
The initialization in VkImageImageSiblingVk::initImpl should be updated to ensure the resolved actualImageFormatID is strictly compatible with the format of the external VkImage. If the driver's capabilities prevent utilizing the image's original format, the method should return VK_ERROR_FORMAT_NOT_SUPPORTED or a similar failure code gracefully, rather than continuing with an invalid, mismatched configuration.
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 wrapping code substitutes a driver fallback format without checking that it is compatible with the original format of the external image, and the image was created without the mutable format flag that would permit such a change.
Impact
Depending on how the driver handles image views and memory strides, sampling or rendering through the mismatched view could cause out-of-bounds GPU memory reads and writes and potentially a GPU process compromise; the steps are from static analysis only and no proof of concept was run.
What the attacker needed
Compromised renderer process; Vulkan driver lacking full format support
The fix
The wrapping code should ensure the resolved actual format is strictly compatible with the external image's format and return a format-not-supported error instead of continuing with a mismatched configuration.
How it was found
- A compromised renderer requests a SharedImage in a 16-bit RGBA format with GLES2 read and write usage.
- The GPU process creates a Vulkan image in that format with no mutable format flag.
- During GL initialisation, an EGL image is created from the native image metadata.
- ANGLE wraps the imported image in an external image sibling object.
- On drivers lacking full support for the format, the sibling resolves the actual format to a 32-bit RGBA fallback.
- When the renderer samples or draws, an image view is created with the mismatched format on the 16-bit image.
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 takes an image supplied by another part of the browser and describes it to the graphics driver. When the driver cannot fully support the image's original pixel layout, the code silently swaps in a different layout that uses twice as many bits per pixel. The driver is then told to read the smaller image as if it were the larger one, which can make it read or write past the end of the memory it was given.
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.