Use after free in Core (CVE-2026-15773)
In Chromium's WebContentsImpl::CreateNewWindow, the noopener branch calls the delegate to add a new window and then keeps using the opener WebContents. On Windows, showing the new window can synchronously process a close message that destroys the opener, so the code afterwards reads freed memory, a use-after-free.
Originally disclosed on Chrome VRP
- Fix shipped in 20 days
Summary
In WebContentsImpl::CreateNewWindow, the opener-suppressed (noopener) branch
calls delegate_->AddNewContents() and then keeps dereferencing state owned by
this (opener, delegate_, and finally returns
&new_contents_impl->GetPrimaryFrameTree()). On Windows, AddNewContents() can
synchronously spin a nested run loop while showing the new browser window
(ShowWindow dispatches native window messages). A window-close message
(WM_SYSCOMMAND / SC_CLOSE) processed in that nested loop can destroy the
opener WebContents — i.e. the this currently executing CreateNewWindow —
before AddNewContents() returns. Execution then resumes on a freed this /
opener, leading to a use-after-free.
Details
The current code only guards the newly created contents via
weak_new_contents; it does not guard this. The re-entrant destruction path:
delegate_->AddNewContents() → Browser::AddNewContents → Navigate →
BrowserView::Show → views::Widget::Show → DesktopWindowTreeHostWin::Show →
ShowWindow (synchronously pumps native window messages) → nested WndProc
dispatch receives WM_SYSCOMMAND(SC_CLOSE) for the opener's browser window →
Browser::OnWindowClosing → TabStripModel::CloseAllTabs → destroys all tabs'
WebContents, including the opener (this).
After AddNewContents() returns, CreateNewWindow runs
load_params->initiator_origin = opener->GetLastCommittedOrigin(); on the freed
opener → UAF.
Location
content/browser/web_contents/web_contents_impl.cc,
WebContentsImpl::CreateNewWindow, the opener-suppressed tail (the
delegate_->AddNewContents(...) call and the code that follows it).
Evidence (representative stack)
Top frame is the crash point. Win32/comctl32/uxtheme message-dispatch noise is
collapsed but preserved enough to show this is a genuine nested WndProc
dispatch triggered synchronously by ShowWindow.
// ===== (4) Re-entrant destruction: opener WebContents (this) destroyed in nested loop =====
content::WebContentsImpl::~WebContentsImpl content/browser/web_contents/web_contents_impl.cc
std::unique_ptr<content::WebContents>::reset/~ (WebContents owned by the tab)
tabs::TabModel::~TabModel chrome/browser/ui/tabs/tab_model.cc
std::unique_ptr<tabs::TabModel>::reset
TabStripModel::SendDetachWebContentsNotifications chrome/browser/ui/tabs/tab_strip_model.cc
TabStripModel::InternalCloseTabsImpl chrome/browser/ui/tabs/tab_strip_model.cc
TabStripModel::CloseTabs chrome/browser/ui/tabs/tab_strip_model.cc
TabStripModel::CloseAllTabs chrome/browser/ui/tabs/tab_strip_model.cc
Browser::OnWindowClosingPostClearBrowsingData chrome/browser/ui/browser.cc
Browser::OnWindowClosing chrome/browser/ui/browser.cc
BrowserView::OnWindowCloseRequested chrome/browser/ui/views/frame/browser_view.cc
views::Widget::CloseWithReason ui/views/widget/widget.cc
views::HWNDMessageHandler::ProcessWindowMessage ui/views/win/hwnd_message_handler.h
views::HWNDMessageHandler::OnWndProc ui/views/win/hwnd_message_handler.cc
gfx::WindowImpl::WndProc ui/gfx/win/window_impl.cc
base::win::WrappedWindowProc<> base/win/wrapped_window_proc.h
... user32!CallWindowProc / comctl32 subclass procs ...
ui::WindowSubclass::StaticSubClassWndProc ui/base/win/window_subclass.cc
... user32!DispatchClientMessage / ntdll!KiUserCallbackDispatcher ...
... uxtheme!OnDwpSysCommand / user32!DefWindowProcW ... // default SC_CLOSE handling
views::HWNDMessageHandler::OnSysCommand ui/views/win/hwnd_message_handler.cc // WM_SYSCOMMAND (SC_CLOSE)
views::HWNDMessageHandler::ProcessWindowMessage ui/views/win/hwnd_message_handler.h
views::HWNDMessageHandler::OnWndProc ui/views/win/hwnd_message_handler.cc
gfx::WindowImpl::WndProc ui/gfx/win/window_impl.cc
base::win::WrappedWindowProc<> base/win/wrapped_window_proc.h
... user32!CallWindowProc / comctl32 subclass / KiUserCallbackDispatcher ...
// ===== (3) Re-entrancy boundary: ShowWindow synchronously pumps native messages =====
win32u!ZwUserShowWindow // ::ShowWindow dispatches window messages
views::HWNDMessageHandler::Show ui/views/win/hwnd_message_handler.cc
views::DesktopWindowTreeHostWin::Show ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
views::Widget::Show ui/views/widget/widget.cc
BrowserView::Show chrome/browser/ui/views/frame/browser_view.cc
(anonymous namespace)::ScopedBrowserShower::~ScopedBrowserShower chrome/browser/ui/browser_navigator.cc
Navigate chrome/browser/ui/browser_navigator.cc
chrome::AddWebContents chrome/browser/ui/browser_tabstrip.cc
// ===== (2) Delegate shows/navigates the new window =====
Browser::AddNewContents chrome/browser/ui/browser.cc
// = content::WebContentsDelegate::AddNewContents
// ===== (1) opener is still on the CreateNewWindow stack frame =====
content::WebContentsImpl::CreateNewWindow content/browser/web_contents/web_contents_impl.cc
// call site: delegate_->AddNewContents(...);
// after it returns, runs load_params->initiator_origin = opener->GetLastCommittedOrigin();
// → opener / this already destroyed by (4) → heap-use-after-free
content::RenderFrameHostImpl::CreateNewWindow content/browser/renderer_host/render_frame_host_impl.cc
// reached from renderer's window.open(url, '_blank', 'noopener') via mojo
Note: exact frames between
OnSysCommandandOnWindowClosing(the widget teardown callbacks) may vary slightly by milestone.
Reachability
The crash was first observed downstream where the opener WebContents is
destroyed inside AddNewContents()'s nested ShowWindow message loop via
TabStripModel::CloseAllTabs. The same nested-loop-during-Show() race is
reachable in upstream Chromium via a noopener window.open() whose synchronous
window display coincides with the opener's browser window closing. It is
extremely timing-sensitive and rarely hit naturally, which is likely why it has
not been reported upstream.
Why the existing guard is insufficient
CreateNewWindow already captures weak_new_contents for the newly created
WebContents and even notes "The delegate may delete new_contents_impl during
AddNewContents()". However, nothing guards this. When the opener itself is
destroyed re-entrantly, the trailing code (opener->GetLastCommittedOrigin(),
opener->GetFrameToken(), delegate_, &new_contents_impl->GetPrimaryFrameTree())
runs on freed memory.
Proposed fix
Capture base::WeakPtr<WebContentsImpl> weak_this before AddNewContents() and
bail out (return nullptr) if it has been invalidated afterward, mirroring the
existing weak_new_contents guard.
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 guards the newly created contents with a weak pointer but not `this`, so a re-entrant destruction of the opener during `AddNewContents()` leaves the trailing code using a dangling pointer.
Impact
The freed opener is dereferenced, causing a use-after-free that could crash the browser; the text does not claim a proven exploit beyond the memory-safety bug, and it is noted as extremely timing-sensitive and rarely hit naturally.
What the attacker needed
Windows platform; Renderer can call window.open with noopener; Precise timing of window close
The fix
It should be fixed by capturing a weak pointer to `this` before `AddNewContents()` and returning early if it has been invalidated afterwards, mirroring the existing guard.
How it was found
- A renderer calls window.open with the noopener option, reaching CreateNewWindow.
- CreateNewWindow calls the delegate's AddNewContents to show the new window.
- On Windows, showing the window synchronously pumps native window messages.
- A close message for the opener's browser window is processed in that nested loop.
- The opener's tabs are closed, destroying the opener WebContents (this).
- After AddNewContents returns, the code dereferences the freed opener.
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 web page opens a new window, the browser runs code that creates it and then does a little more work with the original page's window. On Windows, displaying the new window can let the system deliver a 'close this window' message right away, which can destroy the original window while that code is still running. The code then touches memory that has already been freed, which can crash the browser and, in principle, be abused.
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.