Use after free in Aura (CVE-2026-8514)
A use-after-free exists in WindowTreeHostPlatform::OnStateUpdate because it calls OnBoundsChanged, which can synchronously destroy the host object, and then continues to use the dangling this pointer and latest state reference. An attacker with renderer code execution could potentially trigger this to achieve remote code execution in the browser process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 49 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A potential use-after-free vulnerability exists in WindowTreeHostPlatform::OnStateUpdate. The function calls OnBoundsChanged, which may synchronously destroy the host object, but it fails to check if this is still alive before continuing execution, potentially leading to remote code execution in the browser process.
Affected files:
ui/aura/window_tree_host_platform.ccui/ozone/platform/wayland/host/wayland_window.cc
Estimated timestamp from git blame: 2024-04-15
Description
A potential Use-After-Free (UAF) vulnerability has been identified in WindowTreeHostPlatform::OnStateUpdate. The issue occurs because the function calls OnBoundsChanged without any WeakPtr liveness check afterward. If a registered observer synchronously destroys the host during the bounds change, OnStateUpdate will continue to execute using a dangling this pointer and a dangling latest state reference.
Root Cause Analysis
In ui/aura/window_tree_host_platform.cc:
int64_t WindowTreeHostPlatform::OnStateUpdate(
const PlatformWindowDelegate::State& old,
const PlatformWindowDelegate::State& latest) {
// ...
if (old.bounds_dip != latest.bounds_dip || old.size_px != latest.size_px ||
old.window_scale != latest.window_scale) {
bool origin_changed = old.bounds_dip.origin() != latest.bounds_dip.origin();
OnBoundsChanged({origin_changed}); // <--- May synchronously destroy `this`
}
// VULNERABILITY: No WeakPtr check here.
bool needs_frame = latest.WillProduceFrameOnUpdateFrom(old); // UAF read of `latest`
if (old.occlusion_state != latest.occlusion_state &&
NativeWindowOcclusionTracker::
IsNativeWindowOcclusionTrackingAlwaysEnabled(this)) {
const bool visible_before = compositor()->IsVisible(); // UAF read of `this`
OnOcclusionStateChanged(latest.occlusion_state); // UAF virtual call
// ...
}
// ...
window()->AllocateLocalSurfaceId(); // UAF read of `this`
// ...
}
OnBoundsChanged correctly anticipates that it might be destroyed (e.g., via OnHostMovedInPixels notifying observers) and checks GetWeakPtr() internally. However, it returns control to OnStateUpdate, which blithely continues. Because this is an implicit raw pointer and latest is a stack reference to an element in the destroyed WaylandWindow's internal buffer, MiraclePtr (BRP) does not prevent these UAF reads/writes.
Potential Exploitation Steps
Note: These are suggested potential steps, as our setup does not currently have the ability to run code or build a working Proof of Concept.
- Compromise Renderer: An attacker gains initial code execution in a sandboxed renderer process.
- Trigger State Change: The attacker sends window management IPCs (e.g., bounds changes, fullscreen requests) to the browser process to trigger a Wayland
xdg_surface_configureevent. - Heap Grooming: Concurrently, the attacker sprays the browser process heap using standard primitive techniques (like Blobs) to prepare for memory reclamation.
- Synchronous Destruction: The attacker triggers a specific UI state or timing window where a bounds change notification (like
OnHostMovedInPixels) causes an observer to synchronously destroy theWindowTreeHostPlatform(this pattern is already known and tested inDeleteHostFromOnHostMovedInPixels). - Reclaim and Execute: The
WindowTreeHostPlatformand itsWaylandWindoware freed. The sprayed data reclaims the memory. WhenOnStateUpdateresumes, it uses the attacker-controlled memory to resolvecompositor()and vtable lookups (likeOnOcclusionStateChanged), achieving Remote Code Execution in the browser process.
Impact
This is a potential high-severity Use-After-Free in the highly privileged browser process. It provides a robust primitive for an attacker to achieve Remote Code Execution (RCE) and completely escape the Chrome sandbox.
Suggested Fix
Guard the execution of OnStateUpdate with a WeakPtr check immediately following the call to OnBoundsChanged. If the host is destroyed, the function should safely return early.
bool origin_changed = old.bounds_dip.origin() != latest.bounds_dip.origin();
auto weak_ref = GetWeakPtr();
OnBoundsChanged({origin_changed});
if (!weak_ref)
return -1; // Or appropriate default sequence number indicating no frame needed
Evaluated with Chrome root at commit: 0eb4855bda702feaaa8b899336664f97e3df88b8
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. Please feel free to reach out to me if you have concerns or feedback.
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 OnStateUpdate calls OnBoundsChanged without a WeakPtr liveness check, so if an observer destroys the host during that call, it continues with a dangling this pointer and latest reference.
Impact
This could allow an attacker to achieve remote code execution in the browser process and completely escape the Chrome sandbox.
What the attacker needed
Renderer code execution; Wayland display server; heap grooming capability
The fix
The function should be guarded with a WeakPtr check immediately after calling OnBoundsChanged, returning early if the host was destroyed.
How it was found
- Compromise the renderer process to gain initial code execution.
- Send window management IPCs to trigger a Wayland xdg_surface_configure event.
- Spray the browser process heap to prepare for memory reclamation.
- Trigger a bounds change notification that causes an observer to synchronously destroy the WindowTreeHostPlatform.
- Reclaim the freed memory with sprayed data and let OnStateUpdate resume, using attacker-controlled memory for vtable lookups to achieve remote code execution.
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 an object but keeps using it, like reading a deleted file. Here, a function calls another function that can delete the object it is running on, but it does not check and keeps using the deleted object. An attacker who can control the freed memory could make the program run their 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.