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

Use after free in Browser (CVE-2026-87494)

A WinRT event handler for closed caption property changes runs on a system MTA thread and directly notifies a non-thread-safe observer list, racing with UI-thread mutations. An attacker could potentially trigger a use-after-free and achieve code execution in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 months

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 browser process of Chromium due to a thread-safety issue with the WinRT ClosedCaptionProperties.PropertiesChanged event handler. The event callback runs on a system Multi-Threaded Apartment (MTA) thread and calls NotifyOnCaptionStyleUpdated directly without dispatching back to the UI thread. This creates a race condition with the UI thread mutating the non-thread-safe base::ObserverList, potentially leading to memory corruption or browser process code execution.

Affected files:

  • ui/native_theme/native_theme_win.cc
  • ui/native_theme/native_theme.cc

Estimated timestamp from git blame: 2026-04-22

Description

A potential Use-After-Free (UAF) vulnerability exists in the Windows browser process of Chromium. The issue lies in NativeThemeWin::RegisterClosedCaptionPropertiesChangedListener() (ui/native_theme/native_theme_win.cc:1119-1149), which registers a WinRT event handler whose body runs directly on the calling thread of the WinRT event source—typically a system MTA threadpool thread—and immediately calls NotifyOnCaptionStyleUpdated() on the Web theme instance:

C++
// ui/native_theme/native_theme_win.cc:1135-1142
EventRegistrationToken token;
hr = caption_statics2_->add_PropertiesChanged(
    Microsoft::WRL::Callback<ABI::Windows::Foundation::IEventHandler<
        IInspectable*>>([](IInspectable*, IInspectable*) -> HRESULT {
      NativeTheme::GetInstanceForWeb()->NotifyOnCaptionStyleUpdated();
      return S_OK;
    }).Get(),
    &token);

In a production release build, the sequence checker inside NotifyOnCaptionStyleUpdated() is compiled out:

C++
// ui/native_theme/native_theme.cc:293-300
void NativeTheme::NotifyOnCaptionStyleUpdated() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Stripped in release builds

  native_theme_observers_.Notify(&NativeThemeObserver::OnCaptionStyleUpdated);
}

The member native_theme_observers_ is a non-thread-safe base::ObserverList<> (ui/native_theme/native_theme.h:598-602), backed by a std::vector of observers (base/observer_list.h:510). The class documentation explicitly states:

"ObserverList is not thread-compatible. Iterating on the same ObserverList simultaneously in different threads is not safe."

Because this list is mutated on the browser's UI thread (e.g., when a page rapidly attaches/detaches iframe frames or opens/closes sub-windows, driving WebContentsImpl construction and destruction which registers/unregisters observers), an MTA thread iterating the list via the WinRT callback concurrently with a UI thread reallocating the underlying std::vector triggers a Use-After-Free (UAF).

Potential Attack/Trigger Path

Note: These are potential, suggested steps to trigger the race condition, as our tooling agent doesn't yet have the ability to run code.

  1. User Interaction: The user is social-engineered to alter accessibility options (e.g., Settings → Accessibility → Captions) while visiting a malicious page.
  2. Page-Driven Observer Churn: The page continuously opens and closes frames or sub-windows, forcing the browser process UI thread to register/deregister WebContentsImpl instances to/from the NativeTheme::GetInstanceForWeb() observer list. This results in frequent memory reallocations of the underlying std::vector.
  3. MTA Thread Notification: The Windows OS raises the PropertiesChanged event, running the registered callback on an MTA thread.
  4. Race Condition and UAF: The MTA thread processes the callback and indexes into the freed/reallocated observer list buffer. It reads a corrupted CheckedObserverAdapter and performs a virtual call to OnCaptionStyleUpdated() on an attacker-influenced pointer, potentially leading to control flow hijacking / Remote Code Execution (RCE) in the browser process.

Suggested Fix

To fix this thread-safety issue, the WinRT callback must hop back to the correct sequence using a task runner before performing any observer notification. This can be securely achieved by wrapping the callback using base::BindPostTask or a sequence task runner.

For instance, capture the current SequencedTaskRunner and post a task:

C++
auto task_runner = base::SequencedTaskRunner::GetCurrentDefault();
hr = caption_statics2_->add_PropertiesChanged(
    Microsoft::WRL::Callback<ABI::Windows::Foundation::IEventHandler<
        IInspectable*>>([task_runner](IInspectable*, IInspectable*) -> HRESULT {
      task_runner->PostTask(
          FROM_HERE,
          base::BindOnce([]() {
            NativeTheme::GetInstanceForWeb()->NotifyOnCaptionStyleUpdated();
          }));
      return S_OK;
    }).Get(),
    &token);

Evaluated with Chrome root at commit: d8b226a3be7c9c1ac9240c09e14698866c82e4ac


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 WinRT PropertiesChanged callback runs on an MTA thread and calls NotifyOnCaptionStyleUpdated directly, without posting back to the UI sequence, so it iterates a non-thread-safe ObserverList concurrently with UI-thread mutations.

Impact

The race could lead to memory corruption and potentially remote code execution in the browser process, though the report notes the steps are only potential and have not been executed.

What the attacker needed

Windows browser process; victim changes caption settings; victim visits malicious page; race timing

The fix

The WinRT callback should post a task back to the correct sequence using a task runner before notifying observers.

How it was found

  1. The user is social-engineered to change accessibility caption settings while visiting a malicious page.
  2. The page repeatedly opens and closes frames or sub-windows, causing the UI thread to register and deregister observers and reallocate the underlying vector.
  3. The Windows OS raises the PropertiesChanged event, running the callback on an MTA thread.
  4. The MTA thread indexes into the freed or reallocated observer list buffer, reads a corrupted adapter, and makes a virtual call on an attacker-influenced pointer.

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 keeps using memory after it has been freed, which can let an attacker control what happens next. Here, a Windows system thread and the browser's main thread both touch the same list of observers without proper locking, so one can free the list while the other is still reading it. The report suggests this could lead to code execution, but the trigger steps are only theoretical and have not been run.

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.