Use after free in Extensions (CVE-2026-15110)
A use-after-free was identified in the browser process because AppWindow::SetNativeWindowFullscreen calls RestoreAlwaysOnTop without checking whether the AppWindow was destroyed during the nested message loop of the platform fullscreen transition. An attacker could potentially trigger code execution or a browser crash by closing the window while the fullscreen animation is running.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 43 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 due to a lack of liveness verification in extensions::AppWindow::SetNativeWindowFullscreen after completing a fullscreen transition. If the window is destroyed during the nested message loop spun by the platform fullscreen call, the AppWindow instance is deleted, resulting in a UAF when execution returns. This could potentially allow an attacker to trigger code execution or a browser crash.
Affected files:
extensions/browser/app_window/app_window.cc
Estimated timestamp from git blame: 2013-11-25
Root Cause Analysis
In extensions/browser/app_window/app_window.cc, the method AppWindow::SetNativeWindowFullscreen invokes the platform-specific fullscreen transition and subsequently calls RestoreAlwaysOnTop() without any liveness checks:
void AppWindow::SetNativeWindowFullscreen() {
native_app_window_->SetFullscreen(fullscreen_types_);
RestoreAlwaysOnTop(); // Potential Use-After-Free (UAF)
}
On platforms like macOS, the underlying call to native_app_window_->SetFullscreen() can spin a nested UI message loop to run the native transition animation synchronously (e.g., inside -[NSWindow toggleFullScreen:]). While multiple underlying layers in the widget hierarchy are protected against crashes during nested loop destruction, extensions::AppWindow (which acts as the WebContentsDelegate) does not perform any liveness checks upon returning from this transition.
Potential Destruction Sequence
If a window closure is queued or triggered during the nested loop inside the synchronous platform fullscreen call:
- The platform-specific widget processes destruction, leading to
WidgetDelegate::DeleteDelegate(). - The delete delegate callback runs, invoking
app_window_->OnNativeClose(). AppWindow::OnNativeClose()executesdelete this;, destroying theAppWindowinstance and freeing its members, includingstd::unique_ptr<NativeAppWindow> native_app_window_.- When control flow returns to
SetNativeWindowFullscreen(),RestoreAlwaysOnTop()is invoked on the freedthispointer. - If
cached_always_on_top_is true, the code entersUpdateNativeAlwaysOnTop(), which triggers virtual method calls (e.g.,GetZOrderLevel()) through the deletednative_app_window_pointer, potentially leading to a virtual table dispatch on freed memory.
Suggested Steps to Reproduce (Potential Flow)
Note: These steps are based on static code analysis and have not been validated with a running proof-of-concept.
- Launch a packaged app with the
app.windowAPI and set its window to "always on top" (setAlwaysOnTop(true)). - Programmatically trigger a transition to fullscreen (
chrome.app.window.current().fullscreen()). - While the fullscreen transition is animating (and the nested loop is active), programmatically trigger window close (e.g., via
window.close()). - Observe if the process crashes or exhibits undefined behavior due to the Use-After-Free condition when
RestoreAlwaysOnTop()is reached.
Proposed Fix
Use a weak pointer to check if the AppWindow instance is still alive before executing any logic following the platform fullscreen transition:
void AppWindow::SetNativeWindowFullscreen() {
base::WeakPtr<AppWindow> weak_this = image_loader_ptr_factory_.GetWeakPtr();
native_app_window_->SetFullscreen(fullscreen_types_);
if (!weak_this)
return;
RestoreAlwaysOnTop();
}
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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.
Raised in root component due to access or custom field issues on 1456886
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 code calls RestoreAlwaysOnTop on the AppWindow after a synchronous platform fullscreen call that can spin a nested message loop and delete the AppWindow, without any liveness check.
Impact
This could potentially allow an attacker to trigger code execution or a browser crash, though the steps are based on static analysis and have not been validated with a running proof-of-concept.
What the attacker needed
A packaged app using the app.window API; window set to always on top; close triggered during fullscreen animation
The fix
The fix should use a weak pointer to check that the AppWindow is still alive before calling RestoreAlwaysOnTop after the platform fullscreen transition.
How it was found
- Launch a packaged app with the app.window API and set its window to always on top.
- Programmatically trigger a transition to fullscreen.
- While the fullscreen transition is animating, programmatically trigger window close.
- Observe whether the process crashes or shows undefined behaviour when RestoreAlwaysOnTop is reached.
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 deletes an object but keeps using it, like reading a note after shredding it. Here, starting a fullscreen animation can let other events run, and if the window is closed during that time, the app window object is deleted while the fullscreen function still tries to use it. This can crash the browser or, in theory, let an attacker run their own 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.