Use after free in Accessibility (CVE-2026-9905)
A race condition between COM's fast rundown on an RPC thread and UI thread mutations to the global AXTreeManagerMap causes a use-after-free on the map's backing array. A compromised renderer could exploit this to achieve arbitrary memory corruption and potentially escape the sandbox.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 56 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 without the security team.
Overview: A race condition exists between COM's IFastRundown mechanism on an RPC thread and UI thread mutations to the process-global AXTreeManagerMap. This leads to a Use-After-Free (UAF) on the map's backing array, bypassing MiraclePtr (BRP) and allowing a compromised renderer to achieve arbitrary memory corruption and potential sandbox escape.
Affected files:
ui/accessibility/platform/ax_platform_node_textrangeprovider_win.ccui/accessibility/ax_tree_manager_map.hui/accessibility/ax_tree_manager_map.ccui/accessibility/platform/sequence_affine_com_object_root_win.hui/accessibility/ax_tree_manager.ccui/accessibility/ax_tree_manager.h
Estimated timestamp from git blame: 2023-06-23
Background
AXPlatformNodeTextRangeProviderWin is a COM class used to provide text range information to UI Automation (UIA) clients on Windows. It inherits from SequenceAffineComObjectRoot and CComSingleThreadModel, indicating it is designed to run on the UI thread (an STA). To reduce latency during out-of-process client crashes, it implements IFastRundown.
The Vulnerability
When an out-of-process UIA client terminates abruptly, the COM runtime initiates a fast rundown. Because IFastRundown is implemented, COM bypasses STA marshaling and calls Release() directly on an RPC dispatch thread.
SequenceAffineComObjectRoot::InternalRelease() asserts it is on the correct sequence via DCHECK_CALLED_ON_VALID_SEQUENCE. However, because DCHECKs are removed in release builds, the sequence violation is ignored, and the object is destroyed on the RPC thread.
During destruction, ~TextRangeEndpoints() sets its start and end positions to null sequentially:
SetStart(null)setsstart_toAXTreeIDUnknown().SetEnd(null)evaluates whether to callRemoveObserver(end_->tree_id()). The checkend_->tree_id() != start_->tree_id()evaluates totruebecausestart_was just nulled. This erroneously triggersRemoveObserverfor theend_tree ID on the RPC thread.
RemoveObserver calls AXTreeManager::FromID(), which accesses the process-global, unsynchronized AXTreeManagerMap (an absl::flat_hash_map<AXTreeID, raw_ptr<AXTreeManager>>).
The Race Condition and BRP Bypass
Concurrently, a compromised renderer can rapidly create and destroy <iframe> elements, forcing the browser to insert and remove entries in the AXTreeManagerMap on the UI thread. This causes the absl::flat_hash_map to frequently rehash, allocating new backing slot arrays and freeing old ones.
If the RPC thread executes map_.find() while the UI thread is rehashing the map, the RPC thread will read from a freed slot array.
Crucially, MiraclePtr (BRP) does not prevent exploitation here. The UAF occurs on the container's backing array (which holds the raw_ptr bytes), not the AXTreeManager object itself. An attacker can reclaim the freed slot array and directly overwrite the 8 bytes of the raw_ptr, bypassing BRP quarantine entirely.
Exploitation Primitive
The attacker controls the pointer returned by GetManager. The code proceeds to call ax_tree_manager->ax_tree()->RemoveObserver(this); using the fake AXTreeManager. This invokes ObserverList::RemoveObserver on an attacker-controlled fake AXTree object.
By carefully crafting the fake ObserverList memory structure (e.g., controlling observers_ vector pointers and the live_iterators_ linked list), the attacker can force ObserverList to execute it->MarkForRemoval() or observers_.erase(it) on arbitrary addresses. This provides powerful arbitrary decrement, arbitrary null-write, or arbitrary memory move primitives, which can be leveraged to hijack control flow and escape the sandbox.
Potential Attacker Steps
Note: These steps are theoretical, as our tooling agent cannot execute code.
- Compromise a renderer process.
- Execute a loop rapidly creating and destroying iframes to trigger UI thread map mutations and rehashes.
- Spray the browser heap to reclaim freed
absl::flat_hash_mapbacking arrays with fakeraw_ptr<AXTreeManager>entries. - Induce a crash in an out-of-process UIA client to trigger COM fast rundown on the RPC thread.
- The RPC thread reads the attacker's fake pointer and accesses a fake
AXTree. - Use the
ObserverList::RemoveObserverprimitive to corrupt a function pointer and execute arbitrary shellcode.
Suggested Fix
- Remove IFastRundown: The safest fix is to remove
IFastRundownfromAXPlatformNodeTextRangeProviderWin. If an object is strictly tied to an STA (UI thread), it must be cleaned up on that thread, even if it delays rundown. - Enforce Sequence Checks: Upgrade the
DCHECKinSequenceAffineComObjectRootto aCHECKto ensure COM objects are never destroyed off-sequence in release builds. - Thread-Safe Map: If cross-thread access to
AXTreeManagerMapis truly required, synchronize access using anabsl::Mutexor base locking mechanism.
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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 combination of IFastRundown allowing off-thread destruction, a DCHECK that is removed in release builds, and an unsynchronised global map accessed from two threads.
Impact
A compromised renderer could achieve arbitrary memory corruption and potentially escape the sandbox, though the report notes the steps are theoretical and not executed.
What the attacker needed
Compromised renderer process; out-of-process UIA client crash; Windows platform
The fix
The report suggests removing IFastRundown, upgrading the DCHECK to a CHECK, and synchronising access to AXTreeManagerMap; it does not state that a fix was applied.
How it was found
- Compromise a renderer process.
- Execute a loop rapidly creating and destroying iframes to trigger UI thread map mutations and rehashes.
- Spray the browser heap to reclaim freed absl::flat_hash_map backing arrays with fake raw_ptr<AXTreeManager> entries.
- Induce a crash in an out-of-process UIA client to trigger COM fast rundown on the RPC thread.
- The RPC thread reads the attacker's fake pointer and accesses a fake AXTree.
- Use the ObserverList::RemoveObserver primitive to corrupt a function pointer and execute arbitrary shellcode.
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 happens when a program frees memory but then keeps using it, letting an attacker control what's there. Here, a timing problem between two threads lets a malicious webpage (running in a compromised renderer) trick the browser into using freed memory, which could let the attacker run their own code and break out of the browser's security sandbox.
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.