Windows MSAA IAccessible::get_accSelection() multi-selection enumerator due to raw `Accessible*` lifetime lead to UAF
The Windows MSAA implementation of get_accSelection() for multi-selection gathers raw Accessible pointers into an enumerator that can outlive the underlying remote accessibles. A later call to the enumerator's Next() may dereference freed pointers, giving a use-after-free.
Originally disclosed on Mozilla
- Fixed in 13 days
- Paid in 17 days
- Disclosed after 13 days
Summary
In windows MSAA IAccessible::get_accSelection() for multiple selection, the implementation lead to UAF.
-
MsaaAccessible::get_accSelection()will gathers selected items as rawAccessible*and, for multi-selection, returnsAccessibleEnumerator(selectedItems). -
AccessibleEnumeratorstores a cloned array of rawAccessible*. -
AccessibleEnumerator::Next()later reuses stored pointers viaMsaaAccessible::NativeAccessible(mArray[mCurIndex]). -
In the remote path,
RemoteAccessible::Shutdown()leads toDocAccessibleParent::RemoveAccessible(...), and the object appears to be deleted from the owning proxy map.
A multi-selection enumerator may outlive the selected remote accessibles and later dereference freed Accessible* values in Next().
I verified symbol resolution and breakpoints for the relevant functions in a Windows ASan/debug environment, including:
MsaaAccessible::get_accSelectionAccessibleEnumerator::NextDocAccessibleParent::RemoveAccessibleRemoteAccessible::ShutdownMsaaAccessible::NativeAccessible
I do not yet have ASan confirmation because my A11y client repro is still incomplete.
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 enumerator stores raw Accessible pointers without keeping the referenced objects alive, so remote accessible shutdown can free them while the enumerator still holds them.
Impact
A multi-selection enumerator could outlive the selected remote accessibles and later dereference freed memory, though the reporter has not yet confirmed this with ASan.
What the attacker needed
Windows accessibility client; multi-selection accessible object; remote accessible destroyed while enumerator lives
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a screen reader asks Windows which items are selected, the browser builds a small list that holds direct references to internal objects. If those objects are destroyed while the list still exists, the list points at freed memory. Reading through it later is a use-after-free, which can crash the browser or, in principle, be abused to run code.
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.