Use after free in Tracing (CVE-2026-17862)
A use-after-free race condition exists in the Windows elevated tracing service where a thread-pool worker can call CoDisconnectObject on a freed SystemTracingSession object. A local low-privilege user could potentially exploit this to escalate privileges to SYSTEM.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 55 days
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential Use-After-Free (UAF) vulnerability exists in the Windows-only elevated tracing service due to a race condition between COM session destruction and client termination. A thread-pool worker thread can invoke CoDisconnectObject on a dangling pointer to a freed SystemTracingSession object. If exploited, this could allow a local interactive user to escalate privileges to SYSTEM.
Affected files:
chrome/windows_services/elevated_tracing_service/session_registry.ccchrome/windows_services/elevated_tracing_service/process_watcher.ccchrome/windows_services/elevated_tracing_service/system_tracing_session.cc
Estimated timestamp from git blame: 2024-10-09
Description
A potential Use-After-Free (UAF) vulnerability has been identified in the Windows-only elevated_tracing_service within Chromium. The issue lies in how the SessionRegistry coordinates clean session destruction with client process termination.
SessionRegistry::OnClientTerminated (session_registry.cc:106-118) is invoked on a ThreadPool thread when a client process terminates. It calls ::CoDisconnectObject on a raw IUnknown* pointer retrieved from SessionCore via an atomic exchange unknown_.exchange(nullptr) (session_registry.cc:35). However, SessionCore holds this pointer as a raw, weak reference without having called AddRef (session_registry.cc:31), meaning the lifetime of the SystemTracingSession is independent of SessionCore.
Concurrently, if COM drops the last reference to SystemTracingSession (due to client process exit or rundown), the SystemTracingSession destructor runs on an arbitrary MTA RPC thread. The destructor triggers ~ScopedSession, which runs OnSessionDestroyed (session_registry.cc:47).
If the ThreadPool thread wins the atomic exchange, OnSessionDestroyed on the RPC thread retrieves nullptr and returns early without blocking (session_registry.cc:98). The RPC thread then proceeds to destroy ProcessWatcher (session_registry.cc:54). ~ProcessWatcher signals the shutdown event but does not wait/join for the background ThreadPool thread task to finish (process_watcher.cc:81-84). Consequently, the RPC thread deallocates SystemTracingSession immediately. When the preempted ThreadPool thread resumes, it calls CoDisconnectObject(unknown) on the now-freed pointer, initiating a virtual function call on a dangling pointer.
Because cet_shadow_stack (Intel CET) is disabled for this executable target (BUILD.gn:22-23), reclaiming the deallocated session's heap slot could allow an attacker to hijack control flow.
Potential Attack Steps
- A local low-privilege interactive user calls
CoCreateInstanceto activateCLSID_SystemTracingSessionin the service. - The client calls
AcceptInvitationto register the active session and start the background process-monitoring task (ProcessWatcher). - The attacker terminates their client process to trigger both:
- The kernel process-handle signal (running
OnClientTerminatedon a ThreadPool thread). - The COM fast-rundown stub
Release(destroying the session on an RPC thread).
- The kernel process-handle signal (running
- A race is triggered: if the ThreadPool thread exchanges the pointer and gets preempted before invoking
CoDisconnectObject, the RPC thread will delete the session unhindered. - When the ThreadPool thread resumes, it performs a virtual call (
QueryInterface) on the freedSystemTracingSessionobject. - Grooming/spraying the heap from a secondary COM connection to reclaim the deallocated block could lead to arbitrary code execution as
NT AUTHORITY\SYSTEM.
Note: These are suggested potential steps; our tooling does not currently have the capability to execute code or run a working Proof of Concept (PoC).
Suggested Fix
To remediate this race, ~ProcessWatcher must block and wait for the posted background ThreadPool task to terminate before allowing destruction of the outer class to proceed, or SessionCore should extend the lifetime of the SystemTracingSession object by managing strong references (Microsoft::WRL::ComPtr) rather than un-refcounted raw pointers.
Evaluated with Chrome root at commit: e9507a33bb4148ee071aaaf8a7e9ad68770359bf
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the ProcessWatcher destructor does not wait for its background thread-pool task to finish, allowing the SystemTracingSession object to be freed while a thread-pool thread still holds a raw pointer to it.
Impact
A local interactive user could potentially escalate privileges to SYSTEM, though the report notes that no working proof of concept was executed.
What the attacker needed
Local interactive user; Windows elevated tracing service running; ability to activate COM object
The fix
The fix should make the ProcessWatcher destructor wait for its background task to finish, or have SessionCore hold a strong reference to the SystemTracingSession object.
How it was found
- A local low-privilege user activates the SystemTracingSession COM object in the service.
- The client calls AcceptInvitation to register the session and start the process-monitoring task.
- The attacker terminates their client process, triggering both the process-handle signal and COM rundown.
- A race occurs: the thread-pool thread exchanges the pointer and is preempted before calling CoDisconnectObject.
- The RPC thread deletes the session, and when the thread-pool thread resumes it makes a virtual call on the freed object.
- Heap grooming from a secondary COM connection could reclaim the freed block and lead to code execution as SYSTEM.
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.
This report describes a bug in a Windows background service that helps trace system activity. A 'use-after-free' happens when a program keeps using a piece of memory after it has been freed, which can let an attacker take control. Here, a local user could potentially trick the service into using freed memory to gain higher privileges.
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.