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

Use after free in Codecs (CVE-2026-6303)

A heap use-after-free exists in SkiaImageDecoderBase when decoding images via the WebCodecs API. An attacker could potentially write attacker-controlled pixel data into a freed heap allocation.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 22 days

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

Overview: A potential heap use-after-free (UAF) vulnerability exists in SkiaImageDecoderBase when decoding images via the WebCodecs API. A cached frame index is not reset during aggressive caching purges, allowing an attacker to reuse a freed pixel buffer pointer. This leads to an attacker-controlled out-of-bounds/UAF write in the renderer process.

Affected files:

  • third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc
  • third_party/skia/src/codec/SkWuffsCodec.cpp
  • third_party/blink/renderer/modules/webcodecs/image_decoder_core.cc

Estimated timestamp from git blame: 2024-09-04

Verdict: A highly exploitable Heap Use-After-Free (UAF) write exists in SkiaImageDecoderBase.

Context Summary: Initial logic and frame decoding parameters are validated. When an ImageDecoder handles incremental GIF decoding, SkWuffsCodec caches a raw pointer (fIncrDecDst) to the active pixel buffer.

Vulnerability: Standard processing of ClearCacheExceptFrame frees cached pixel buffers to reclaim memory. However, the system fails to reset the already_started_frame_ tracker. We jump directly to the exploit primitive: when decoding resumes, the stale tracker bypasses the startIncrementalDecode() initialization block. SkWuffsCodec::incrementalDecode() executes immediately, writing attacker-controlled pixel data directly into the freed heap allocation via the dangling fIncrDecDst pointer. MiraclePtr provides no protection as this is a raw uint8_t* within third-party code.

Potential Steps to Trigger:

  1. Feed ImageDecoder a multi-frame GIF with partial data for Frame 1.
  2. Decode Frame 1 to initialize the Skia codec pointer and set already_started_frame_ = 1.
  3. Abort the decode (decoder.reset()) and decode Frame 0. This triggers cache clearing, freeing Frame 1's buffer.
  4. Perform heap grooming to place a target object in the freed slot.
  5. Provide the remaining GIF data and decode Frame 1. The decoder bypasses pointer re-initialization and writes GIF payload bytes into the target object.

Note: These are suggested potential steps, as Fortify LLM agent doesn't yet have the ability to run code.

Suggested Fix: Invalidate already_started_frame_ and notify the underlying codec whenever a partially decoded frame's pixel data is cleared during cache eviction (e.g., inside ClearCacheExceptFrame or ClearPixelData).

Evaluated with Chrome root at commit: a3f5fcb392f2902650ca2b71820e7e418787e18b


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 cached frame index (already_started_frame_) is not reset when cached pixel buffers are freed, so a later decode skips re-initialisation and writes through a dangling pointer.

Impact

An attacker could potentially achieve an out-of-bounds or use-after-free write in the renderer process, though the steps are only suggested and not yet proven.

What the attacker needed

Ability to supply a crafted multi-frame GIF; decoding via WebCodecs API; heap grooming

The fix

The fix should invalidate already_started_frame_ and notify the underlying codec whenever a partially decoded frame's pixel data is cleared during cache eviction.

How it was found

  1. Feed ImageDecoder a multi-frame GIF with partial data for Frame 1.
  2. Decode Frame 1 to initialise the Skia codec pointer and set already_started_frame_ = 1.
  3. Abort the decode and decode Frame 0, triggering cache clearing that frees Frame 1's buffer.
  4. Perform heap grooming to place a target object in the freed slot.
  5. Provide the remaining GIF data and decode Frame 1, causing a write into the target object.

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 use-after-free happens when a program keeps a pointer to memory after that memory has been freed. If the program later writes through that stale pointer, it can corrupt data or crash. Here, an image decoder could write pixel data into memory that was already released.

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.