Use after free in Skia (CVE-2026-91747)
Skia Graphite's multi-phase atlas regeneration incorrectly stamps the atlas generation without re-validating earlier glyphs, so a cached PaintRecord can cause stale UVs to be sampled. A compromised renderer could leak cross-origin glyph masks from the shared text atlas.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 50 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: Skia Graphite's multi-phase atlas regeneration incorrectly updates its generation stamp without re-validating previously placed glyphs, leading to stale UVs. A compromised renderer can trigger this by caching a PaintRecord to repeatedly draw the same GlyphData object on the shared GPU recorder. This forces a fast-path bypass that samples stale UV coordinates, potentially leaking cross-origin glyph masks from the shared text atlas.
Affected files:
third_party/skia/src/gpu/graphite/text/GlyphData.cppthird_party/skia/src/gpu/graphite/text/GlyphData.h
Estimated timestamp from git blame: Unknown (Google3 checkout)
1. Summary of the Issue (Meant for Human Triage)
A potential logic vulnerability exists in Skia Graphite's GlyphData::regenerateAtlas implementation (third_party/skia/src/gpu/graphite/text/GlyphData.cpp), which handles multi-phase text atlas generation. When an initial attempt to place glyphs exhausts the atlas, the operation suspends and resumes in a subsequent phase (begin > 0). If this resumed phase completes successfully, the code incorrectly stamps the GlyphData's fAtlasGeneration with the post-eviction atlas generation without re-validating the glyphs placed during the earlier phases. Crucially, earlier glyphs may have been evicted during the resumed phase.
Because this breaks the fAtlasGeneration == currentAtlasGen invariant, any subsequent draw of the exact same GlyphData object erroneously takes a fast path that skips hasGlyph liveness checks, emitting stale UV coordinates pointing to recycled atlas plots.
While a standard DrawSlugOp deserializes fresh per raster and prevents GlyphData reuse, an attacker in a compromised renderer can bypass this constraint. By embedding the DrawSlugOp inside a PaintShader of type kPaintRecord, the attacker can force the GPU process to cache the resulting SkPicture (and its underlying Slug/GlyphData). Because RasterDecoderImpl::DoRasterCHROMIUM inadvertently defaults enable_security_constraints to false during paint op deserialization, the GPU process permits the kPaintRecord type. Drawing this cached shader multiple times triggers the Skia fast-path flaw on the shared gpu_main_graphite_recorder_. This allows the attacker to sample from recycled text atlas plots populated by victim origins, leading to a cross-origin GPU-memory disclosure (SOP-bypass read primitive).
2. Proof-of-Concept & Detailed Execution Flow
Note: The following steps describe a potential attack sequence. Our tooling agent does not have the ability to run code to produce a live proof-of-concept, but this trace is confirmed against the source code.
- Attacker Payload Construction: A compromised renderer constructs a
PaintOpBufferIPC message intended for Out-Of-Process Rasterization (OOP-R). The buffer contains aDrawRectOputilizing aPaintFlagsobject configured with aPaintShader. - Nested
PaintRecord: The attacker sets thePaintShadertype toPaintShader::Type::kPaintRecordand provides a customshader_id. Inside thisPaintRecord, the attacker embeds aDrawSlugOpcontaining ansktext::gpu::Slugwith a massive number of distinct glyphs (gc). The countgcis chosen to exceed the capacity of all plots on all pages of the Graphite text atlas. - Missing Security Constraints: The IPC is received by
RasterDecoderImpl::DoRasterCHROMIUM(gpu/command_buffer/service/raster_decoder.cc). It callscc::PaintOp::Deserialize, which instantiates aPaintOpReader. BecauseRasterDecoderImpldoes not explicitly provide theenable_security_constraintsargument, it defaults tofalse(cc/paint/paint_op_reader.h:56). - Deserialization and Caching: In
PaintOpReader::Read(cc/paint/paint_op_reader.cc:697), thekPaintRecordtype is accepted becauseenable_security_constraints_isfalse. The reader callsPaintShader::ResolveSkObjects(), which usesToSkPictureto play back thePaintRecordinto anSkPicture. ThisSkPictureinherently retains the deserializedSlugobject.PaintOpReaderthen caches thisSkPictureon the GPU process viaoptions_.transfer_cache->CreateLocalEntryusing the attacker'sshader_id. - Phase-1 Atlas Generation: The first draw rasterizes the
DrawRectOp, evaluating the cachedSkPictureand callingDevice::drawAtlasSubRun. This invokesGlyphData::regenerateAtlas(0, gc).fAtlasGenerationiskInvalidGeneration, forcing the slow path. Glyphs[0, k)fill the atlas, and their plots are marked with flush tokenT1. Glyphkfails (kTryAgain).regenerateAtlasreturns{true, k}. - Inter-Phase Flush:
Device::drawAtlasSubRunflushes tracked devices, advancing the global flush token fromT1toT2(third_party/skia/src/gpu/graphite/Recorder.cpp:650). - Phase-2 Atlas Generation:
regenerateAtlas(k, gc)is called for the resumed phase. AtGlyphData.cpp:60,fBulkUseUpdater.reset()unconditionally discards the Phase-1 plot tracking. Placing glyphktriggers an LRU eviction. PlotP, holding the early[0, k)glyphs, haslastUseTokenT1 < T2, so it is evicted and recycled. The global atlas generation increments toG2. - Stale UV Generation Stamp: The Phase-2 loop completes. At
GlyphData.cpp:86-89, becausebegin + glyphsPlacedInAtlas == gc, the code incorrectly stampsfAtlasGenerationwithG2(the post-eviction generation) without re-validating the[0, k)glyphs. TheirGlyphEntry::fAtlasLocatorcoordinates now point to stale UVs in the recycled PlotP. - Victim Rendering: A victim origin (sharing the global
gpu_main_graphite_recorder_) draws text. Its glyph masks are placed into the recycled PlotP. The atlas generation remainsG2. - Fast-Path Trigger: The attacker sends a second
PaintOpBufferreferencing the sameshader_id.PaintOpReaderlooks up the cache and assigns the exact sameSkPicture(ref.sk_cached_picture_ = entry->shader()->sk_cached_picture_). - Cross-Origin Leak: Rasterizing the second draw invokes
regenerateAtlas(0, gc)on the sameGlyphDataobject. BecausefAtlasGeneration == G2 == currentAtlasGen, it takes the fast path (GlyphData.cpp:93-101), bypassing thehasGlyphcheck for the[0, k)glyphs.GlyphData::fillInstanceDatareads the stale UVs (glyph.entry().fAtlasLocator.getUVs()), sampling the victim's glyph masks from PlotP. The attacker reads the composited surface (getImageData()), achieving a cross-origin text leak.
Suggested Fix
- Skia (Graphite): In
third_party/skia/src/gpu/graphite/text/GlyphData.cpp:86-89, gate thefAtlasGenerationstamp onbegin == 0(so it only stamps if the entire run was validated in a single pass). Alternatively, re-run thehasGlyphcheck over[0, begin)before updatingfAtlasGeneration. Also, atGlyphData.cpp:60, gatefBulkUseUpdater.reset()onbegin == 0so tracking accumulates across resumed phases. - Chromium (cc/paint): In
gpu/command_buffer/service/raster_decoder.cc,DoRasterCHROMIUMshould explicitly passenable_security_constraints = truewhen constructing thecc::PaintOp::DeserializeOptionsor invokingcc::PaintOp::Deserialize, matching the strict constraints enforced elsewhere for untrusted IPC.
3. Technical Verification Details (Automated Audit Logs - Reviewers may skip this section)
The vulnerability report accurately identifies a logic flaw in Skia Graphite's
GlyphData::regenerateAtlasduring a multi-phase atlas regeneration. When resuming atbegin > 0, it incorrectly stampsfAtlasGenerationwith the post-eviction generation without re-validating the earlier glyphs. This causes subsequent redraws taking the fast path to use stale atlas UVs. ... Sincegpu_main_graphite_recorder_is shared across all origins/decoders, this bug causes the GPU to sample stale UVs from a recycled plot containing another origin's glyph masks. The attacker can extract these masks viagetImageData(). Per the severity guidelines, a cross-origin GPU-memory disclosure (SOP-tier read primitive) from a compromised renderer is High (S1) severity.
Codebase Investigator Verification Ledger:
- Missing Security Constraints: Checked
PaintOpBuffer::Deserialize->PaintOp::DeserializeIntoPaintOpBuffer->PaintOpReaderconstructor. Verified incc/paint/paint_op_reader.h:56thatenable_security_constraintsdefaults tofalse. Verified ingpu/command_buffer/service/raster_decoder.cc:2958-3100thatDoRasterCHROMIUMdoes not passtruefor this parameter when invokingpaint_op_buffer->Deserialize. - PaintRecord Serialization Bypass: Checked
cc/paint/paint_op_reader.cc:697. The checkif (enable_security_constraints_ && shader_type == PaintShader::Type::kPaintRecord)is bypassed becauseenable_security_constraints_is false. - Transfer Cache / SkPicture Persistence: Checked
cc/paint/paint_op_reader.cc:886-901.ResolveSkObjectscompiles thePaintRecordintosk_cached_picture_viaToSkPicture(cc/paint/paint_shader.cc:587). The reader caches this viaoptions_.transfer_cache->CreateLocalEntry(shader_id, ...). Re-reads using the sameshader_idfetch the identicalSkPicturecontaining theSlugobject. - Skia Multi-Phase Flaw: Verified
third_party/skia/src/gpu/graphite/text/GlyphData.cpp:57-102. The resetfBulkUseUpdater.reset()runs unconditionally at:60. The stampfAtlasGeneration = atlasManager->atlasGeneration(maskFormat)runs at:89even ifbegin > 0. The fast path at:93-101unconditionally returns withouthasGlyphvalidation. Stale UVs are sampled at:130viafAtlasLocator.getUVs(). - Cross-Origin Recorder: Verified
gpu/command_buffer/service/raster_decoder.cc:636-638andshared_context_state.h:369thatgpu_main_graphite_recorder_is shared across all decoders/origins, validating the SOP bypass vector.
Original Evidence File Citations (Preserved for Reference):
third_party/skia/src/gpu/graphite/text/GlyphData.cpp:57-90(fBulkUseUpdater.reset() and fAtlasGeneration assignment logic).third_party/skia/src/gpu/graphite/Device.cpp:1443-1482(multi-phase loop and flushTrackedDevices).third_party/skia/src/gpu/graphite/DrawAtlas.cpp:273-308(eviction logic and plot recycling).TextAtlasManager.h:31(lack of PlotEvictionCallback).
Evaluated with Chrome root at commit: 1e8af8af71d04992e29233209225cfdbeeb42672
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 code sets the atlas generation stamp after a resumed placement phase without checking that glyphs from earlier phases are still present, and it resets the bulk-use tracker unconditionally.
Impact
A compromised renderer could read cross-origin glyph masks from the shared GPU text atlas, bypassing the same-origin policy; the report notes this is a potential issue and the proof-of-concept was not run.
What the attacker needed
Compromised renderer; ability to send crafted IPC to GPU process
The fix
The report suggests gating the atlas generation stamp and the bulk-use reset on begin == 0, or re-validating earlier glyphs, and explicitly enabling security constraints in DoRasterCHROMIUM.
How it was found
- A compromised renderer builds a PaintOpBuffer containing a DrawRectOp with a PaintShader of type kPaintRecord.
- Inside the PaintRecord it embeds a DrawSlugOp with more glyphs than the atlas can hold.
- The GPU process deserialises the buffer with security constraints disabled, so the kPaintRecord shader is accepted and cached as an SkPicture.
- The first draw triggers multi-phase atlas regeneration; during the resumed phase an eviction recycles the plot holding the early glyphs.
- The code stamps the new atlas generation without re-validating those early glyphs, leaving stale UVs.
- A second draw using the same cached shader takes the fast path and samples the recycled plot, which may contain another origin's glyph masks.
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 text is drawn, its shapes are stored in a shared GPU texture atlas. A logic error means that after the atlas is reorganised, some old coordinates are not updated, so a malicious page could read pixels that belong to another site's text.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.