Use after free in Core (CVE-2026-9994)
A potential use-after-free exists in Windows-specific renderer host code because synchronous Win32 calls can trigger nested message loops that destroy the object while its method is still executing. An attacker could potentially reclaim the freed memory and hijack control flow via virtual function calls.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 14 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 without the Chrome Security team. 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) exists in the Windows-specific renderer host code due to re-entrancy in synchronous Win32 calls. Synchronous APIs like ::SetWindowPos can trigger nested message loops that process pending window-destruction tasks while the caller is still on the stack. This can lead to the destruction of RenderWidgetHostViewAura and LegacyRenderWidgetHostHWND before their methods finish executing.
Affected files:
content/browser/renderer_host/legacy_render_widget_host_win.cccontent/browser/renderer_host/render_widget_host_view_aura.cccontent/browser/renderer_host/direct_manipulation_helper_win.cc
Estimated timestamp from git blame: 2015-08-11
Description
A potential Use-After-Free (UAF) vulnerability has been identified in content/browser/renderer_host/render_widget_host_view_aura.cc and content/browser/renderer_host/legacy_render_widget_host_win.cc. The issue stems from the use of synchronous Win32 calls, such as ::SetWindowPos, within the resize and bounds-synchronization logic on Windows.
On Windows, synchronous calls to ::SetWindowPos can dispatch window messages and, under certain conditions (such as when UI Automation or system hooks are active), enter a nested message loop. If a renderer-initiated window closure (e.g., via window.close()) is pending, the nested loop may process the destruction task while the bounds-synchronization method is still executing.
In LegacyRenderWidgetHostHWND::SetBounds, the code calls ::SetWindowPos at line 199. If a nested loop processes the window destruction, both the LegacyRenderWidgetHostHWND and its parent RenderWidgetHostViewAura (RWHVA) are deleted. Upon return from ::SetWindowPos, the method continues to access members of the now-deleted object. Furthermore, the caller RenderWidgetHostViewAura::HandleBoundsInRootChanged (or UpdateLegacyWin) resumes execution and accesses its own members (e.g., in_shutdown_, host_) on a potentially freed RWHVA object.
Potential Impact
This is a potential Use-After-Free in the unsandboxed browser process. While LegacyRenderWidgetHostHWND is protected by the ADVANCED_MEMORY_SAFETY_CHECKS quarantine, RenderWidgetHostViewAura is not. An attacker could potentially reclaim the memory of the RenderWidgetHostViewAura object with controlled data before the execution resumes, leading to a control-flow hijack via virtual function calls on members like host_.
Suggested Reproductions Steps (Potential)
- From a compromised renderer, open a new popup window:
const p = window.open('about:blank', ...). - Request a resize of the popup:
p.resizeTo(200, 200). - Immediately request the popup to close:
p.close(). - If the browser processes the resize first, it enters
SetBounds. If::SetWindowPostriggers a nested loop, it may execute the queued destruction task, leading to the UAF when execution resumes.
Note: These steps are based on static analysis and have not been verified with a functional Proof of Concept.
Recommended Fix
Methods that perform synchronous Win32 calls or parent updates should use a base::WeakPtr guard to check for object liveness after the call. Similar to the pattern already used in LegacyRenderWidgetHostHWND::UpdateParent, a guard should be added in SetBounds and its callers in RenderWidgetHostViewAura to return early if the object has been destroyed.
// Suggested fix in LegacyRenderWidgetHostHWND::SetBounds
base::WeakPtr<LegacyRenderWidgetHostHWND> ref(msg_handler_weak_factory_.GetWeakPtr());
::SetWindowPos(hwnd(), nullptr, ...);
if (!ref) return;
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
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 code calls synchronous Win32 APIs that can process pending window-destruction tasks via a nested message loop, and then continues to access members of the now-freed object without a liveness check.
Impact
This is a potential use-after-free in the unsandboxed browser process; an attacker could potentially reclaim the memory of the RenderWidgetHostViewAura object with controlled data before execution resumes, leading to a control-flow hijack via virtual function calls.
What the attacker needed
Compromised renderer; Windows platform; UI Automation or system hooks active
The fix
Methods that perform synchronous Win32 calls or parent updates should use a base::WeakPtr guard to check for object liveness after the call and return early if the object has been destroyed.
How it was found
- From a compromised renderer, open a new popup window.
- Request a resize of the popup.
- Immediately request the popup to close.
- If the browser processes the resize first, it enters SetBounds; if the synchronous call triggers a nested loop, it may execute the queued destruction task, leading to the UAF when execution resumes.
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 is a bug where a program keeps using a piece of memory after it has been freed. Here, a Windows function call can unexpectedly run other code that deletes the object, so when the original function continues it is working with memory that no longer belongs to it. An attacker who can control what replaces that memory might then take over the program.
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.