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

Use after free in Chromoting (CVE-2026-79247)

A use-after-free exists in the Windows Remoting Host's WtsSessionProcessDelegate::Core class because the teardown sequence for Windows Job Objects relies on a brief task-posting loop that races against asynchronous OS process termination. An attacker who has already compromised the sandboxed worker process could potentially escalate privileges to the SYSTEM-level Remoting Host process by delaying termination and spraying the heap to hijack execution flow.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 months

Flapjack, 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 Use-After-Free vulnerability exists in the Windows Remoting Host's WtsSessionProcessDelegate::Core class. The teardown sequence for Windows Job Objects relies on a brief task-posting loop that races against asynchronous OS process termination. This race allows late I/O completion notifications to invoke virtual methods on a freed object, completely bypassing MiraclePtr protections.

Affected files:

  • remoting/host/win/wts_session_process_delegate.cc

Estimated timestamp from git blame: 2012-10-10

Summary

A potential Use-After-Free (UAF) vulnerability exists in WtsSessionProcessDelegate::Core (remoting/host/win/wts_session_process_delegate.cc). The class fails to correctly synchronize its destruction with the asynchronous termination of a Windows Job Object. If a worker process takes longer to terminate than a single task round-trip to the IO thread, the Core object is freed prematurely. When the delayed process termination notification arrives from the Windows kernel, it dereferences a dangling pointer, leading to a UAF.

Because the dangling pointer is retrieved as a raw ULONG_PTR completion key directly from the Windows kernel, PartitionAlloc's MiraclePtr (BackupRefPtr) is entirely bypassed.

Root Cause Analysis

  1. IOCP Registration: During setup, Core::InitializeJob() registers the Core object as an IOHandler for the Job Object. It passes this to the OS kernel as the CompletionKey.
  2. Teardown Initiation: When the session ends, Core::Stop() calls KillProcess(), which invokes the Windows API TerminateJobObject(). Crucially, this API is asynchronous; it signals termination but does not block until processes are fully destroyed.
  3. Flawed Draining: Immediately after, Stop() initiates a drain sequence. DrainJobNotificationsCompleted() closes the job handle and posts a task (DrainJobNotifications()) to the IO thread. The IO thread simply posts back to the caller thread.
  4. Premature Destruction: After this single, rapid task round-trip, the caller thread assumes the IOCP queue is empty. It clears its internal reference (self_ = nullptr;), causing the Core object to be deleted.
  5. The Race: Because process teardown is significantly slower than a local task round-trip, the worker process is often still terminating in the background when the Core object is destroyed.
  6. UAF Trigger: Once the worker process finally finishes terminating, the Windows kernel queues the JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO notification to the IOCP. The Host's IO thread dequeues it (GetQueuedCompletionStatus), casts the raw ULONG_PTR back to an IOHandler*, and calls the virtual method OnIOCompleted(). Since the object was freed, this is a UAF.

Attack Scenario / Trigger Steps

Note: These are theoretical steps, as our tooling agent does not yet have the ability to run code or build a live proof-of-concept.

An attacker who has already compromised the sandboxed worker process could potentially escalate privileges to the SYSTEM-level Remoting Host process using the following sequence:

  1. The Remoting Host begins to shut down the session, invoking KillProcess().
  2. The attacker's worker process intentionally delays its own termination (e.g., by creating complex handle dependencies or maintaining high system load) to widen the race condition window.
  3. The Remoting Host completes its fast "drain" round-trip and frees the Core object.
  4. The attacker sprays the Remoting Host's heap (e.g., by sending crafted IPC messages before full termination) to reallocate the freed Core memory, placing a malicious payload with a fake vtable at the object's address.
  5. The worker process finally terminates. The OS sends the delayed JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO notification.
  6. The Remoting Host's IO thread casts the raw completion key to the attacker-controlled memory and invokes OnIOCompleted(), hijacking execution flow.

Suggested Fix

The Core object's lifetime must be strictly tied to the receipt of the terminal job object notification, rather than relying on an arbitrary task round-trip.

Do not drop the self_ reference in DrainJobNotificationsCompleted() simply because a task round-trip completed. Instead, the self_ reference should only be cleared inside OnIOCompleted() upon receiving the JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO notification (or if RegisterJobObject explicitly failed during initialization). This ensures the object remains alive in memory as long as the OS kernel holds the raw pointer.

Evaluated with Chrome root at commit: a9e0d24757518a6f49f01bf5068f2cadfc6092f4


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

The Core object's lifetime is not tied to the terminal job object notification; instead, it is freed after a single task round-trip that does not guarantee the IOCP queue is empty.

Impact

An attacker who has already compromised the sandboxed worker process could potentially escalate privileges to the SYSTEM-level Remoting Host process.

What the attacker needed

Attacker already controls sandboxed worker process; ability to delay worker termination; ability to spray host heap via IPC

The fix

The Core object's lifetime should be strictly tied to the receipt of the terminal job object notification, clearing the self_ reference only inside OnIOCompleted() upon receiving JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO.

How it was found

  1. The Remoting Host begins to shut down the session, invoking KillProcess().
  2. The attacker's worker process intentionally delays its own termination to widen the race condition window.
  3. The Remoting Host completes its fast drain round-trip and frees the Core object.
  4. The attacker sprays the Remoting Host's heap to reallocate the freed Core memory with a fake vtable.
  5. The worker process finally terminates and the OS sends the delayed JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO notification.
  6. The Remoting Host's IO thread casts the raw completion key to the attacker-controlled memory and invokes OnIOCompleted(), hijacking execution flow.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

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

A use-after-free is a bug where a program frees a piece of memory but later uses it again, as if it still belonged to it. Here, the Remoting Host frees an object before a Windows notification about a process ending arrives, so when the notification is handled, the program calls a function through a pointer to memory that may have been reused by an attacker. This could let an attacker who already controls a worker process take over the more privileged host process.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

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.