Use after free in Navigation (CVE-2026-5289)
A compromised renderer can create a parent and child frame with the same unique_name, causing a breadth-first search to return the parent's history node when the child's is intended. This leads to premature freeing of the parent node and a use-after-free, potentially allowing arbitrary memory write and sandbox escape.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 7 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A compromised renderer can supply duplicate unique_names for a parent and child frame, bypassing production DCHECK validations. During a frame replacement navigation, a BFS lookup erroneously matches the parent instead of the child, causing the parent's history node to be prematurely freed. The browser then dereferences a dangling raw pointer to the freed parent node, resulting in a highly exploitable Use-After-Free.
Affected files:
content/browser/renderer_host/render_frame_host_impl.cccontent/browser/renderer_host/navigation_entry_impl.cc
Estimated timestamp from git blame: 2025-11-19
Description
There is a potential Use-After-Free (UAF) vulnerability in the Browser process within content::NavigationEntryImpl. The root cause stems from insufficient browser-side validation of a frame's unique_name. RenderFrameHostImpl relies on a DCHECK to ensure unique_name is not empty, but it never validates that the name is globally unique within the frame tree.
Because of this, a compromised renderer can create a frame tree where a parent frame and its child frame share the exact same unique_name. This breaks the assumption of NavigationEntryImpl::GetTreeNode, which relies on Breadth-First Search (BFS) and unique_name matching to locate a specific frame's TreeNode in the session history tree.
When a navigation with UpdatePolicy::kReplace commits in the child frame, the browser attempts to remove the child's old history entry. However, because BFS visits the parent first and both frames share the same name, the search returns the parent's TreeNode. The browser subsequently deletes the parent node. Crucially, the calling function (AddOrUpdateFrameEntry) still holds a raw stack pointer to this parent node and subsequently uses it, triggering a Use-After-Free.
Note: The following exploitation steps are potential and based on static analysis, as our setup does not currently run active proof-of-concept exploits.
Potential Steps to Trigger
- Compromise a Renderer: An attacker gains arbitrary code execution in a renderer process.
- Create Duplicate Names: The renderer sends IPC messages to create a subframe (Frame A) with
unique_name= "duplicate_name". It then creates a child of Frame A (Frame B) also withunique_name= "duplicate_name". - Populate History: The attacker triggers normal navigations in both frames so that
NavigationEntryImplcreates aTreeNodefor both A and B. - Trigger Replacement: The attacker triggers a navigation in Frame B (the child) using
location.replace(), generating a commit IPC withUpdatePolicy::kReplaceand a craftednavigation_api_keystring payload.
Code Walkthrough
When the replacement navigation for Frame B commits, NavigationEntryImpl::AddOrUpdateFrameEntry is called (content/browser/renderer_host/navigation_entry_impl.cc:1106).
- Fetch Parent Node: At line 1173,
GetTreeNode(Frame B's parent)correctly returns Frame A'sTreeNode. This is stored inNavigationEntryImpl::TreeNode* parent_node, a raw pointer. - Initiate Removal: At line 1182, it loops through
parent_node->childrenand finds the entry for Frame B. Becauseupdate_policy == UpdatePolicy::kReplace, it callsRemoveEntryForFrame(frame_tree_node, false)(line 1186). - The BFS Flaw: Inside
RemoveEntryForFrame,GetTreeNode(Frame B)is called.GetTreeNodeuses BFS. Since Frame A (parent) is higher in the tree than Frame B (child), BFS evaluates Frame A first. Because the attacker explicitly set Frame A and Frame B to have the sameunique_name,TreeNode::MatchesFrameerroneously returnstruefor Frame A. - Erroneous Deletion:
GetTreeNodereturns Frame A'sTreeNodeinstead of Frame B's.RemoveEntryForFrameproceeds to delete Frame A'sTreeNodefrom the root tree (line 1314). Frame A's memory is freed. - Use-After-Free: Control returns to
AddOrUpdateFrameEntry. Theparent_nodestack variable is now dangling. At line 1211, a newFrameNavigationEntryis instantiated. This constructor copies the attacker-controllednavigation_api_keystring, allocating heap memory. The attacker can carefully size this string to reclaim the exact memory chunk just freed by Frame A'sTreeNode, forging the internalstd::vectormembers (begin,end,capacity). - Arbitrary Write: At line 1217, the code executes
parent_node->children.push_back(...). This operates on the attacker's forgedstd::vectorinside the reclaimed memory chunk, providing a highly reliable arbitrary memory write primitive in the Browser process.
Impact
This provides a deterministic arbitrary memory write in the Browser process. An attacker can overwrite a function pointer (e.g., a vtable entry) to hijack control flow, leading to a full Sandbox Escape and Remote Code Execution (RCE).
Suggested Fix
- Strict Name Validation: Enforce strict browser-side validation in
RenderFrameHostImpl::CreateChildFrameto ensure thatframe_unique_nameis globally unique across the entireFrameTreebefore accepting the IPC. If a duplicate is detected, terminate the renderer process viabad_message::ReceivedBadMessage. - Safe Pointers: Convert the raw
NavigationEntryImpl::TreeNode* parent_nodepointer inAddOrUpdateFrameEntry(and similar navigation classes) to a safe reference (e.g., relying on robust identifiers rather than raw tree node pointers, or employingbase::SafeRef/ checking tree validity) so that destruction invalidates the usage. - Robust Node Lookup: Update
RemoveEntryForFrameto unconditionally verify the tree position of the returned node (removing the!only_if_different_positionshort-circuit) to ensure the deleted node actually corresponds to the correctFrameTreeNodetopology.
Evaluated with Chrome root at commit: 9760e6c70cd33a320713361f17c6dcca85648c0f
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
Likely the browser does not validate that a frame's unique_name is globally unique within the frame tree, so a compromised renderer can create duplicate names that break the assumption of the BFS lookup.
Impact
This provides a deterministic arbitrary memory write in the Browser process, which could lead to a full sandbox escape and remote code execution.
What the attacker needed
Compromised renderer
The fix
The browser should enforce strict validation that frame_unique_name is globally unique across the entire FrameTree before accepting the IPC, and use safe pointers or robust node lookup to prevent use-after-free.
How it was found
- Compromise a renderer to gain arbitrary code execution.
- Create a subframe and its child with the same unique_name.
- Trigger normal navigations in both frames to populate history.
- Trigger a replacement navigation in the child frame using location.replace().
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 renderer is the part of the browser that runs web pages; if an attacker can run their own code there, they can send crafted messages to the browser process. The browser process keeps a tree of frames (like a family tree of page sections) and uses a name to find each one. If two frames share the same name, the browser can pick the wrong one and later use memory it has already freed, which can crash or be exploited.
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.