Insufficient validation of untrusted input in Skia (CVE-2026-13781)
When the GPU process deserialises SkPicture-backed glyph drawables, the deserialisation settings leave the typeface stream callback unset, so Skia falls back to parsing embedded font bytes directly. A compromised renderer could therefore push raw, unsanitised font data into in-process font parsers such as FreeType, bypassing the intended font-parsing isolation boundary.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 37 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: When deserializing SkPicture-backed glyph drawables, the GPU process uses deserialization procs that leave the typeface stream proc as null. This potentially allows a compromised renderer to bypass font-parsing isolation boundaries by embedding raw font bytes inside serialized SkPictures. This fallback mechanism dispatches the untrusted stream directly to in-process font engines such as FreeType.
Affected files:
third_party/skia/src/core/SkGlyph.cppthird_party/skia/src/core/SkPictureData.cppgpu/command_buffer/service/raster_decoder.ccgpu/command_buffer/service/service_font_manager.ccthird_party/skia/src/text/gpu/SkChromeRemoteGlyphCache.cppthird_party/skia/src/core/SkStrike.cppthird_party/skia/src/core/SkTypeface.cpp
Estimated timestamp from git blame: 2022-02-08
Potential Security Boundary Bypass in GPU Font Deserialization
Summary
There is a potential security boundary bypass in the OOP-rasterization path. A compromised renderer could potentially bypass the font-parsing isolation boundary and pass raw, unsanitized font bytes directly to in-process font parsers (like FreeType) running inside the GPU process. This bypasses the intended SkTypefaceProxy design, which is structured to ensure that typeface data crosses the process boundary solely as metadata while glyphs arrive pre-rasterized.
Mechanism and Code Walkthrough
When the GPU-side out-of-process (OOP) raster strike client deserializes a glyph drawable, it constructs an SkPicture from renderer-supplied bytes via SkPictureBackedGlyphDrawable::MakeFromBuffer (third_party/skia/src/core/SkGlyph.cpp, line 37).
SkDeserialProcs procs;
procs.fAllowSkSL = false;
sk_sp<SkPicture> picture = SkPicture::MakeFromData(pictureData.get(), &procs);
However, procs.fTypefaceStreamProc is left as nullptr.
During deserialization in SkPictureData::parseStreamTag (third_party/skia/src/core/SkPictureData.cpp, line 340), when handling the SK_PICT_TYPEFACE_TAG section, the code checks if a custom deserialization proc is present:
if (procs.fTypefaceStreamProc) {
tf = procs.fTypefaceStreamProc(*stream, procs.fTypefaceCtx);
} else {
tf = SkTypeface::MakeDeserialize(stream, nullptr); // <-- Fallback
}
Because fTypefaceStreamProc is null, Skia falls back to calling SkTypeface::MakeDeserialize(stream, nullptr) directly on the untrusted stream. This method parses an SkFontDescriptor containing an embedded font-stream blob and an attacker-controlled factoryId, and dispatches it directly to one of the compiled-in decoders, such as FreeType (SkTypeface_FreeType::MakeFromStream at third_party/skia/src/ports/SkFontHost_FreeType.cpp, line 2047).
This behavior exposes the GPU process to raw font parsing of attacker-controlled files. On platforms like Android where the GPU process is unsandboxed, a parser-level vulnerability (e.g., in FreeType) could lead to a direct sandbox escape.
Potential Attack Path
(Note: These are suggested steps based on static code analysis; our tools cannot execute code or verify this with a live PoC)
- A compromised renderer prepares a malicious
SkPicturepayload containing anSK_PICT_TYPEFACE_TAGentry with an embedded, malformed font stream. - The renderer transmits this payload inside an OOP-raster command via the
glRasterCHROMIUMshared memory font transfer buffer. - The GPU process processes the command and invokes
ServiceFontManager::Deserializeto ingest the strike data. - The strike client processes drawable glyphs, calling
SkPictureBackedGlyphDrawable::MakeFromBuffer. - During picture deserialization, Skia falls back to
SkTypeface::MakeDeserializebecause nofTypefaceStreamProcis set. - The embedded stream is matched against FreeType or other registered decoders, parsing the malformed font bytes in the GPU process context.
Suggested Remediation
To prevent fallback typeface deserialization, SkPictureBackedGlyphDrawable::MakeFromBuffer should explicitly register a restrictive fTypefaceStreamProc callback inside its SkDeserialProcs struct that rejects raw stream deserialization or returns an empty typeface, ensuring that untrusted font bytes are never dispatched to in-process font parsers.
Evaluated with Chrome root at commit: a2bea94528f4bd6cc57739c43fa3bb890b8367d3
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 deserialisation procs used for glyph drawables leave fTypefaceStreamProc null, so Skia falls back to SkTypeface::MakeDeserialize on renderer-supplied bytes instead of rejecting them.
Impact
A compromised renderer could reach a parser-level flaw in an in-process font engine, and on platforms where the GPU process is unsandboxed this could lead to a sandbox escape; the report is based on static analysis and no live proof of concept was run.
What the attacker needed
Compromised renderer; OOP rasterisation path in use; GPU process unsandboxed for escape
The fix
MakeFromBuffer should register a restrictive typeface stream callback that rejects raw stream deserialisation or returns an empty typeface, so untrusted font bytes never reach in-process parsers.
How it was found
- A compromised renderer builds a malicious SkPicture containing a typeface tag with an embedded malformed font stream.
- The renderer sends it inside an OOP-raster command through the shared memory font transfer buffer.
- The GPU process handles the command and calls ServiceFontManager::Deserialize on the strike data.
- The strike client processes drawable glyphs and calls SkPictureBackedGlyphDrawable::MakeFromBuffer.
- With no typeface stream proc set, Skia falls back to SkTypeface::MakeDeserialize.
- The embedded stream is matched against FreeType or another decoder and the malformed font bytes are parsed in the GPU process.
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.
Browsers split work across processes so that a hacked web page renderer cannot easily harm the rest of the system. Normally font data is meant to be checked in one place and only safe results passed onward. Here a missing setting meant the GPU process would parse font data supplied by the renderer itself, so a bug in the font parser could be reached from the less trusted side.
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.