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

Race condition in Workers (CVE-2026-79094)

A logic bug in DedicatedWorkerMessagingProxy::Freeze causes freeze requests to be dropped if the child worker thread has not yet been initialised, and the state is not re-evaluated after the thread starts. An attacker page in the Back-Forward Cache could keep a dedicated worker running JavaScript, performing network fetches and other actions, while the page is supposed to be frozen.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A potential logic bug in DedicatedWorkerMessagingProxy::Freeze causes freeze requests to be silently dropped if the child WorkerThread has not yet been initialized. Since this state is not re-evaluated after the worker thread subsequently starts, and Mojo callbacks are dispatched on an unpausable default task runner during the freeze nested loop, a child dedicated worker can successfully spawn and execute JavaScript. This allows potential background script execution while the page is supposed to be frozen in the Back-Forward Cache (BFCache).

Affected files:

  • third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc
  • third_party/blink/renderer/core/workers/dedicated_worker.cc
  • content/renderer/worker/dedicated_worker_host_factory_client.cc

Estimated timestamp from git blame: 2019-05-14

Potential Root Cause Analysis

When a page is navigated away and placed into the Back-Forward Cache (BFCache), the browser freezes active execution contexts and their associated workers. However, a potential logic issue exists where DedicatedWorkerMessagingProxy::Freeze() silently drops freeze requests if the child WorkerThread has not been initialized yet, with no deferred-apply mechanism:

C++
// third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc
void DedicatedWorkerMessagingProxy::Freeze(bool is_in_back_forward_cache) {
  DCHECK(IsParentContextThread());
  auto* worker_thread = GetWorkerThread();
  if (AskedToTerminate() || !worker_thread)   // <-- Potential issue: freeze is dropped if the thread is not yet created
    return;
  worker_thread->Freeze(is_in_back_forward_cache);
}

Although the parent-side DedicatedWorker records requested_frozen_ = true, this flag is only evaluated during ContextLifecycleStateChanged(). It is never checked or applied by ContinueStartInternal() or StartWorkerGlobalScope() after InitializeWorkerThread() eventually creates and starts the child thread.

Enabling Primitive: Mojo Callback Dispatch on Unpausable Queue

DedicatedWorker::Start() sends a CreateWorkerHostAndStartScriptLoad IPC request to the browser. The Mojo receiver for the DedicatedWorkerHostFactoryClient is bound without specifying an explicit task runner:

C++
// content/renderer/worker/dedicated_worker_host_factory_client.cc
factory_->CreateWorkerHostAndStartScriptLoad(
    dedicated_worker_token, script_url, credentials_mode,
    FetchClientSettingsObjectFromWebToMojom(fetch_client_settings_object),
    std::move(blob_url_token), receiver_.BindNewPipeAndPassRemote(),  // <-- Bound to default task runner
    storage_access_api_status);

When bound this way, incoming Mojo messages dispatch on the default sequenced task runner. On a worker thread, this default runner corresponds to SUBTHREAD_DEFAULT_TQ.

Crucially, PauseImpl() in WorkerSchedulerImpl only voter-disables throttleable, pausable, and web-scheduling task queues; it never disables SUBTHREAD_DEFAULT_TQ. During a freeze, the thread enters a nested loop (base::RunLoop(kNestableTasksAllowed).Run()) to process outstanding events. Because SUBTHREAD_DEFAULT_TQ remains active, the Mojo reply from the browser can still be received and processed during this nested loop, allowing the nested worker to finish initializing and running completely unfrozen.


Potential Trigger Path (Nested-Worker Case)

  1. A page spawns a parent worker: const parent = new Worker('parent.js').
  2. Inside parent.js, a child worker is instantiated: const child = new Worker('child.js'). This posts the CreateWorkerHostAndStartScriptLoad IPC while the child's worker_thread_ on the proxy is still nullptr.
  3. The page navigates away, entering BFCache. The main thread signals the parent worker thread to freeze.
  4. The parent worker thread transitions to PauseOrFreezeOnWorkerThread(kFrozen, true):
    • It iterates through observers, calling ContextLifecycleStateChanged(kFrozen) on the child DedicatedWorker instance. This sets requested_frozen_ = true and invokes context_proxy_->Freeze(true), which is silently dropped because the child worker thread is still nullptr.
    • It enters a nested run loop via base::RunLoop(kNestableTasksAllowed).Run() with certain task queues disabled, but SUBTHREAD_DEFAULT_TQ remains enabled.
  5. The browser replies with OnScriptLoadStarted on the parent worker's SUBTHREAD_DEFAULT_TQ queue.
  6. The handler is processed, executing DedicatedWorker::OnScriptLoadStarted -> ContinueStartInternal() -> DedicatedWorkerMessagingProxy::StartWorkerGlobalScope().
  7. The child DedicatedWorkerThread is created and started. Because there is no check for the pre-existing requested_frozen_ state during startup, the child worker thread starts running its JS completely unfrozen.

Note: Our tooling agent currently does not have the ability to run code, so these are potential steps derived from static code flow analysis.


Potential Impact

An attacker page stored in the BFCache can maintain an active dedicated-worker thread executing arbitrary JavaScript for the entire duration of its cache residency. This thread can perform network fetches, issue beacons, interact with IndexedDB, and queue postMessage calls to be delivered back to the parent document upon restoration. This completely bypasses the BFCache freeze constraints designed to preserve system resources and protect user privacy.


Suggested Fix

To prevent this freeze bypass, DedicatedWorkerMessagingProxy should track the requested freeze state even before the thread starts, and apply it upon initialization.

  1. Add a pending_freeze_ state to DedicatedWorkerMessagingProxy (and ThreadedMessagingProxyBase if appropriate):

    C++
    std::optional<bool> pending_freeze_;
    
  2. In DedicatedWorkerMessagingProxy::Freeze(bool is_in_back_forward_cache):

    C++
    void DedicatedWorkerMessagingProxy::Freeze(bool is_in_back_forward_cache) {
      DCHECK(IsParentContextThread());
      auto* worker_thread = GetWorkerThread();
      if (!worker_thread) {
        pending_freeze_ = is_in_back_forward_cache;
        return;
      }
      ...
    }
    
  3. During worker thread initialization inside InitializeWorkerThread, check if a freeze is pending and apply it immediately:

    C++
    if (pending_freeze_.has_value()) {
      worker_thread_->Freeze(pending_freeze_.value());
      pending_freeze_.reset();
    }
    

Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8


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.

How it worked

Root cause

Likely the freeze request is silently dropped when the child worker thread does not yet exist, and the saved frozen flag is never applied after the thread is later created and started.

Impact

An attacker page stored in BFCache could maintain an active dedicated-worker thread executing arbitrary JavaScript for the entire duration of its cache residency, performing network fetches, beacons, IndexedDB operations, and queuing postMessage calls, bypassing BFCache freeze constraints.

What the attacker needed

Victim visits attacker page; page uses nested workers; page enters BFCache

The fix

The fix should track the requested freeze state before the worker thread starts and apply it during initialisation.

How it was found

  1. A page creates a parent worker.
  2. Inside the parent worker, a child worker is created, sending an IPC request while the child worker thread is still null.
  3. The page navigates away and enters BFCache, and the main thread signals the parent worker to freeze.
  4. The parent worker freezes and calls Freeze on the child, but the call is dropped because the child thread is still null.
  5. The browser replies on an unpausable task queue, and the child worker thread is created and started without checking the frozen state.
  6. The child worker runs JavaScript unfrozen while the page is in BFCache.

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 you navigate away from a page, the browser can put it in a 'frozen' state called the Back-Forward Cache so it uses fewer resources. This report says a bug means a background worker started by that page might not actually be frozen, so it could keep running code and making network requests even though the page is supposed to be paused. The report is based on reading the code, not on running an exploit.

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.