Out of bounds read in Skia (CVE-2026-13820)
A logic error in Skia's Graphite backend allows a compromised renderer to cause an out-of-bounds GPU read by exploiting a 32-bit uniqueID wrap and missing size validation in a gradient data cache. This could leak sensitive cross-origin information from shared GPU buffers on macOS with GPU robustness disabled.
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 Skia's Graphite backend allows for a potential cross-origin information leak via a GPU out-of-bounds read. This is caused by de-duplicating gradient data using a 32-bit uniqueID that can wrap, without verifying the size of the cached allocation. On macOS with Graphite/Metal, where GPU robustness is disabled, a compromised renderer could potentially read sensitive data from shared GPU buffers.
Affected files:
third_party/skia/src/gpu/graphite/PipelineData.hthird_party/skia/src/shaders/SkShaderBase.cppthird_party/skia/src/gpu/graphite/KeyHelpers.cppthird_party/skia/src/sksl/sksl_graphite_frag.skslgpu/command_buffer/service/dawn_context_provider.cc
Estimated timestamp from git blame: 2025-08-15
Summary
A potential vulnerability in the gradient data management of Skia's Graphite backend can lead to an out-of-bounds (OOB) memory read on the GPU. This issue stems from a combination of a 32-bit identifier wrap and a lack of size validation in the FloatStorageManager cache. This can be leveraged by a compromised renderer process to leak sensitive information across origins from the GPU process.
Root Cause Analysis
The vulnerability exists in FloatStorageManager::allocateGradientData within third_party/skia/src/gpu/graphite/PipelineData.h. This class manages a cache of gradient allocations (fGradientOffsetCache) keyed by the shader's uniqueID to de-duplicate data within a single Graphite Recording session.
std::pair<float*, int> allocateGradientData(int numStops, const SkGradientBaseShader* shader) {
SkASSERT(!this->isFinalized());
int* existingOffset = fGradientOffsetCache.find(shader->uniqueID());
if (existingOffset) {
// VULNERABILITY: Returns cached offset without verifying numStops
return {nullptr, *existingOffset};
}
auto [ptr, offset] = this->allocateFloatData(numStops * 5);
fGradientOffsetCache.set(shader->uniqueID(), offset);
return {ptr, offset};
}
When a cache hit occurs, the manager returns the existing buffer offset. However, it does not verify that the previously allocated space at that offset is large enough to accommodate the numStops of the current shader request.
The uniqueID is generated by a 32-bit global atomic counter in third_party/skia/src/shaders/SkShaderBase.cpp. This counter will wrap around after 2^32 allocations, allowing two distinct shader objects to share the same ID. If both shaders are used within the same Graphite Recording, the second shader will reuse the first shader's allocation regardless of size.
Potential Exploitation Path
(Note: These are potential steps as a functional PoC has not yet been executed.)
- Shader Pinning: A compromised renderer triggers the creation of a gradient shader with a small number of stops (e.g., 2). This shader is assigned a
uniqueID(e.g.,K). The attacker ensures this shader is kept alive in the GPU process (e.g., via the Shader Transfer Cache). - ID Wrap: The renderer performs approximately 2^32 shader constructions to force the global atomic counter to wrap back to
K. This typically takes 1-2 hours of sustained IPC traffic. - Triggering Collision: Within a single drawing recording, the renderer first draws using the pinned small shader (filling the
FloatStorageManagercache with IDKat offsetO). It then triggers the creation of a new gradient shader with a large number of stops (e.g., 1024), which receives the collidinguniqueID = K. It then draws using this large shader. - OOB Memory Read: Due to the cache hit on ID
K, the large gradient is assigned the small allocation's offsetO. The fragment shader ($colorize_grad_bufinthird_party/skia/src/sksl/sksl_graphite_frag.sksl) uses the largenumStopsvalue (1024) to index into the storage buffer starting atO. Since the underlying allocation was only sized for 2 stops, the shader performs an OOB read.
Impact and Environment
This issue primarily affects Chrome on macOS where the Graphite backend (running on Dawn/Metal) is enabled. In this configuration, Chrome explicitly disables GPU robustness features (via the disable_robustness toggle in gpu/command_buffer/service/dawn_context_provider.cc). Consequently, the OOB read is not clamped by the driver, allowing the shader to read raw data from adjacent GPU buffers which may contain sensitive cross-origin information.
Suggested Fix
The FloatStorageManager should verify that a cached allocation is large enough for the current request, or include the numStops in the cache key.
// Suggested modification in PipelineData.h
int* existingOffset = fGradientOffsetCache.find(shader->uniqueID());
if (existingOffset) {
// Check if the current request is compatible with the previous allocation.
// This may require tracking the size of allocations in fGradientOffsetCache.
if (is_size_compatible) {
return {nullptr, *existingOffset};
}
}
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 gradient data cache returns a cached offset without checking that the allocation is large enough for the current request, and the 32-bit uniqueID can wrap to cause collisions.
Impact
On macOS with Graphite/Metal and GPU robustness disabled, a compromised renderer could read sensitive cross-origin data from adjacent GPU buffers.
What the attacker needed
Compromised renderer process; macOS with Graphite/Metal; GPU robustness disabled; sustained IPC traffic for 1-2 hours
The fix
The FloatStorageManager should verify that a cached allocation is large enough for the current request, or include numStops in the cache key.
How it was found
- Create a gradient shader with a small number of stops and keep it alive in the GPU process.
- Perform approximately 2^32 shader constructions to force the uniqueID counter to wrap back to the same ID.
- Within a single recording, draw using the pinned small shader to cache its offset.
- Create a new gradient shader with a large number of stops that receives the colliding uniqueID.
- Draw using the large shader, causing an out-of-bounds read due to the cache hit.
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 caches gradient data using a 32-bit ID that can wrap around after many uses. If two different gradients get the same ID, the second one may reuse a smaller buffer, causing the GPU to read beyond it. This could let an attacker who already controls the renderer process read data from other tabs.
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.