Use after free in Network (CVE-2026-15901)
A use-after-free occurs in Chromium's Simple Disk Cache when a retry callback is executed synchronously, allowing the cache backend to be destroyed while still in use. An attacker could exploit this to achieve remote code execution in the browser process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 7 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: SimplePostOperationWaiterTable::OnOperationComplete synchronously executes retry callbacks, bypassing the PostTask discipline. When CacheStorageCache is the consumer, this synchronous callback can drop the last handle to the cache, resulting in the synchronous destruction of SimpleBackendImpl. This leads to a Use-After-Free on the implicit this pointer in SimpleBackendImpl::DoomEntriesComplete, enabling potential RCE in the Browser Process.
Affected files:
net/disk_cache/simple/simple_backend_impl.ccnet/disk_cache/simple/post_operation_waiter.ccnet/disk_cache/simple/simple_entry_impl.ccnet/disk_cache/simple/post_operation_waiter.h
Estimated timestamp from git blame: 2023-11-27
1. Summary of the Issue (Meant for Human Triage)
An architectural invariant within Chromium's Simple Disk Cache is that client-provided completion callbacks should never be executed synchronously on the active stack of an internal state transition. This is normally prevented by wrapping callback dispatches via PostClientCallback (in net/disk_cache/simple/simple_entry_impl.cc).
However, when operations are queued within the SimplePostOperationWaiterTable and then subsequently retried via RunEntryResultOperationAndCallback (inside SimplePostOperationWaiterTable::OnOperationComplete), this asynchronous boundary is bypassed. If the retried cache operation completes synchronously (such as during an index miss after doom), the consumer's callback is executed inline.
While the original vulnerability report assumed that no in-tree consumer deletes the disk cache backend synchronously within transaction callbacks, this assumption is incorrect. CacheStorageCache in the Browser Process (which uses the Simple Cache backend) does synchronously delete its disk_cache::Backend when its last CacheStorageCacheHandle is dropped. By carefully staging a mass-doom eviction racing with a cache.match() operation, an attacker can trigger the destruction of SimpleBackendImpl from within the SimpleBackendImpl::DoomEntriesComplete iteration loop.
Because the this pointer in DoomEntriesComplete is an implicit bare pointer on the stack, this Use-After-Free falls into the MiraclePtr extraction window and is not protected by BackupRefPtr. An attacker can spray the PartitionAlloc heap to overwrite the freed SimpleBackendImpl chunk, hijack the post_doom_waiting_ pointer, and gain arbitrary code execution (RCE) in the Browser Process.
2. Proof-of-Concept & Detailed Execution Flow
The vulnerability is reached through a sequence of web platform API calls that manipulate the CacheStorageCache reference counts and the Simple Cache waiter table.
Potential Step-by-Step Trigger Path:
- Attacker Setup: The attacker controls a web page and calls
caches.open('test'). - Trigger Mass Eviction: The attacker populates the cache with enough entries to exceed the Simple cache index
high_watermark_. - Doom Entries Initiated: This triggers
SimpleIndex::StartEvictionIfNeeded, which selects multiple entries (e.g.,Hash 1andHash 2) for eviction and callsdelegate_->DoomEntries(hashes). - Backend Processes Doom:
SimpleBackendImpl::DoomEntriesprepares these hashes for doom by inserting an empty vector for each intopost_doom_waiting_. - Worker Task Posted:
DoomEntriesposts theDeleteEntrySetFilestask to a worker thread and setsSimpleBackendImpl::DoomEntriesCompleteas the reply callback. - Concurrent Match Request: The attacker concurrently calls
cache.match(url1)corresponding toHash 1. - Query Cache Scheduled: The
Matchoperation reachesCacheStorageCache::MatchImpland schedules aQueryCacheoperation. To keep the cache alive, the operation callback is wrapped viaWrapCallbackWithHandle(incache_storage_cache.h:570), creating an internalCacheStorageCacheHandle. - Operation Deferred: The
Matchoperation callsSimpleBackendImpl::OpenEntry(Hash 1). Detecting thatHash 1is actively being doomed (present inpost_doom_waiting_), it queues aRunEntryResultOperationAndCallbackretry closure insidepost_doom_waiting_[Hash 1]. - Drop Reference: The attacker navigates the iframe away or drops all JavaScript references to the cache (without explicitly calling
caches.delete). The Mojo connection closes, dropping the primary externalCacheStorageCacheHandleandCacheStorageHandle. - Single Handle Remaining: At this point, the ONLY remaining reference to the cache is the internal
CacheStorageCacheHandleheld by the pendingMatchoperation's wrapped callback. - Worker Completes: The worker task
DeleteEntrySetFilesfinishes and posts its reply back to the main/IO thread. - Main Thread Execution:
SimpleBackendImpl::DoomEntriesCompletebegins executing on the main thread.C++ // net/disk_cache/simple/simple_backend_impl.cc:912-919 void SimpleBackendImpl::DoomEntriesComplete(...) { for (const uint64_t& entry_hash : *entry_hashes) post_doom_waiting_->OnOperationComplete(entry_hash); // <-- Sync execution inside loop std::move(callback).Run(result); } - Loop Iteration 1: The loop starts its first iteration for
Hash 1and executespost_doom_waiting_->OnOperationComplete(Hash 1). - Closure Execution:
SimplePostOperationWaiterTable::OnOperationCompleteswaps the vector of deferred closures and executes them synchronously. - Retry OpenEntry: The deferred
RunEntryResultOperationAndCallbackclosure executes, re-runningOpenEntry(Hash 1). Since the entry was removed from the index by the doom operation,OpenEntrysynchronously returnsnet::ERR_FAILED. - Bypass PostTask:
RunEntryResultOperationAndCallbackobserves the non-ERR_IO_PENDINGreturn value and executes theMatchcallback (QueryCacheDidOpenFastPath) inline, bypassing the PostTask discipline. - Callback Unwinding:
QueryCacheDidOpenFastPathhandles the error and unwinds toMatchAllDidQueryCache, which runsRunWithHandle. - Handle Destruction:
RunWithHandlecompletes, and its localCacheStorageCacheHandlegoes out of scope. This decrements theCacheStorageCachereference count to 0. - Unreferenced Path: The handle's destructor calls
CacheStorageCache::DropHandleRef, which delegates toCacheStorage::CacheUnreferenced. - ReleaseUnreferencedCaches:
CacheStoragedetects that the parentCacheStorageHandlecount has dropped to 0 and callsReleaseUnreferencedCaches(). This method iterates overcache_map_and synchronously callscache_map_it->second.reset(). - Backend Destruction: The
unique_ptr<CacheStorageCache>is destroyed, which synchronously callsbackend_.reset(). - Memory Freed:
SimpleBackendImplis destructed, freeing its memory back to PartitionAlloc. - Stack Unwinds: The entire synchronous destruction chain unwinds back to the
DoomEntriesCompleteloop. - Loop Iteration 2 (Use-After-Free): The loop advances to the second iteration for
Hash 2. It evaluatespost_doom_waiting_->OnOperationComplete(Hash 2)using the implicitthispointer that was just freed. - MiraclePtr Bypass: Because
thisis a bare pointer held in a register/stack frame for the duration of theDoomEntriesCompletefunction (the extraction window), MiraclePtr/BackupRefPtr does not quarantine the chunk or crash on access. - RCE Hijack: An attacker spraying the heap with carefully crafted chunks of the same size class can forge the freed
SimpleBackendImpland control thepost_doom_waiting_pointer.OnOperationCompleteis then called on the forged waiter table, executing a forgedOnceClosureand granting the attacker arbitrary code execution (RCE) in the Browser Process.
Suggested Fix:
The PostTask discipline must be enforced. In net/disk_cache/simple/simple_backend_impl.cc, the RunEntryResultOperationAndCallback and RunOperationAndCallback thunks must use base::SequencedTaskRunner::GetCurrentDefault()->PostTask to schedule the operation_callback instead of running it inline when net_error() != net::ERR_IO_PENDING. Additionally, DoomEntriesComplete should take a local scoped_refptr to post_doom_waiting_ and use a WeakPtr re-check loop if this liveness cannot be guaranteed.
3. Technical Verification Details (Automated Audit Logs - Reviewers may skip this section)
* **Severity:** Critical (S0)
* **Brief Notes / Reasoning:**
The vulnerability is a Critical (S0) Use-After-Free in the Browser Process. The original report correctly identified the invariant violation (sync execution bypassing PostTask) and the unsafe `this` access loop, but incorrectly assumed no in-tree consumer synchronously deletes the backend. `CacheStorageCache` DOES synchronously delete its backend via `CacheStorage::CacheUnreferenced` when its last handle is dropped. Because this occurs inside `DoomEntriesComplete` where the implicit `this` pointer is a raw pointer (extraction window), MiraclePtr does not protect against the UAF. This allows arbitrary code execution (RCE) in the browser process.
Exhaustive Evidence Ledger:
-
CacheStorageCacheSync Deletion Proof:CacheStorageCacheis managed viaCacheStorageCacheHandle(CacheStorageRef). When the last handle drops,CacheStorageCache::DropHandleRef()is invoked (cache_storage_cache.cc:654), which callsCacheStorage::CacheUnreferenced(this). If the parentCacheStoragehas no other active references,CacheStorage::DropHandleRef()invokesReleaseUnreferencedCaches()(cache_storage.cc:994). This synchronously calls.reset()on the cache incache_map_. TheCacheStorageCachedestructor explicitly invokesbackend_.reset();(or allows the compiler-generated unique_ptr destructor to do so), synchronously destroyingSimpleBackendImpl. -
DoomEntriesCompleteExtraction Window Proof:SimpleBackendImpl::DoomEntriesCompleteis bound viaweak_ptr_factory_.GetWeakPtr()(simple_backend_impl.cc:361). This validates thatthisis alive at entry to the function. However, the iteration loop (simple_backend_impl.cc:916-917) uses the implicitthispointer (this->post_doom_waiting_).C++ void SimpleBackendImpl::DoomEntriesComplete(...) { for (const uint64_t& entry_hash : *entry_hashes) post_doom_waiting_->OnOperationComplete(entry_hash); // Evaluates this->post_doom_waiting_If
SimpleBackendImplis destroyed during an iteration (via the synchronousOnOperationComplete->RunEntryResultOperationAndCallback->CacheStorageCachecallback -> Handle Drop ->backend_.reset()path), thethispointer remains a bare dangling pointer on the stack. According to the MiraclePtr guidelines, extraction window UAFs (where a pointer is extracted and used repeatedly across a free) bypassraw_ptrprotections. -
Synchronous Callback Execution Proof:
RunEntryResultOperationAndCallback(simple_backend_impl.cc:145-158) executes the split callback synchronously:std::move(split_callback.second).Run(std::move(operation_result));. This contradictssimple_entry_impl.cc:676which explicitly usesPostTaskto avoid reentrancy. -
Process Boundary: The UAF occurs in the Browser Process, as
CacheStorageCacheandSimpleBackendImplexecute there. -
Attacker Model: Web Adversary serving malicious JavaScript to a sandboxed renderer process.
-
Severity Evaluation: Browser-process memory corruption without MiraclePtr protection yields a base severity of Critical (S0).
Evaluated with Chrome root at commit: f4cb78b4ec077b7f51b504af9350cdc166d10c2f
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 retry callback in `SimplePostOperationWaiterTable::OnOperationComplete` runs synchronously instead of being posted to a task queue, allowing a consumer to destroy the backend during iteration.
Impact
An attacker could achieve remote code execution in the browser process by spraying the heap to control the freed object.
What the attacker needed
Attacker controls a web page; victim visits the page; cache filled beyond high watermark
The fix
The fix should enforce the PostTask discipline by scheduling the operation callback instead of running it inline, and use a local scoped_refptr with a WeakPtr re-check loop.
How it was found
- The attacker opens a cache and fills it beyond the high watermark to trigger eviction.
- The eviction dooms entries and posts a worker task to delete their files.
- The attacker concurrently calls cache.match on one of the doomed entries, queuing a retry callback.
- The attacker drops all external references to the cache, leaving only the internal handle from the pending match.
- The worker completes and the main thread runs DoomEntriesComplete, which synchronously executes the retry callback.
- The callback drops the last handle, destroying the backend, and the loop continues using the freed pointer.
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 is a bug where a program keeps using memory after it has been freed. Here, a callback runs too early and deletes the cache backend while a loop is still using it, so the loop then reads freed memory. An attacker who controls a web page could potentially take over the browser process.
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.