Skip to content
Race condition Advisory Advanced CVE-2026-106300

Race condition in CacheStorage (CVE-2026-106300)

A race condition in CacheStorage allows a compromised renderer to leak uninitialized browser process heap memory. The renderer can trigger a read of side data using a stale size while a truncating write is pending, causing the browser to send back a larger buffer than was actually filled.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 6 months

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 without the security team.

Overview: A TOCTOU vulnerability in CacheStorage may allow a compromised renderer to leak up to 64KB of uninitialized browser process heap memory. This occurs because ReadSideData allocates an uninitialized buffer based on a stale size while a truncating WriteSideData operation is pending in the disk cache queue. When the read completes, the buffer is not resized to the actual bytes read, transmitting the uninitialized memory to the renderer.

Affected files:

  • content/browser/cache_storage/cache_storage_cache_entry_handler.cc
  • storage/browser/blob/blob_impl.cc
  • net/disk_cache/simple/simple_entry_impl.cc

Estimated timestamp from git blame: 2024-01-10

Summary

A Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in the CacheStorage component. A compromised renderer process could potentially exploit a race condition between WriteSideData and ReadSideData to leak up to 64KB of uninitialized browser process heap memory. This memory may contain sensitive pointers or cross-origin data, which could facilitate ASLR bypasses and sandbox escapes.

Vulnerability Details

The vulnerability roots from how EntryReaderImpl::ReadSideData allocates its response buffer and how operations are queued in the Simple Cache backend (SimpleEntryImpl):

  1. Stale Size Fetch: When EntryReaderImpl::ReadSideData is called, it determines the buffer size synchronously via blob_entry_->GetSize(side_data_disk_cache_index_). In SimpleEntryImpl, this directly returns data_size_[stream], which will be stale if there is a pending WriteData operation that hasn't executed yet.
  2. Uninitialized Allocation: EntryReaderImpl uses this stale size to allocate a mojo_base::BigBuffer. For sizes up to 64KB (BigBuffer::kMaxInlineBytes), BigBuffer avoids shared memory and instead allocates uninitialized browser heap memory via base::HeapArray<uint8_t>::Uninit().
  3. Clamped Read: The read operation is then queued. If a truncating write was queued beforehand, the write executes first, truncating the stream's data size. When the read subsequently executes, ReadDataInternal correctly clamps the read length to the new, smaller data size. It reads only a few bytes and returns the actual number of bytes read.
  4. Unchecked Return Buffer: The completion callback in EntryReaderImpl::ReadSideData (and subsequently BlobImpl::ReadSideData) receives the actual bytes read (e.g., 1 byte) but ignores it. It blindly passes the original 64KB BigBuffer over Mojo to the renderer. Since BigBuffer serializes its entire capacity, the remaining 65,535 bytes of uninitialized browser heap memory are leaked.

Potential Attacker Steps

Note: These are theoretical steps based on code analysis; our tooling agent does not currently have the capability to run a live Proof of Concept.

  1. A compromised renderer creates a Cache Storage entry with 64KB of side data.
  2. The renderer initiates a read of the entry's response body, reading the Mojo data pipe very slowly to keep the disk cache entry's pending_operations_ queue busy.
  3. While the body read is pending, the renderer sends a WriteSideData IPC request to truncate the side data to 1 byte. Because the cache scheduler's Match operation has finished, this write is dispatched to the disk cache backend and queued.
  4. Immediately after, the renderer requests to read the side data. The browser allocates a 64KB uninitialized BigBuffer (based on the stale size) and queues the read.
  5. Once the queue processes, the write truncates the data, and the read fetches 1 byte into the 64KB buffer.
  6. The browser sends the 64KB buffer to the renderer, leaking 65,535 bytes of uninitialized heap memory.

Suggested Fix

In EntryReaderImpl::ReadSideData's completion callback (content/browser/cache_storage/cache_storage_cache_entry_handler.cc:149), the code should verify the result (number of bytes read) against the size of the allocated output_buf.

If result < output_buf.size(), the code must not return the original output_buf. Instead, it should allocate a new BigBuffer of exactly result size, copy the read bytes into it, and return the new buffer. Alternatively, ensure the buffer is zero-initialized before reading, though resizing it is preferable to avoid transmitting unnecessary null bytes over IPC.

Evaluated with Chrome root at commit: f200f57a19490707ff8bc7aa5de3cbc443a3afad


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. And please feel free to reach out to me directly if you have concerns or feedback on the project.

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

The completion callback in ReadSideData ignores the actual number of bytes read and returns the original, larger buffer, which still contains uninitialized memory.

Impact

A compromised renderer could leak up to 64KB of uninitialized browser process heap memory, potentially containing sensitive pointers or cross-origin data, which could facilitate ASLR bypasses and sandbox escapes.

What the attacker needed

Compromised renderer process

The fix

The code should check the actual number of bytes read and, if smaller than the allocated buffer, allocate a new buffer of exactly that size and copy the read bytes into it before returning.

How it was found

  1. A compromised renderer creates a Cache Storage entry with 64KB of side data.
  2. The renderer initiates a read of the entry's response body, reading slowly to keep the disk cache queue busy.
  3. While the body read is pending, the renderer sends a WriteSideData request to truncate the side data to 1 byte.
  4. Immediately after, the renderer requests to read the side data, causing the browser to allocate a 64KB uninitialized buffer based on the stale size.
  5. The queued write truncates the data, and the read fetches only 1 byte into the 64KB buffer.
  6. The browser sends the full 64KB buffer to the renderer, leaking 65,535 bytes of uninitialized heap 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 program reads data, it first asks how big the data is, then allocates a buffer of that size. If another operation changes the size in between, the program might allocate too much and then send the whole buffer back without checking how much was actually filled, leaking leftover memory contents.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.