Use after free in FullScreen (CVE-2026-10908)
The ExitFullscreen() method in Chrome's browser process calls into a delegate that can spin a nested message loop on Windows, during which the RenderFrameHostImpl object can be destroyed, and the code then dereferences the freed object. An attacker could trigger a use-after-free in the unsandboxed browser process from any renderer via a Mojo IPC call, which the report states is exploitable.
Originally disclosed on Chrome VRP
- Fix shipped in 43 days
VULNERABILITY DETAILS
Use-after-free in RenderFrameHostImpl::ExitFullscreen() due to missing base::WeakPtr guard after delegate_->ExitFullscreenMode(). The delegate call can spin a nested message loop on Windows (via ::SetWindowPos), during which the RenderFrameHostImpl can be destroyed (e.g., via popup.close()). The code then dereferences freed this via GetOutermostMainFrame()->GetLocalRenderWidgetHost()->SynchronizeVisualProperties().
The identical sibling method EnterFullscreen() was explicitly fixed for this exact pattern in commit 91d5baaef742 (April 2, 2026), with the comment "This may spin the message loop and destroy this object." ExitFullscreen(), located 21 lines below in the same file, was missed.
At content/browser/renderer_host/render_frame_host_impl.cc:9323:
void RenderFrameHostImpl::ExitFullscreen() {
base::RecordAction(base::UserMetricsAction("ExitFullscreen_API"));
delegate_->ExitFullscreenMode(/*will_cause_resize=*/true);
// ^^^ Can spin a nested message loop on Windows (::SetWindowPos)
// During the loop, this RenderFrameHostImpl can be destroyed
// NO WEAKPTR CHECK — `this` may already be freed
GetOutermostMainFrame() // ← UAF HERE
->GetLocalRenderWidgetHost()
->SynchronizeVisualProperties();
}
Compare with the FIXED EnterFullscreen() at line 9300:
// This may spin the message loop and destroy this object.
// See crbug.com/1506535, crbug.com/498752242.
base::WeakPtr<RenderFrameHostImpl> weak_ptr = GetWeakPtr();
delegate_->EnterFullscreenMode(this, *options);
if (!weak_ptr) {
return;
}
Impact
This is a use-after-free in the browser process (unsandboxed). The ExitFullscreen() method is a Mojo IPC handler on blink::mojom::LocalFrameHost, directly callable from any renderer. The this pointer is the literal C++ this, NOT a raw_ptr<>.
MiraclePtr Status: NOT PROTECTED — confirmed in the ASAN trace. No raw_ptr<T> access to this region was detected. This crash is exploitable.
ASAN Trace
==22092==ERROR: AddressSanitizer: heap-use-after-free on address 0x1297e5f35100
READ of size 8 at 0x1297e5f35100 thread T0
#0 content::RenderFrameHostImpl::ExitFullscreen render_frame_host_impl.cc:9345
#1 blink::mojom::LocalFrameHostStubDispatch::Accept frame.mojom.cc:9502
#2 mojo::InterfaceEndpointClient::HandleValidatedMessage
...
freed by thread T0 here:
#0 operator delete
#1 content::RenderFrameHostImpl::~RenderFrameHostImpl render_frame_host_impl.cc:2844
#2 content::RenderFrameHostManager::~RenderFrameHostManager
#3 content::FrameTreeNode::~FrameTreeNode
#4 content::FrameTree::~FrameTree
#5 content::WebContentsImpl::~WebContentsImpl
...
#12 content::WebContentsImpl::Close
#13 content::RenderFrameHostImpl::ClosePageIgnoringUnloadEvents
#14 content::RenderFrameHostImpl::RequestClose
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.
The RFHI is freed via RequestClose (triggered by popup.close() from the opener) → WebContentsImpl::Close → ~WebContentsImpl → ~RenderFrameHostImpl. Then ExitFullscreen dereferences the freed this at GetOutermostMainFrame().
VERSION
Chrome Version: 149.0.7803.0 (built from source with ASAN) Operating System: Windows 11
Bug affects all Stable/Beta/Dev versions on Windows.
REPRODUCTION CASE
Attached: poc.html, rfhi_exit_fullscreen_runloop.patch
The race requires the RFHI to be destroyed during the ExitFullscreen call. To widen the race window for reliable reproduction, the attached patch adds a task-pumping base::RunLoop in RenderFrameHostImpl::ExitFullscreen() between the delegate call and the GetOutermostMainFrame() dereference, per VRP FAQ guidance ("Use Sleep() in privileged processes to simulate a race").
Steps to reproduce:
- Apply
rfhi_exit_fullscreen_runloop.patchtocontent/browser/renderer_host/render_frame_host_impl.cc - Build Chrome with ASAN:
gn gen out/asan --args='is_asan=true is_debug=false symbol_level=1'thenautoninja -C out/asan chrome - Run:
out\asan\chrome.exe --no-sandbox --user-data-dir=<temp_dir> poc.html - Click "1. Start" to open a popup window
- Click inside the blue popup to enter fullscreen
- Click "2. Race" in the original window
- ASAN detects heap-use-after-free in
RenderFrameHostImpl::ExitFullscreen
Relationship to fixed bugs
| Method | File:Line | WeakPtr Guard? | Fixed In |
|---|---|---|---|
EnterFullscreen() |
render_frame_host_impl.cc:9300 | YES | 91d5baaef742 (April 2, 2026) |
ExitFullscreen() |
render_frame_host_impl.cc:9323 | NO | UNFIXED |
WebContentsImpl::ExitFullscreenMode() |
web_contents_impl.cc:4839 | YES | 40947201 (2024) |
WebContentsImpl::DidNavigateAnyFramePreCommit() |
web_contents_impl.cc:7928 | YES | 8e95aab414bf (April 15, 2026) |
Navigator::DidNavigate() |
navigator.cc:528 | YES | 8e95aab414bf (April 15, 2026) |
SUGGESTED FIX
Add a base::WeakPtr guard in ExitFullscreen(), identical to EnterFullscreen():
void RenderFrameHostImpl::ExitFullscreen() {
base::RecordAction(base::UserMetricsAction("ExitFullscreen_API"));
+ base::WeakPtr<RenderFrameHostImpl> weak_ptr = GetWeakPtr();
delegate_->ExitFullscreenMode(/*will_cause_resize=*/true);
+ if (!weak_ptr) {
+ return;
+ }
GetOutermostMainFrame()
->GetLocalRenderWidgetHost()
->SynchronizeVisualProperties();
}
CREDIT INFORMATION
Reporter credit: Mihnea Nicolau
Context
Chrome's fullscreen API is exposed to renderers through Mojo. On the browser side, blink::mojom::LocalFrameHost carries the calls that a renderer makes when a page enters or leaves fullscreen, and RenderFrameHostImpl implements them. EnterFullscreen() and ExitFullscreen() sit next to each other in content/browser/renderer_host/render_frame_host_impl.cc and both hand control to a delegate that talks to the platform window manager.
The bug is a use-after-free in RenderFrameHostImpl::ExitFullscreen(). The delegate call can spin a nested message loop on Windows (through ::SetWindowPos), and during that loop the RenderFrameHostImpl can be destroyed. When control returns, the method dereferences the freed this through GetOutermostMainFrame()->GetLocalRenderWidgetHost()->SynchronizeVisualProperties().
Setup
The researcher built Chrome from source with AddressSanitizer on Windows 11:
gn gen out/asan --args='is_asan=true is_debug=false symbol_level=1'
autoninja -C out/asan chrome
The version under test was 149.0.7803.0. The report states that the bug affects all Stable, Beta and Dev versions on Windows. Two files were attached to the report: poc.html and rfhi_exit_fullscreen_runloop.patch.
Finding it
The sibling method EnterFullscreen() had already been fixed for exactly this pattern in commit 91d5baaef742 (April 2, 2026), with the comment "This may spin the message loop and destroy this object." ExitFullscreen() sits 21 lines below it in the same file and was missed.
The vulnerable code at content/browser/renderer_host/render_frame_host_impl.cc:9323:
void RenderFrameHostImpl::ExitFullscreen() {
base::RecordAction(base::UserMetricsAction("ExitFullscreen_API"));
delegate_->ExitFullscreenMode(/*will_cause_resize=*/true);
// ^^^ Can spin a nested message loop on Windows (::SetWindowPos)
// During the loop, this RenderFrameHostImpl can be destroyed
// NO WEAKPTR CHECK — `this` may already be freed
GetOutermostMainFrame() // ← UAF HERE
->GetLocalRenderWidgetHost()
->SynchronizeVisualProperties();
}
For comparison, the fixed EnterFullscreen() at line 9300:
// This may spin the message loop and destroy this object.
// See crbug.com/1506535, crbug.com/498752242.
base::WeakPtr<RenderFrameHostImpl> weak_ptr = GetWeakPtr();
delegate_->EnterFullscreenMode(this, *options);
if (!weak_ptr) {
return;
}
The difference is the base::WeakPtr guard taken before the delegate call and checked after it. ExitFullscreen() has no such check, so the dereference after the delegate call can land on freed memory.
Exploitation
The race requires the RenderFrameHostImpl to be destroyed during the ExitFullscreen call. To widen the race window for reliable reproduction, the attached patch adds a task-pumping base::RunLoop in RenderFrameHostImpl::ExitFullscreen() between the delegate call and the GetOutermostMainFrame() dereference. The report cites VRP FAQ guidance for this: "Use Sleep() in privileged processes to simulate a race".
Step 1: Apply the patch
Apply rfhi_exit_fullscreen_runloop.patch to content/browser/renderer_host/render_frame_host_impl.cc.
Step 2: Build with ASAN
gn gen out/asan --args='is_asan=true is_debug=false symbol_level=1'
autoninja -C out/asan chrome
Step 3: Run the PoC
out\asan\chrome.exe --no-sandbox --user-data-dir=<temp_dir> poc.html
Step 4: Open the popup
Click "1. Start" to open a popup window.
Step 5: Enter fullscreen
Click inside the blue popup to enter fullscreen.
Step 6: Trigger the race
Click "2. Race" in the original window. This calls popup.close() from the opener, which drives RequestClose and can tear down the popup's WebContentsImpl while the nested loop inside ExitFullscreen() is still running.
Step 7: Observe the crash
ASAN detects heap-use-after-free in RenderFrameHostImpl::ExitFullscreen.
The ASAN trace:
==22092==ERROR: AddressSanitizer: heap-use-after-free on address 0x1297e5f35100
READ of size 8 at 0x1297e5f35100 thread T0
#0 content::RenderFrameHostImpl::ExitFullscreen render_frame_host_impl.cc:9345
#1 blink::mojom::LocalFrameHostStubDispatch::Accept frame.mojom.cc:9502
#2 mojo::InterfaceEndpointClient::HandleValidatedMessage
...
freed by thread T0 here:
#0 operator delete
#1 content::RenderFrameHostImpl::~RenderFrameHostImpl render_frame_host_impl.cc:2844
#2 content::RenderFrameHostManager::~RenderFrameHostManager
#3 content::FrameTreeNode::~FrameTreeNode
#4 content::FrameTree::~FrameTree
#5 content::WebContentsImpl::~WebContentsImpl
...
#12 content::WebContentsImpl::Close
#13 content::RenderFrameHostImpl::ClosePageIgnoringUnloadEvents
#14 content::RenderFrameHostImpl::RequestClose
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.
The free path runs from RequestClose (triggered by popup.close() from the opener) through WebContentsImpl::Close, ~WebContentsImpl, ~FrameTree, ~FrameTreeNode, ~RenderFrameHostManager and finally ~RenderFrameHostImpl. The use stack shows the read happening inside ExitFullscreen at line 9345, reached through the Mojo stub dispatch for LocalFrameHost.
Root cause
ExitFullscreen() calls delegate_->ExitFullscreenMode(/*will_cause_resize=*/true) and then uses this without revalidating it. On Windows the delegate call can spin a nested message loop via ::SetWindowPos, and any task that runs during that loop can destroy the RenderFrameHostImpl. The subsequent GetOutermostMainFrame() dereference then reads freed memory.
The existing defence for this pattern is the base::WeakPtr guard used in EnterFullscreen(), which was added in commit 91d5baaef742. ExitFullscreen() was not given the same treatment.
MiraclePtr does not help here. The report notes that this is the literal C++ this, not a raw_ptr<>, and that the ASAN trace confirms no raw_ptr<T> access to the region was detected. The report states plainly that the crash is exploitable.
The report also places the bug alongside other methods that already carry the guard:
| Method | File:Line | WeakPtr Guard? | Fixed In |
|---|---|---|---|
EnterFullscreen() |
render_frame_host_impl.cc:9300 | YES | 91d5baaef742 (April 2, 2026) |
ExitFullscreen() |
render_frame_host_impl.cc:9323 | NO | UNFIXED |
WebContentsImpl::ExitFullscreenMode() |
web_contents_impl.cc:4839 | YES | 40947201 (2024) |
WebContentsImpl::DidNavigateAnyFramePreCommit() |
web_contents_impl.cc:7928 | YES | 8e95aab414bf (April 15, 2026) |
Navigator::DidNavigate() |
navigator.cc:528 | YES | 8e95aab414bf (April 15, 2026) |
Impact
The use-after-free is in the browser process, which is unsandboxed. ExitFullscreen() is a Mojo IPC handler on blink::mojom::LocalFrameHost and is directly callable from any renderer. The handler is directly callable from any renderer, so the vulnerable path is reachable from renderer code.
Fix
The suggested fix adds a base::WeakPtr guard in ExitFullscreen(), identical to the one in EnterFullscreen():
void RenderFrameHostImpl::ExitFullscreen() {
base::RecordAction(base::UserMetricsAction("ExitFullscreen_API"));
+ base::WeakPtr<RenderFrameHostImpl> weak_ptr = GetWeakPtr();
delegate_->ExitFullscreenMode(/*will_cause_resize=*/true);
+ if (!weak_ptr) {
+ return;
+ }
GetOutermostMainFrame()
->GetLocalRenderWidgetHost()
->SynchronizeVisualProperties();
}
With the guard, a RenderFrameHostImpl destroyed during the nested loop leaves the weak pointer invalid, and the method returns before touching this again.
Variants to test
- Other delegate calls that can spin a nested loop. Look for browser-process methods that call into the platform window manager (for example anything that ends up in
::SetWindowPoson Windows) and then usethisafterwards. A positive result is an ASAN heap-use-after-free where the free stack passes through aWebContentsImplorRenderFrameHostImpldestructor and the use stack is the same method that made the delegate call. - Sibling IPC handlers on
LocalFrameHostand other Mojo interfaces. Enumerate handlers that take abase::WeakPtrin one method but not in a neighbouring one. A positive result is a method pair with the same shape where only one side has the guard, and a PoC that closes the frame from another context while the unguarded method is mid-call. - Close-during-callback patterns. Any handler where a renderer can cause the browser to close or destroy the frame (for example
popup.close()from an opener, as here) while another handler is executing. A positive result is a crash whose free stack containsRequestCloseorClosePageIgnoringUnloadEvents. - MiraclePtr coverage gaps. Methods that use the literal C++
thisrather than araw_ptr<>will not be caught by MiraclePtr. A positive result is an ASAN report that explicitly states noraw_ptr<T>access was detected, as in this trace. - Platform-specific loop spinning. The nested loop here is Windows-specific. Test the same handlers on other platforms to see whether a different delegate call can produce an equivalent reentrancy, and confirm with a build that has the same run-loop patch applied.
What happened, in plain words
Chrome is a web browser. Like most modern browsers, it splits its work into two kinds of processes: a renderer process, which runs the web page's code (HTML, JavaScript and so on), and a browser process, which controls the window, the tabs, the menus and the operating system. The renderer is deliberately kept in a sandbox, a restricted box that limits what it can touch. The browser process is not sandboxed, because it needs to talk to the operating system directly.
Because the two processes live in separate boxes, they need a way to send messages to each other. Chrome uses a system called Mojo for this. Mojo is an IPC (inter-process communication) mechanism: one process sends a structured message, and the other process runs a matching piece of code, called a handler, to deal with it. You can think of it like a restaurant: the renderer is the customer placing an order, and the browser process is the kitchen that prepares it. The menu of orders the renderer is allowed to place is defined by interfaces, and one of those interfaces is called blink::mojom::LocalFrameHost.
One of the things a page can ask for is fullscreen: the page tells the browser "please make my window fill the whole screen", and later "please leave fullscreen". On the browser side, the C++ class RenderFrameHostImpl is the object that represents one frame of a page and implements those requests. It has two neighbouring methods, EnterFullscreen() and ExitFullscreen(), which sit next to each other in the file content/browser/renderer_host/render_frame_host_impl.cc. Both of them hand the real work to a delegate, a helper object that talks to the operating system's window manager.
The bug is a use-after-free. In C++, when you create an object it lives in a region of memory, and when it is no longer needed the program frees that memory so it can be reused. If some code keeps a pointer to the object and then reads or writes through that pointer after the memory has been freed, that is a use-after-free. The everyday comparison is a hotel room: you check out, the hotel gives the room to a new guest, and you still have the old key card. If you walk back in, you are not in your room any more, you are in someone else's.
Here the object is a RenderFrameHostImpl. The method ExitFullscreen() calls the delegate, and on Windows that call can spin a nested message loop. A message loop is the browser's main "do the next task on the list" cycle. Normally tasks are handled one after another. A nested loop means that while one task is still running, the browser starts processing other tasks inside it, like a shop assistant who, halfway through serving you, starts serving the next customer and only comes back to you later. During that inner loop, the RenderFrameHostImpl can be destroyed, for example because the page that opened the popup calls popup.close(). When control finally returns to ExitFullscreen(), the method carries on and reads through its this pointer, which now points at freed memory. That is the use-after-free.
Context
Chrome's fullscreen API is exposed to renderers through Mojo. On the browser side, blink::mojom::LocalFrameHost carries the calls that a renderer makes when a page enters or leaves fullscreen, and RenderFrameHostImpl implements them. EnterFullscreen() and ExitFullscreen() sit next to each other in content/browser/renderer_host/render_frame_host_impl.cc and both hand control to a delegate that talks to the platform window manager.
The bug is a use-after-free in RenderFrameHostImpl::ExitFullscreen(). The delegate call can spin a nested message loop on Windows (through ::SetWindowPos), and during that loop the RenderFrameHostImpl can be destroyed. When control returns, the method dereferences the freed this through GetOutermostMainFrame()->GetLocalRenderWidgetHost()->SynchronizeVisualProperties().
A few words on the pieces in that paragraph. ::SetWindowPos is a Windows operating-system function that moves or resizes a window; calling it can cause the system to deliver further messages, which is how the nested loop gets started. GetOutermostMainFrame() is a method that walks up to the top-level frame of the page, GetLocalRenderWidgetHost() gets the object that owns the drawing surface for that frame, and SynchronizeVisualProperties() tells it to refresh its visual settings. Each of those calls goes through this, so each of them touches the object that may already be gone.
Setup
The researcher built Chrome from source with AddressSanitizer on Windows 11. AddressSanitizer, usually shortened to ASAN, is a tool that the compiler can add to a program. It watches memory as the program runs and, when the program reads or writes memory that has been freed, it stops and prints a detailed report. It is like a smoke alarm for memory mistakes: it does not prevent the fire, but it tells you exactly where it started.
gn gen out/asan --args='is_asan=true is_debug=false symbol_level=1'
autoninja -C out/asan chrome
Line by line:
gn gen out/asan --args='is_asan=true is_debug=false symbol_level=1'asksgn, Chrome's build-file generator, to prepare a build in a folder calledout/asan. The--argspart passes settings:is_asan=trueturns AddressSanitizer on,is_debug=falsebuilds an optimised (release-style) binary rather than a slow debug one, andsymbol_level=1keeps enough debugging information for the ASAN report to show function names and line numbers.autoninja -C out/asan chromeruns the actual build withautoninja, a wrapper around the Ninja build tool, inside theout/asanfolder, and the target ischrome, the browser itself.
The version under test was 149.0.7803.0. The report states that the bug affects all Stable, Beta and Dev versions on Windows. Two files were attached to the report: poc.html and rfhi_exit_fullscreen_runloop.patch. A PoC, or proof of concept, is a small file that demonstrates the bug; a patch is a text file describing changes to source code, which a tool can apply automatically.
Finding it
The sibling method EnterFullscreen() had already been fixed for exactly this pattern in commit 91d5baaef742 (April 2, 2026), with the comment "This may spin the message loop and destroy this object." A commit is a saved change in a source-code history, identified by a long hexadecimal string. ExitFullscreen() sits 21 lines below it in the same file and was missed.
The vulnerable code at content/browser/renderer_host/render_frame_host_impl.cc:9323:
void RenderFrameHostImpl::ExitFullscreen() {
base::RecordAction(base::UserMetricsAction("ExitFullscreen_API"));
delegate_->ExitFullscreenMode(/*will_cause_resize=*/true);
// ^^^ Can spin a nested message loop on Windows (::SetWindowPos)
// During the loop, this RenderFrameHostImpl can be destroyed
// NO WEAKPTR CHECK — `this` may already be freed
GetOutermostMainFrame() // ← UAF HERE
->GetLocalRenderWidgetHost()
->SynchronizeVisualProperties();
}
Line by line:
void RenderFrameHostImpl::ExitFullscreen() {starts the definition of the methodExitFullscreenthat belongs to the classRenderFrameHostImpl.voidmeans it returns nothing.base::RecordAction(base::UserMetricsAction("ExitFullscreen_API"));records a usage statistic, so Chrome's own metrics know that the fullscreen exit API was used. This line is harmless.delegate_->ExitFullscreenMode(/*will_cause_resize=*/true);hands the real work to the delegate object. The/*will_cause_resize=*/trueis a comment placed next to the argument to explain thattruemeans the window will be resized. This is the call that, on Windows, can start the nested message loop.- The two
//lines are comments written by the researcher, explaining that the call above can spin a nested loop and that the object can be destroyed during it. // NO WEAKPTR CHECK —thismay already be freedis another comment: there is no safety check here, andthismay already point at freed memory.thisis the C++ keyword for "the current object".GetOutermostMainFrame()is the first use ofthisafter the delegate call. The comment// ← UAF HEREmarks it as the place where the use-after-free happens.->GetLocalRenderWidgetHost()and->SynchronizeVisualProperties();continue the chain on the result of the previous call, and the closing}ends the method.
For comparison, the fixed EnterFullscreen() at line 9300:
// This may spin the message loop and destroy this object.
// See crbug.com/1506535, crbug.com/498752242.
base::WeakPtr<RenderFrameHostImpl> weak_ptr = GetWeakPtr();
delegate_->EnterFullscreenMode(this, *options);
if (!weak_ptr) {
return;
}
Line by line:
- The two comment lines explain the danger and point at two earlier bug reports,
crbug.com/1506535andcrbug.com/498752242. base::WeakPtr<RenderFrameHostImpl> weak_ptr = GetWeakPtr();creates a weak pointer. A normal pointer says "this object is here"; a weak pointer says "this object was here, but check with me before using it, because it may be gone". It is like a note saying "ask the front desk whether the guest is still checked in" rather than a key card.delegate_->EnterFullscreenMode(this, *options);makes the delegate call, the same risky step as inExitFullscreen().if (!weak_ptr) { return; }checks the weak pointer after the call. If the object was destroyed during the call, the weak pointer is now empty, and the method returns immediately instead of touchingthis.
The difference is the base::WeakPtr guard taken before the delegate call and checked after it. ExitFullscreen() has no such check, so the dereference after the delegate call can land on freed memory.
Exploitation
The race requires the RenderFrameHostImpl to be destroyed during the ExitFullscreen call. A race condition is a bug that only appears when two things happen in a particular order or at the same moment; it is like two people reaching for the same door handle at once. To widen the race window for reliable reproduction, the attached patch adds a task-pumping base::RunLoop in RenderFrameHostImpl::ExitFullscreen() between the delegate call and the GetOutermostMainFrame() dereference. A base::RunLoop is a small helper that runs the message loop until told to stop, so inserting one gives other tasks a chance to run at exactly the wrong moment. The report cites VRP FAQ guidance for this: "Use Sleep() in privileged processes to simulate a race". VRP stands for Vulnerability Reward Program, the scheme through which Chrome pays researchers for finding and reporting bugs.
Step 1: Apply the patch
Apply rfhi_exit_fullscreen_runloop.patch to content/browser/renderer_host/render_frame_host_impl.cc.
This step is needed because the race requires the object to be destroyed during the call; the patch widens that window for reliable reproduction. The patch widens that window artificially so the crash can be reproduced on demand.
Step 2: Build with ASAN
gn gen out/asan --args='is_asan=true is_debug=false symbol_level=1'
autoninja -C out/asan chrome
This is the same pair of commands as in the setup section: prepare an ASAN build in out/asan, then compile the chrome target. The build is repeated here because the patch from step 1 has to be compiled into the browser before it can be tested.
Step 3: Run the PoC
out\asan\chrome.exe --no-sandbox --user-data-dir=<temp_dir> poc.html
Line by line:
out\asan\chrome.exeis the browser binary that was just built. The backslashes are Windows path separators.--no-sandboxturns off Chrome's sandbox for this test run.--user-data-dir=<temp_dir>tells Chrome to keep its profile data in a temporary folder, so the test does not touch the normal profile.<temp_dir>is a placeholder for a folder path.poc.htmlis the proof-of-concept page to open at startup.
Step 4: Open the popup
Click "1. Start" to open a popup window.
The popup matters because it gives two windows: the original page, which acts as the opener, and the popup. The opener is allowed to call close() on a window it opened, which is the lever used later to destroy the popup's frame.
Step 5: Enter fullscreen
Click inside the blue popup to enter fullscreen.
This puts the popup into the fullscreen state, so that the later exit goes through ExitFullscreen() and the vulnerable code path.
Step 6: Trigger the race
Click "2. Race" in the original window. This calls popup.close() from the opener, which drives RequestClose and can tear down the popup's WebContentsImpl while the nested loop inside ExitFullscreen() is still running.
WebContentsImpl is the browser-side object that represents the contents of one tab or popup window. Destroying it destroys everything inside, including the RenderFrameHostImpl. Because the nested loop is still running at that moment, the destruction happens while ExitFullscreen() is paused mid-call, which is exactly the window the bug needs.
Step 7: Observe the crash
ASAN detects heap-use-after-free in RenderFrameHostImpl::ExitFullscreen.
The ASAN trace:
==22092==ERROR: AddressSanitizer: heap-use-after-free on address 0x1297e5f35100
READ of size 8 at 0x1297e5f35100 thread T0
#0 content::RenderFrameHostImpl::ExitFullscreen render_frame_host_impl.cc:9345
#1 blink::mojom::LocalFrameHostStubDispatch::Accept frame.mojom.cc:9502
#2 mojo::InterfaceEndpointClient::HandleValidatedMessage
...
freed by thread T0 here:
#0 operator delete
#1 content::RenderFrameHostImpl::~RenderFrameHostImpl render_frame_host_impl.cc:2844
#2 content::RenderFrameHostManager::~RenderFrameHostManager
#3 content::FrameTreeNode::~FrameTreeNode
#4 content::FrameTree::~FrameTree
#5 content::WebContentsImpl::~WebContentsImpl
...
#12 content::WebContentsImpl::Close
#13 content::RenderFrameHostImpl::ClosePageIgnoringUnloadEvents
#14 content::RenderFrameHostImpl::RequestClose
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.
Line by line:
==22092==ERROR: AddressSanitizer: heap-use-after-free on address 0x1297e5f35100is ASAN's headline: it found a use-after-free at that memory address. The number in==22092==is the process identifier.READ of size 8 at 0x1297e5f35100 thread T0says the program tried to read 8 bytes from that address, on threadT0. Eight bytes is the size of a pointer on a 64-bit system.- The
#0to#2lines are the stack trace of the use: the list of function calls that led to the bad read, most recent first.#0iscontent::RenderFrameHostImpl::ExitFullscreenatrender_frame_host_impl.cc:9345, the exact line.#1isblink::mojom::LocalFrameHostStubDispatch::Accept, the Mojo code that receives the message and calls the handler.#2ismojo::InterfaceEndpointClient::HandleValidatedMessage, the lower-level Mojo plumbing. The...means the trace continues but was cut for brevity. freed by thread T0 here:starts the second half of the report: where the memory was freed.#0 operator deleteis the C++ memory-freeing operation.#1 content::RenderFrameHostImpl::~RenderFrameHostImpl render_frame_host_impl.cc:2844is the destructor of the object, the code that runs when it is destroyed. In C++, a name starting with~is a destructor.#2to#5show the destruction cascading upwards:~RenderFrameHostManager,~FrameTreeNode,~FrameTree,~WebContentsImpl. Each object owns the next, so destroying the outer one destroys the inner ones.#12 content::WebContentsImpl::Close,#13 content::RenderFrameHostImpl::ClosePageIgnoringUnloadEventsand#14 content::RenderFrameHostImpl::RequestCloseshow the request that started the whole teardown.RequestCloseis what the opener'spopup.close()eventually reaches.MiraclePtr Status: NOT PROTECTEDis ASAN's note about MiraclePtr, a Chrome defence that makes freed objects harder to reuse. Here it did not apply.No raw_ptr<T> access to this region was detected prior to this crash.explains why: the code used a plain C++ pointer, not the specialraw_ptr<T>type that MiraclePtr watches.This crash is still exploitable with MiraclePtr.is the conclusion: even with that defence enabled, this crash can still be turned into an attack.
The free path runs from RequestClose (triggered by popup.close() from the opener) through WebContentsImpl::Close, ~WebContentsImpl, ~FrameTree, ~FrameTreeNode, ~RenderFrameHostManager and finally ~RenderFrameHostImpl. The use stack shows the read happening inside ExitFullscreen at line 9345, reached through the Mojo stub dispatch for LocalFrameHost.
Root cause
ExitFullscreen() calls delegate_->ExitFullscreenMode(/*will_cause_resize=*/true) and then uses this without revalidating it. On Windows the delegate call can spin a nested message loop via ::SetWindowPos, and any task that runs during that loop can destroy the RenderFrameHostImpl. The subsequent GetOutermostMainFrame() dereference then reads freed memory.
The existing defence for this pattern is the base::WeakPtr guard used in EnterFullscreen(), which was added in commit 91d5baaef742. ExitFullscreen() was not given the same treatment.
MiraclePtr does not help here. The report notes that this is the literal C++ this, not a raw_ptr<>, and that the ASAN trace confirms no raw_ptr<T> access to the region was detected. The report states plainly that the crash is exploitable.
The report also places the bug alongside other methods that already carry the guard:
| Method | File:Line | WeakPtr Guard? | Fixed In |
|---|---|---|---|
EnterFullscreen() |
render_frame_host_impl.cc:9300 | YES | 91d5baaef742 (April 2, 2026) |
ExitFullscreen() |
render_frame_host_impl.cc:9323 | NO | UNFIXED |
WebContentsImpl::ExitFullscreenMode() |
web_contents_impl.cc:4839 | YES | 40947201 (2024) |
WebContentsImpl::DidNavigateAnyFramePreCommit() |
web_contents_impl.cc:7928 | YES | 8e95aab414bf (April 15, 2026) |
Navigator::DidNavigate() |
navigator.cc:528 | YES | 8e95aab414bf (April 15, 2026) |
The table lists five methods. The first column is the method name, the second is the file and line where it lives, the third says whether it has the weak-pointer safety check, and the fourth says which commit fixed it, or that it is unfixed. Four of the five already have the guard; ExitFullscreen() is the odd one out.
Impact
The use-after-free is in the browser process, which is unsandboxed. ExitFullscreen() is a Mojo IPC handler on blink::mojom::LocalFrameHost and is directly callable from any renderer. The handler is directly callable from any renderer, so the vulnerable path is reachable from renderer code.
That last point is what makes the bug serious. Normally a bug inside a renderer is contained by the sandbox, so an attacker needs a second bug to break out. Here the bug is already on the unsandboxed side, so a renderer that has been taken over can reach it directly.
Fix
The suggested fix adds a base::WeakPtr guard in ExitFullscreen(), identical to the one in EnterFullscreen():
void RenderFrameHostImpl::ExitFullscreen() {
base::RecordAction(base::UserMetricsAction("ExitFullscreen_API"));
+ base::WeakPtr<RenderFrameHostImpl> weak_ptr = GetWeakPtr();
delegate_->ExitFullscreenMode(/*will_cause_resize=*/true);
+ if (!weak_ptr) {
+ return;
+ }
GetOutermostMainFrame()
->GetLocalRenderWidgetHost()
->SynchronizeVisualProperties();
}
Line by line:
void RenderFrameHostImpl::ExitFullscreen() {and thebase::RecordAction(...)line are unchanged from the vulnerable version.+ base::WeakPtr<RenderFrameHostImpl> weak_ptr = GetWeakPtr();is a new line, marked with+to show it is added. It takes a weak pointer to the current object before the risky call.delegate_->ExitFullscreenMode(/*will_cause_resize=*/true);is the same delegate call as before.+ if (!weak_ptr) {and+ return;and+ }are new lines that check the weak pointer after the call. If the object was destroyed during the nested loop, the weak pointer is empty and the method returns.GetOutermostMainFrame()and the two chained calls are unchanged, but now they are only reached when the object is still alive.
With the guard, a RenderFrameHostImpl destroyed during the nested loop leaves the weak pointer invalid, and the method returns before touching this again.
Variants to test
- Other delegate calls that can spin a nested loop. Look for browser-process methods that call into the platform window manager (for example anything that ends up in
::SetWindowPoson Windows) and then usethisafterwards. A positive result is an ASAN heap-use-after-free where the free stack passes through aWebContentsImplorRenderFrameHostImpldestructor and the use stack is the same method that made the delegate call. - Sibling IPC handlers on
LocalFrameHostand other Mojo interfaces. Enumerate handlers that take abase::WeakPtrin one method but not in a neighbouring one. A positive result is a method pair with the same shape where only one side has the guard, and a PoC that closes the frame from another context while the unguarded method is mid-call. - Close-during-callback patterns. Any handler where a renderer can cause the browser to close or destroy the frame (for example
popup.close()from an opener, as here) while another handler is executing. A positive result is a crash whose free stack containsRequestCloseorClosePageIgnoringUnloadEvents. - MiraclePtr coverage gaps. Methods that use the literal C++
thisrather than araw_ptr<>will not be caught by MiraclePtr. A positive result is an ASAN report that explicitly states noraw_ptr<T>access was detected, as in this trace. - Platform-specific loop spinning. The nested loop here is Windows-specific. Test the same handlers on other platforms to see whether a different delegate call can produce an equivalent reentrancy, and confirm with a build that has the same run-loop patch applied.
Glossary
- AddressSanitizer (ASAN): a compiler-added tool that watches memory at runtime and reports reads or writes to freed memory, with a detailed trace.
- API: an agreed set of requests one piece of software can make to another; here, the calls a page can make to the browser.
- base::RunLoop: a Chrome helper that runs the message loop until told to stop, used in the patch to widen the race window.
- base::WeakPtr: a pointer that does not keep an object alive and can be checked to see whether the object still exists.
- Browser process: the unsandboxed Chrome process that controls windows, tabs and the operating system.
- Commit: a saved change in a source-code history, identified by a hexadecimal string.
- Delegate: a helper object that a class hands work to, here the object that talks to the platform window manager.
- Destructor: the C++ code that runs when an object is destroyed, written with a leading
~. - Dereference: to read or write through a pointer, that is, to use the object it points at.
- Fullscreen: the browser state in which a page's window fills the whole screen.
- Handler: the piece of code that runs when a particular message arrives.
- Heap-use-after-free: an ASAN report of a read or write to memory that was freed earlier.
- IPC: inter-process communication, the mechanism two processes use to send messages to each other.
- Message loop: the browser's cycle of taking the next task from a queue and running it.
- MiraclePtr: a Chrome defence that makes freed objects harder to reuse, effective only for accesses through
raw_ptr<T>. - Mojo: Chrome's IPC system, which carries structured messages between processes.
- Nested message loop: a message loop started while another task is still running, so other tasks run inside it.
- Opener: the window that opened another window, and which is allowed to close it.
- Patch: a text file describing changes to source code, which a tool can apply automatically.
- PoC (proof of concept): a small file that demonstrates a bug.
- Race condition: a bug that appears only when two things happen in a particular order or at the same moment.
- raw_ptr<T>: a Chrome pointer type that MiraclePtr watches.
- Renderer process: the sandboxed Chrome process that runs a web page's code.
- Sandbox: a restricted box that limits what a process can touch.
- Stack trace: the list of function calls that led to a particular point, most recent first.
- this: the C++ keyword for the current object inside a method.
- Use-after-free: a bug where code reads or writes memory through a pointer after the object there has been freed.
- VRP: Vulnerability Reward Program, the scheme through which Chrome pays researchers for reported bugs.
- WebContentsImpl: the browser-side object that represents the contents of one tab or popup window.