Use after free in Aura (CVE-2026-19149)
A use-after-free was reported in the browser process on Linux/X11: querying the display id during a display metric change can synchronously dispatch X11 events that destroy the window host and its compositor. The code then reads and writes to the freed objects, which the report says could allow control-flow hijacking in the unsandboxed browser process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 51 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 browser process on Linux/X11 platforms during display metric updates. Under Ozone/X11, a call to GetDisplayId() can synchronously dispatch X11 events and lead to the reentrant destruction of the WindowTreeHost object. Subsequent evaluations within the same expression and calls to the associated compositor access and write to freed memory.
Affected files:
ui/aura/window_tree_host.ccui/ozone/platform/x11/x11_window.ccui/compositor/compositor.cc
Estimated timestamp from git blame: 2025-03-06
Root Cause Analysis
In ui/aura/window_tree_host.cc, the method WindowTreeHost::OnDisplayMetricsChanged is responsible for handling display updates. On the DISPLAY_METRIC_COLOR_SPACE branch, it evaluates GetDisplayId() inside a short-circuiting if statement:
// ui/aura/window_tree_host.cc:648-653
void WindowTreeHost::OnDisplayMetricsChanged(const display::Display& display,
uint32_t metrics) {
if (metrics & DisplayObserver::DISPLAY_METRIC_COLOR_SPACE && compositor_ &&
display.id() == GetDisplayId() && !display_color_spaces_) {
compositor_->SetDisplayColorSpaces(display.GetColorSpaces());
}
On Linux/X11, GetDisplayId() delegates through ScreenOzone to X11ScreenOzone::GetDisplayForAcceleratedWidget, which retrieves window bounds (ui/ozone/platform/x11/x11_screen_ozone.cc:137-138):
return GetDisplayForRect(GetAllDisplays(), window->GetBoundsInPixels(), true);
X11Window::GetBoundsInPixels() invokes geometry_cache_->GetBoundsPx() (ui/ozone/platform/x11/x11_window.cc:620). As documented in the codebase, if the geometry cache is un-ready or has pending requests, querying bounds synchronously dispatches pending X server events using parent_future_.DispatchNow():
// ui/ozone/platform/x11/x11_window.cc:614-617
// Note: geometry_cache_->GetBoundsPx() can dispatch pending X server events
// synchronously, which can trigger window destruction and invalidate `this`.
If the dispatched events trigger window closure (e.g. via layout/widget bounds observers), the WindowTreeHost object and its associated ui::Compositor are synchronously deleted.
When control returns from GetDisplayId() back to the expression chain in OnDisplayMetricsChanged, this has already been freed:
- Evaluating
!display_color_spaces_reads from the freedWindowTreeHostinstance (UAF read). - The statement
compositor_->SetDisplayColorSpaces(...)reads thecompositor_unique pointer from the freed host memory, and invokesSetDisplayColorSpaceson the already-deletedCompositorobject. - Inside
Compositor::SetDisplayColorSpaces(ui/compositor/compositor.cc:553), updatingdisplay_color_spaces_results in a heap write to the freedCompositorslot. This is followed by a dereference ofhost_(ui/compositor/compositor.cc:555), allowing potential control-flow hijacking in the unsandboxed browser process.
Potential Attack Scenario
Note: These are suggested/potential steps of an exploit flow. Our tooling agent does not have the ability to run code or compile a working proof-of-concept.
- A compromised GPU process or local same-display client issues a
ReparentWindowrequest against a browser window to put the parentGeometryCacheinto an un-Readystate with pending futures. - The attacker triggers a display color space change by modifying the root-window
_ICC_PROFILEproperty and altering_NET_WORKAREAproperties to dispatch a metric notification. - The browser receives the notification and runs
WindowTreeHost::OnDisplayMetricsChangedwithDISPLAY_METRIC_COLOR_SPACE. - Mid-expression evaluation, the synchronous bounds-query forces event dispatch, which triggers a bounds-observer that synchronously closes/deletes the
WindowTreeHostand itsCompositor. - Upon return, the browser process accesses the freed
WindowTreeHostandCompositormemory, yielding a Use-After-Free heap write.
Suggested Fix
Guard the metric changes inside WindowTreeHost::OnDisplayMetricsChanged using a base::WeakPtr of the host before performing queries that can cause reentrant deletion, and check its validity before accessing members or invoking the compositor:
void WindowTreeHost::OnDisplayMetricsChanged(const display::Display& display,
uint32_t metrics) {
if (metrics & DisplayObserver::DISPLAY_METRIC_COLOR_SPACE && compositor_) {
auto weak_this = GetWeakPtr();
const int64_t display_id = GetDisplayId();
if (!weak_this)
return;
if (display.id() == display_id && !display_color_spaces_) {
compositor_->SetDisplayColorSpaces(display.GetColorSpaces());
}
}
// Apply similar WeakPtr guards to subsequent metric branches if necessary.
}
Evaluated with Chrome root at commit: 75203b87cbf6681eb7c7dda8e1d0bf781538c76a
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 a reentrancy problem: a getter called inside a condition can synchronously dispatch X11 events that delete the WindowTreeHost and its Compositor, and the remaining expression then uses those freed objects without a lifetime guard.
Impact
The report claims a heap write to freed memory in the unsandboxed browser process, which could potentially allow control-flow hijacking, though no working exploit was built and the scenario is described as suggested and potential.
What the attacker needed
Linux/X11 platform; compromised GPU process or local client; ability to change root-window properties
The fix
The report suggests guarding the handler with a weak pointer to the host, checking it after the display id lookup and before touching members or the compositor.
How it was found
- Put the parent geometry cache into a not-ready state with pending requests, for example via a ReparentWindow request from a compromised GPU process or local client.
- Trigger a display colour space change by altering root-window properties so a metric notification is dispatched.
- The browser runs the display metrics handler for the colour space metric.
- During the display id lookup, the synchronous bounds query dispatches events that close and delete the window host and compositor.
- On return, the browser reads and writes the freed memory.
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, that memory can be reused, so touching it afterwards is a use-after-free. Here, a routine that handles a screen change asks for the display id, and that question can trigger other events that close and delete the window object. The code then keeps using the deleted object, which can let an attacker influence what the browser does next.
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.