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

Use after free in ServiceWorker (CVE-2026-11656)

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 25 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: A potential re-entrancy vulnerability in ServiceWorkerContextCore::RemoveLiveVersion allows observers to re-acquire a reference to a ServiceWorkerVersion object currently undergoing destruction. This can lead to a double-free and use-after-free (UAF) in the browser process, potentially resulting in memory corruption.

Affected files:

  • content/browser/service_worker/service_worker_context_core.cc
  • content/browser/service_worker/service_worker_version.cc
  • content/browser/service_worker/service_worker_context_wrapper.cc
  • extensions/browser/service_worker/service_worker_state.cc
  • extensions/browser/service_worker/service_worker_task_queue.cc
  • extensions/browser/process_manager.cc
  • extensions/browser/event_router.cc
  • extensions/browser/events/event_ack_data.cc

Estimated timestamp from git blame: 2025-09-25

Description

A potential memory safety vulnerability exists in the Chromium browser process due to the way ServiceWorkerVersion objects are removed from ServiceWorkerContextCore during their destruction. The issue stems from notifying synchronous observers while the object is still present in the context's internal tracking map.

Root Cause Analysis

When a ServiceWorkerVersion's reference count reaches zero, its destructor ~ServiceWorkerVersion() is invoked. This destructor calls ServiceWorkerContextCore::RemoveLiveVersion(version_id_) to remove the version from the live_versions_ map.

Inside RemoveLiveVersion(), if the worker is not in the kStopped state, the code notifies synchronous observers via OnStoppedSync. Crucially, the version is not yet removed from the live_versions_ map during this notification.

C++
// content/browser/service_worker/service_worker_context_core.cc
void ServiceWorkerContextCore::RemoveLiveVersion(int64_t id) {
  auto it = live_versions_.find(id);
  CHECK(it != live_versions_.end());
  ServiceWorkerVersion* version = it->second;

  if (version->running_status() != blink::EmbeddedWorkerStatus::kStopped) {
    for (auto& observer : sync_observer_list_->observers) {
      observer.OnStoppedSync(id, version->scope(),
                             *version->start_worker_token());
    }
  }
  // ...
  live_versions_.erase(it);
}

In the extensions system, extensions::ServiceWorkerState::OnStoppedSync initiates a synchronous call chain: ServiceWorkerState::HandleStop -> ServiceWorkerTaskQueue::OnWorkerStop -> ProcessManager::StopTrackingServiceWorkerRunningInstance -> EventRouter::OnStoppedTrackingServiceWorkerInstance -> EventAckData::ClearUnackedEventsForWorker -> ServiceWorkerContextWrapper::FinishedExternalRequest.

FinishedExternalRequest calls context()->GetLiveVersion(service_worker_version_id). Since the entry has not yet been erased from the map, it retrieves a raw pointer to the object being destroyed. It then wraps this pointer in a scoped_refptr<ServiceWorkerVersion>.

In release builds, base::RefCounted::AddRef() does not check if the object is being destroyed (the in_dtor_ check is a DCHECK). The reference count increments from 0 to 1. When the scoped_refptr goes out of scope at the end of the function, the count returns to zero, and a second delete this is executed on the same memory.

Potential Consequences

  1. Double Destruction: The ServiceWorkerVersion destructor runs twice, leading to a double-free of its member objects (e.g., EmbeddedWorkerInstance).
  2. Re-entrant Map Erasure: The inner (re-entrant) RemoveLiveVersion call erases the entry from live_versions_. When the outer call resumes, its iterator it is invalidated, and the subsequent live_versions_.erase(it) causes undefined behavior/heap corruption.
  3. Use-After-Free: After the notification loop, the outer RemoveLiveVersion accesses the now-deleted object via version->reporting_source(), leading to a UAF read.

Potential Steps to Reproduce

An attacker controlling an extension renderer might trigger this via the following potential steps:

  1. Ensure the extension has a background service worker and an active "unacked event" (e.g., by sending a message that hasn't been acknowledged).
  2. Trigger the destruction of the ServiceWorkerVersion (for example, by causing the worker to fail during startup or by reloading the extension).
  3. The synchronous notification chain triggered during destruction will reach FinishedExternalRequest, causing the resurrection and subsequent double-free of the ServiceWorkerVersion object.

Suggested Fix

Remove the ServiceWorkerVersion from the live_versions_ map before notifying synchronous observers in ServiceWorkerContextCore::RemoveLiveVersion. This ensures that any re-entrant calls to GetLiveVersion will fail to find the object being destroyed.

Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e


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.

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.

What is known

A high-severity memory corruption bug in ServiceWorker (Google Chrome). Chrome VRP made it public on 8 June 2026 as CVE-2026-11656. Fixed in version 149.0.7827.102.

About 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.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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.