Use after free in Navigation (CVE-2026-7956)
A logic ordering flaw in the browser's unload acknowledgement handler lets a compromised renderer send a spoofed unload message while the browser is only waiting for a beforeunload acknowledgement, causing a frame to be deleted prematurely. Observers free per-frame state while the frame stays in the frame tree, so later iteration over the tree can access freed memory, a use-after-free in the browser process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 41 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A logic flaw in RenderFrameHostImpl::OnUnloadACK allows a compromised renderer to spoof a DidUnloadRenderFrame IPC while the browser is waiting for a BeforeUnload ACK. This bypasses the unload acknowledgment check and prematurely calls RenderFrameDeleted() on an active frame. Observers free associated state while the frame remains in the tree, leading to a potential Use-After-Free (UAF) in the browser process.
Affected files:
content/browser/renderer_host/render_frame_host_impl.cccontent/browser/renderer_host/agent_scheduling_group_host.cccontent/browser/renderer_host/render_frame_host_manager.cc
Estimated timestamp from git blame: 2025-10-27
Summary
A static analysis of content/browser/renderer_host/render_frame_host_impl.cc reveals a potential vulnerability in RenderFrameHostImpl::OnUnloadACK. The function handles the acknowledgement of a frame unloading. However, the logic contains a critical ordering flaw: it checks if the frame is attaching an inner delegate (e.g., loading a PDF via MimeHandlerView) and immediately calls RenderFrameDeleted() before verifying if the browser is actually waiting for an Unload ACK.
A compromised renderer can exploit this by sending a spoofed DidUnloadRenderFrame IPC while the browser is only waiting for a BeforeUnload ACK. This triggers RenderFrameDeleted() prematurely, causing WebContentsObservers to free per-frame state. Because the BeforeUnload timeout is still running and the frame is not detached from the FrameTree, subsequent iterations over the frame tree (e.g., via ForEachRenderFrameHost) will yield this zombie frame, potentially causing observers to access freed state, leading to a Use-After-Free (UAF) in the highly privileged Browser process.
Technical Details
In RenderFrameHostImpl::OnUnloadACK, the code evaluates whether to delete the frame during inner delegate attachment:
void RenderFrameHostImpl::OnUnloadACK() {
// ...
RenderFrameHostOwner* owner =
IsPendingDeletion() ? GetFrameTreeNodeForUnload() : owner_;
if (!is_main_frame() &&
owner->GetRenderFrameHostManager().is_attaching_inner_delegate()) {
// This RFH was unloaded while attaching an inner delegate.
RenderFrameDeleted();
return;
}
// Ignore spurious unload ack.
if (!is_waiting_for_unload_ack_) {
return;
}
// ...
}
The is_attaching_inner_delegate() check occurs before the is_waiting_for_unload_ack_ check.
When a subframe navigates to a resource requiring an inner delegate (like a PDF), RenderFrameHostManager::PrepareForInnerDelegateAttach sets the state to PREPARE_FRAME (making is_attaching_inner_delegate() return true). If the subframe has a beforeunload handler, the browser dispatches a BeforeUnload IPC and starts a timeout. Crucially, during this phase, the browser is waiting for a BeforeUnload ACK, so is_waiting_for_unload_ack_ is false.
A compromised renderer can send a DidUnloadRenderFrame IPC for this subframe via AgentSchedulingGroupHost. The browser receives it, calls OnUnloadACK(), hits the is_attaching_inner_delegate() bypass, and prematurely executes RenderFrameDeleted().
Potential Exploitation Steps
(Note: These are suggested steps based on static analysis; a working Proof of Concept has not yet been developed.)
- Attacker Setup: A compromised renderer creates an
<iframe>and installs abeforeunloadevent handler on it. - Trigger Attachment: The renderer navigates the iframe to a PDF file, triggering
MimeHandlerViewcreation. - Browser State Change: The browser intercepts the request, the renderer loads the placeholder, and signals
ReadyToCreateMimeHandlerView. The browser callsPrepareForInnerDelegateAttach, settingattach_to_inner_delegate_state_toPREPARE_FRAME. - Dispatch BeforeUnload: Because of the
beforeunloadhandler, the browser dispatches aBeforeUnloadIPC to the renderer and starts a 1-second timeout timer. The browser'sis_waiting_for_unload_ack_state remainsfalse. - Spoof IPC: The compromised renderer intentionally ignores the
BeforeUnloadIPC. Instead, it sends a spoofedDidUnloadRenderFrameIPC for the iframe. - Premature Deletion: The browser receives the spoofed IPC and calls
RenderFrameHostImpl::OnUnloadACK. The logic flaw bypasses theis_waiting_for_unload_ack_check, directly executingRenderFrameDeleted(). - Observer State Freed:
RenderFrameDeleted()notifies allWebContentsObservers (e.g., Extensions, Autofill), which proceed to free memory and state mappings associated with thisRenderFrameHost*. - Use-After-Free: The frame remains in the
FrameTree(thebeforeunloadtimeout is still running). When a downstream browser component iterates the frame tree (e.g.,WebContentsImpl::ForEachRenderFrameHost), it yields this zombieRenderFrameHost*. Observers accessing their now-freed state mappings for this pointer will trigger a Use-After-Free (Sandbox Escape).
Suggested Fix
The is_waiting_for_unload_ack_ check should be moved up in RenderFrameHostImpl::OnUnloadACK so that spurious Unload ACKs are rejected before evaluating the inner delegate attachment state.
void RenderFrameHostImpl::OnUnloadACK() {
// ... (existing early returns)
// Ignore spurious unload ack MUST happen first.
if (!is_waiting_for_unload_ack_) {
return;
}
RenderFrameHostOwner* owner =
IsPendingDeletion() ? GetFrameTreeNodeForUnload() : owner_;
if (!is_main_frame() &&
owner->GetRenderFrameHostManager().is_attaching_inner_delegate()) {
RenderFrameDeleted();
return;
}
// ...
}
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
The check for whether the browser is actually waiting for an unload acknowledgement happens after the inner-delegate attachment branch that calls RenderFrameDeleted(), so a spurious acknowledgement is not rejected first.
Impact
A compromised renderer could cause a use-after-free in the privileged browser process, potentially leading to a sandbox escape, though the text notes no working proof of concept has been developed.
What the attacker needed
Compromised renderer; subframe with a beforeunload handler; navigation to a PDF or similar inner delegate
The fix
The waiting-for-unload-acknowledgement check should be moved before the inner delegate attachment branch so spurious acknowledgements are rejected first.
How it was found
- A compromised renderer creates an iframe and adds a beforeunload handler.
- The renderer navigates the iframe to a PDF, starting inner delegate attachment.
- The browser enters the prepare-frame state for the inner delegate.
- Because of the beforeunload handler, the browser sends a beforeunload message and starts a timeout, without waiting for an unload acknowledgement.
- The renderer ignores that message and sends a spoofed unload acknowledgement for the iframe.
- The browser runs the unload handler, skips the waiting check and deletes the frame early, freeing observer state while the frame stays in the tree.
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 web page runs in a sandboxed part of the browser called the renderer, which is not trusted. The browser keeps bookkeeping for each frame and expects certain messages in a certain order. Here the browser checked one condition before another, so a malicious renderer could send a message out of turn and make the browser throw away a frame's bookkeeping while the frame was still in use, which can crash or corrupt the browser.
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.