Use after free in Aura (CVE-2026-19147)
A use-after-free was reported in Chromium's Aura window code on Linux/X11: a cursor move call can synchronously dispatch X11 replies, which may cause an observer to destroy the WindowTreeHost while it is still on the call stack. The function then dereferences freed members, which the report says could potentially lead to memory corruption and, with heap spraying, arbitrary code execution in the browser process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 52 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 WindowTreeHost::MoveCursorToInternal in the Chromium browser process on Linux/X11. During a cursor movement operation, synchronous X11 message dispatching can trigger window bounds changes and subsequent observer destruction of the WindowTreeHost. Because WindowTreeHost::MoveCursorToInternal lacks a liveness check after returning from the cursor move call, it can access freed member variables, potentially leading to memory corruption.
Affected files:
ui/aura/window_tree_host.cc
Estimated timestamp from git blame: 2025-03-06
Root Cause Analysis
In ui/aura/window_tree_host.cc, the function WindowTreeHost::MoveCursorToInternal does not employ a liveness guard after calling MoveCursorToScreenLocationInPixels. On Linux/X11, this call can lead to synchronous window destruction while still on the call stack.
// ui/aura/window_tree_host.cc:798-809
void WindowTreeHost::MoveCursorToInternal(const gfx::Point& root_location,
const gfx::Point& host_location) {
last_cursor_request_position_in_host_ = host_location;
MoveCursorToScreenLocationInPixels(host_location);
// <--- Potential destruction of |this| can occur here synchronously
client::CursorClient* cursor_client = client::GetCursorClient(window()); // UAF
if (cursor_client) {
const display::Display& display =
display::Screen::Get()->GetDisplayNearestWindow(window());
cursor_client->SetDisplay(display);
}
dispatcher()->OnCursorMovedToRootLocation(root_location); // UAF
}
When MoveCursorToScreenLocationInPixels executes on X11, the execution flow is as follows:
WindowTreeHostPlatform::MoveCursorToScreenLocationInPixels(inui/aura/window_tree_host_platform.cc) is invoked.- This delegates to
platform_window_->MoveCursorTo(location_in_pixels), which is implemented byX11Window::MoveCursorTo(inui/ozone/platform/x11/x11_window.cc). - Inside
X11Window::MoveCursorTo, the code requests the current bounds viaGetBoundsInPixels(). - If the window's geometry cache is not yet ready (such as in a newly opened window or right after a reparenting event),
geometry_cache_->GetBoundsPx()is called, which invokesDispatchNow()on a pending X11 future. DispatchNow()synchronously processes pending X server replies, triggering the registeredbounds_changed_callback_(X11Window::OnBoundsChanged).- This propagates upwards to
WindowTreeHostPlatform::OnBoundsChangedand callsOnHostMovedInPixels(), which notifies registeredWindowTreeHostObservers. - An observer (such as a transient bubble or anchor tracker) might synchronously destroy the window/widget via
Widget::CloseNow(). This results in the synchronous deletion of theWindowTreeHostinstance (host_.reset()). - When the synchronous execution stack unwinds,
X11Window::MoveCursorTosafely returns because of its localweak_thischeck. However, control returns toWindowTreeHost::MoveCursorToInternal, which has no liveness guard. It proceeds to dereferencethis->window_andthis->dispatcher_, leading to a Use-After-Free.
Potential Impact
This is a potential Use-After-Free (UAF) in the unsandboxed browser process. Since the dangling pointer is this, MiraclePtr (raw_ptr) does not mitigate this access because the member accesses (window_ and dispatcher_) are loads from the freed WindowTreeHost allocation itself.
If an attacker can reoccupy the freed allocation using heap-spraying techniques during the observer execution phase, they could potentially control the returned Window* and subsequently hijack the indirect virtual call to cursor_client->SetDisplay() or the virtual dispatch inside dispatcher(). This could lead to arbitrary code execution in the context of the browser process.
Suggested Potential Trigger Steps
Note: These are suggested and analytical execution steps. Our tooling does not currently have the capability to execute live browser runs or generate functional PoCs.
- From a compromised renderer, trigger a Pointer Lock request via Mojo IPC (
blink.mojom.WidgetInputHandlerHost::RequestMouseLock) on an X11 window whose geometry cache is not yet initialized (e.g., a freshly opened popup window). - The browser process grants the lock and triggers
MoveCursorToCenterwhich propagates toWindowTreeHost::MoveCursorToInternal. - The synchronous X11 message dispatch causes the geometry cache to execute its response handler synchronously.
- If a custom or transient window observer reacts to the bounds change by synchronously invoking
CloseNow(), theWindowTreeHostis deleted. - The memory is sprayed to reoccupy the slot, and control returns to
MoveCursorToInternalwhere the stalethispointer is dereferenced.
Suggested Fix
To prevent this vulnerability, a base::WeakPtr liveness check should be introduced in WindowTreeHost::MoveCursorToInternal immediately following the call to MoveCursorToScreenLocationInPixels.
void WindowTreeHost::MoveCursorToInternal(const gfx::Point& root_location,
const gfx::Point& host_location) {
last_cursor_request_position_in_host_ = host_location;
base::WeakPtr<WindowTreeHost> weak_this = GetWeakPtr();
MoveCursorToScreenLocationInPixels(host_location);
if (!weak_this) {
return;
}
client::CursorClient* cursor_client = client::GetCursorClient(window());
if (cursor_client) {
const display::Display& display =
display::Screen::Get()->GetDisplayNearestWindow(window());
cursor_client->SetDisplay(display);
}
dispatcher()->OnCursorMovedToRootLocation(root_location);
}
Evaluated with Chrome root at commit: 70c6813870b6701fa16670076bf633ee6c3a439f
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 function calls into X11 code that can synchronously destroy the WindowTreeHost, and it has no liveness check before touching its own members afterwards.
Impact
The report claims a use-after-free in the unsandboxed browser process that could potentially lead to arbitrary code execution, but it notes no live browser run or functional proof of concept was produced.
What the attacker needed
Compromised renderer; Linux/X11; window with uninitialised geometry cache; observer closes window on bounds change
The fix
A weak-pointer liveness check should be added immediately after the cursor move call so the function returns if the object was destroyed.
How it was found
- From a compromised renderer, request pointer lock on an X11 window whose geometry cache is not yet initialised, such as a freshly opened popup.
- The browser grants the lock and the cursor move reaches WindowTreeHost::MoveCursorToInternal.
- Synchronous X11 message dispatch runs the geometry cache response handler immediately.
- An observer reacting to the bounds change synchronously closes the window, deleting the WindowTreeHost.
- Heap spraying reoccupies the freed slot, and the stale pointer is dereferenced after control returns.
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 program frees an object but keeps using it, that is a use-after-free. Here, moving the mouse cursor can cause a window to be closed and its internal object deleted in the middle of the same function, and the code afterwards still reads from that deleted object. The report is analytical: it says no working proof of concept was 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.