Skip to content
Memory corruption Advisory Advanced CVE-2026-7949

Out of bounds read in Skia (CVE-2026-7949)

A time-of-check time-of-use flaw in Skia's path deserialisation lets a compromised renderer mutate path verbs in shared memory after validation, causing a heap out-of-bounds read in the GPU process. This could leak cross-origin GPU memory via drawn geometry.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 42 days

Project Fortify, an experimental security project, has identified the following potential security issue.

Overview: A Time-of-Check Time-of-Use (TOCTOU) vulnerability exists in Skia's path deserialization when reading font data from shared memory in the GPU process. A compromised renderer can mutate path verbs between validation and copying, creating a malformed SkPath. Iterating this path during rasterization causes a heap out-of-bounds read, potentially leaking sensitive cross-origin data.

Affected files:

  • third_party/skia/src/core/SkPathData.cpp
  • third_party/skia/src/core/SkPath_serial.cpp
  • third_party/skia/src/core/SkReadBuffer.cpp
  • third_party/skia/src/text/gpu/SkChromeRemoteGlyphCache.cpp
  • gpu/command_buffer/service/raster_decoder.cc

Estimated timestamp from git blame: 2025-12-23

Description

There is a potential Time-of-Check Time-of-Use (TOCTOU) vulnerability in Skia's path deserialization logic when handling remote glyph cache data in the GPU process. This can lead to a heap out-of-bounds (OOB) read, allowing a compromised renderer to leak cross-origin GPU memory.

When a renderer sends font data to the GPU process via RasterDecoderImpl::DoRasterCHROMIUM, the data is passed via a shared memory buffer. The buffer is passed down as a volatile span to ServiceFontManager::Deserialize. However, Skia's SkStrikeClient::readStrikeData explicitly casts away the volatile qualifier and wraps the shared memory directly in an SkReadBuffer:

C++
// third_party/skia/src/text/gpu/SkChromeRemoteGlyphCache.cpp
SkReadBuffer buffer{const_cast<const void*>(memory), memorySize};

When deserializing an SkPath with the kVerbsAreStoredForward_Version format, SkPath::ReadFromMemory skips allocating temporary storage and instead obtains direct pointers into this shared memory for the points and verbs arrays.

These shared memory spans are passed to SkPathData::Make:

C++
// third_party/skia/src/core/SkPathData.cpp
sk_sp<SkPathData> SkPathData::Make(SkSpan<const SkPoint> pts, SkSpan<const SkPathVerb> vbs, ...) {
    if (!valid_path_data(pts, vbs, conics)) {  // [1] Time of Check
        return nullptr;
    }
    return MakeNoCheck(pts, vbs, conics, {}, {}); // [2] Time of Use
}
  1. Time of Check: valid_path_data iterates over the vbs span (reading directly from shared memory) to calculate the expected number of points, verifying it matches the size of the pts array.
  2. Time of Use: If validation passes, MakeNoCheck allocates a new SkPathData object sized according to the original array lengths. It then calls SkSpanPriv::Copy to copy the verbs and points from the shared memory into the new allocation.

A compromised renderer can continuously mutate the verbs in shared memory. If the renderer changes a verb from kLine (requires 1 point) to kCubic (requires 3 points) after valid_path_data reads it but before MakeNoCheck copies it, the resulting SkPathData object will contain a kCubic verb but only have memory allocated for a kLine.

When the GPU process later iterates over this path (e.g., via SkPathEdgeIter or SkPath::RawIter) to draw it, the iterator will read past the bounds of the allocated fPoints array, treating adjacent heap memory as float coordinates. This geometry can then be read back via a canvas to leak sensitive data.

Suggested Steps to Trigger

(Note: These are potential steps as our setup does not have the ability to run code or verify a live exploit)

  1. A compromised renderer process allocates a shared memory buffer for font glyph serialization.
  2. The renderer crafts a serialized SkPath in this buffer using kVerbsAreStoredForward_Version, populating it with $N$ points and $N$ verbs (all set to kLine).
  3. The renderer issues a RasterDecoderImpl::DoRasterCHROMIUM command to the GPU process, pointing to this shared memory.
  4. While the GPU process begins deserialization, a racing thread in the renderer continuously overwrites the kLine (0x01) verbs in the shared memory with kCubic (0x04) verbs.
  5. If the race is won, the GPU process allocates an SkPathData object with space for $N$ points but copies in $N$ kCubic verbs.
  6. The renderer requests the GPU process to draw the glyph and reads back the resulting pixels. The out-of-bounds heap memory affects the drawn geometry, allowing the attacker to infer the leaked memory contents.

Suggested Fix

To prevent TOCTOU vulnerabilities, untrusted data from shared memory should be copied into secure, local memory before any validation occurs.

In SkPath::ReadFromMemory (or SkPathData::Make), the verbs and points arrays should be copied out of the SkReadBuffer (shared memory) into local buffers before calling valid_path_data. Alternatively, MakeNoCheck could be modified to perform the validation after copying the data, or a new Make variant could be introduced that safely copies and validates in a single pass.

Evaluated with Chrome root at commit: 0eb4855bda702feaaa8b899336664f97e3df88b8


Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. Please feel free to reach out to me if you have concerns or feedback.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 validation of shared-memory path data occurs before the data is copied, allowing a race condition where a compromised renderer mutates the data between check and use.

Impact

A compromised renderer could leak cross-origin GPU memory, but the report notes the exploit is potential and has not been verified live.

What the attacker needed

Compromised renderer process; ability to race shared memory writes

The fix

The fix should copy untrusted shared-memory data into local memory before validation, or validate after copying.

How it was found

  1. A compromised renderer allocates a shared memory buffer for font glyph serialisation.
  2. The renderer crafts a serialised SkPath in this buffer using kVerbsAreStoredForward_Version, with N points and N verbs all set to kLine.
  3. The renderer issues a RasterDecoderImpl::DoRasterCHROMIUM command to the GPU process pointing to this shared memory.
  4. While the GPU process begins deserialisation, a racing thread in the renderer continuously overwrites the kLine verbs with kCubic verbs.
  5. If the race is won, the GPU process allocates an SkPathData object with space for N points but copies in N kCubic verbs.
  6. The renderer requests the GPU process to draw the glyph and reads back the resulting pixels, inferring leaked memory from the drawn geometry.

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 renderer process (which draws web pages) can share memory with the GPU process (which handles graphics). The GPU process checks the data, but the renderer can change it after the check and before it is copied. This makes the GPU process read past the end of a buffer, potentially exposing memory from other websites.

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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.