Insufficient validation of untrusted input in Skia (CVE-2026-14429)
A compromised renderer could deserialize a forged SDFTSubRun with a mask format of kARGB, causing a stride mismatch between the GPU geometry processor and the CPU vertex filler. This leaves uninitialized memory from a shared GPU staging buffer pool that is uploaded and rendered, potentially leaking cross-origin graphics data.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 25 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: A compromised renderer can potentially deserialize a forged SDFTSubRun with a mask format of kARGB, which is normally reserved for color bitmap text. This causes a stride mismatch between the geometry processor (which expects a 16-byte or 20-byte stride) and the CPU-side vertex filler (which writes 12-byte or 16-byte structs). As a result, uninitialized memory from a shared GPU-process staging buffer pool is uploaded and rendered to the GPU, potentially leaking cross-origin graphics data.
Affected files:
third_party/skia/src/text/gpu/SubRunContainer.cppthird_party/skia/src/gpu/ganesh/ops/AtlasTextOp.cppthird_party/skia/src/gpu/ganesh/text/GlyphData.cpp
Estimated timestamp from git blame: 2022-02-23
Detailed Description
A security vulnerability potentially exists in Skia's Ganesh text-rendering pipeline when deserializing Slug objects from a compromised renderer. Specifically, the deserialization of SDFTSubRun does not validate that the maskFormat is restricted to kA8. This leads to a mismatch between the GPU vertex stride (defined by the Geometry Processor) and the CPU-side vertex fill stride, resulting in an uninitialized memory disclosure from the GPU process.
Analysis of the Root Cause
-
Deserialization Validation Deficit: In
third_party/skia/src/text/gpu/SubRunContainer.cpp,SDFTSubRun::MakeFromBufferis used to deserialize SDF subruns from an untrusted renderer:C++ static SubRunOwner MakeFromBuffer(SkReadBuffer& buffer, ...)It reads the
VertexFillerusingmake_vertex_filler_from_buffer:C++ MaskFormat maskFormat = buffer.read32LE(MaskFormat::kLast);Since
MaskFormat::kLastisMaskFormat::kARGB(value 2), a compromised renderer can supplykARGBand pass deserialization. The constructor ofSDFTSubRuncontains only a debug-only assertion (SkASSERT) checking thatmaskFormat == MaskFormat::kA8, which is compiled out of release/production builds of Chrome. -
GPU Allocation (16-Byte Stride): When drawing the subrun,
AtlasTextOp::Makeexecutes. BecauseglyphParams().isSDFis unconditionally true for anSDFTSubRun, it routes to the distance-field path.AtlasTextOpbuilds aGrDistanceFieldA8TextGeoProcwhose vertex layout is unconditionally composed of:inPosition: 8 bytes (kFloat2_GrVertexAttribTypefor non-perspective)inColor: 4 bytes (kUByte4_norm_GrVertexAttribType)inTextureCoords: 4 bytes (kUShort2_GrVertexAttribType)
This results in a total vertex stride of exactly 16 bytes (or 20 bytes if perspective is active). The vertex buffer is then allocated from the shared pool
GrVertexBufferAllocPoolusing this 16-byte stride. -
CPU Fill (12-Byte Stride): During the draw preparation,
GlyphData::fillVertexDatahandles the vertex data population on the CPU side. It determines the struct size based onvf.maskFormat():C++ if (!positionMatrix.hasPerspective()) { if (vf.maskFormat() == MaskFormat::kARGB) { using Quad = ARGB2DVertex[4]; ...Because the attacker forged
maskFormattokARGB, the code usesARGB2DVertex, which is only 12 bytes in size (since theGrColorfield is discarded). Thus, Skia writes only 12 bytes per vertex but advances the buffer allocation index using the 16-byte stride requested by the geometry processor. -
Uninitialized Memory Leak: This mismatch leaves 4 bytes (or 8 bytes under perspective variations) uninitialized at the tail of each vertex. Because the vertex buffers are allocated with
ZeroInit::kNofrom a shared staging pool reused across multiple contexts and origins, these uninitialized bytes contain stale graphics data from prior draws. This stale data is uploaded to the GPU, rendered via the distance field shader, and can potentially be retrieved by the attacker via canvas readback (getImageData) or texture copying.
Potential Steps to Reproduce
Since our automated tooling does not currently have the capability to execute proof-of-concept code, these are theoretical steps demonstrating how an attacker could trigger the mismatch:
- From a compromised renderer, construct a serialized
DrawSlugOppaint-op. - In the
SDFTSubRunpayload, set theVertexFiller'smaskFormatfield to2(MaskFormat::kARGB). - Submit the paint op over the IPC channel to the GPU process to be rasterized into an OOP-R tile backing or an accelerated 2D canvas.
- Read back the rasterized output from the renderer side (e.g., via
CanvasRenderingContext2D.getImageData) and examine the returned pixel data for artifacts corresponding to leaked cross-origin GPU memory.
Suggested Fix
Validate the maskFormat inside SDFTSubRun::MakeFromBuffer in third_party/skia/src/text/gpu/SubRunContainer.cpp. If the format is not MaskFormat::kA8, the buffer should be marked invalid and deserialization should fail:
static SubRunOwner MakeFromBuffer(SkReadBuffer& buffer,
SubRunAllocator* alloc,
const SkStrikeClient* client) {
...
auto vertexFiller = make_vertex_filler_from_buffer(buffer, alloc, &glyphVector.value(),
skglyph::kSDFT, kGlyphInsetting);
if (!buffer.validate(vertexFiller.has_value())) { return nullptr; }
// Ensure the deserialized mask format is kA8 for SDFT subruns
if (!buffer.validate(vertexFiller->maskFormat() == MaskFormat::kA8)) { return nullptr; }
return alloc->makeUnique<SDFTSubRun>(useLCD,
isAntiAliased,
matrixRange,
std::move(*vertexFiller),
std::move(*glyphVector));
}
Evaluated with Chrome root at commit: e9507a33bb4148ee071aaaf8a7e9ad68770359bf
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 deserialization of SDFTSubRun does not validate that the mask format is kA8, allowing a forged kARGB value that causes a stride mismatch and uninitialized memory disclosure.
Impact
A compromised renderer could potentially leak cross-origin graphics data from uninitialized GPU memory, though the report notes the steps are theoretical and not yet executed.
What the attacker needed
Compromised renderer; ability to send IPC to GPU process
The fix
Validate the maskFormat inside SDFTSubRun::MakeFromBuffer and fail deserialization if it is not MaskFormat::kA8.
How it was found
- From a compromised renderer, construct a serialized DrawSlugOp paint-op.
- In the SDFTSubRun payload, set the VertexFiller's maskFormat field to 2 (MaskFormat::kARGB).
- Submit the paint op over the IPC channel to the GPU process to be rasterized into an OOP-R tile backing or an accelerated 2D canvas.
- Read back the rasterized output from the renderer side (e.g., via CanvasRenderingContext2D.getImageData) and examine the returned pixel data for artifacts corresponding to leaked cross-origin GPU memory.
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 web page draws text, the browser's renderer process sends instructions to a separate GPU process. This report says a malicious renderer could craft a special text instruction that makes the GPU process read leftover memory from previous drawings. That leftover memory might contain pixels from other websites, which the attacker could then read back.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.