Use after free in V8 (CVE-2026-14393)
A use-after-free exists in V8 Inspector's console message handling when DevTools is open, because the liveness guard only checks a context group ID rather than the storage object's identity. An attacker could trigger a nested message loop via a debugger statement in a getter, causing the storage to be freed and recreated, leading to UAF read/write and potential memory corruption.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 54 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 exists in V8 Inspector's console message handling when DevTools is open. An attacker could bypass the hasConsoleMessageStorage liveness guard by using a debugger; statement in a custom object getter to trigger a nested message loop. During this pause, an attacker-initiated navigation can destroy the original V8ConsoleMessageStorage and recreate a new one, leading to UAF read/write operations when the getter returns.
Affected files:
v8/src/inspector/v8-console-message.ccv8/src/inspector/v8-runtime-agent-impl.ccv8/src/inspector/v8-inspector-impl.cc
Estimated timestamp from git blame: 2026-02-24
Summary
A potential Use-After-Free (UAF) vulnerability has been identified in the V8 Inspector component. The issue stems from the hasConsoleMessageStorage guard, which is used to verify the liveness of a V8ConsoleMessageStorage instance after a JavaScript callout. This guard only checks for the presence of a context group ID in a map, failing to verify the identity of the specific storage object itself. If the storage is destroyed and then re-created for the same context group ID during a callout, the guard will return a false positive, leading to subsequent operations on a freed object.
Technical Details
There are two identified vectors for this vulnerability: a UAF write in V8ConsoleMessageStorage::addMessage and a UAF read in V8RuntimeAgentImpl::enable.
Vector 1: UAF Write in V8ConsoleMessageStorage::addMessage
V8ConsoleMessageStorage::addMessagelogs a console message and callsm_inspector->forEachSession. This triggersV8RuntimeAgentImpl::reportMessage.reportMessagecallsValueMirror::create(viawrapArgumentsorwrapException) to wrap the object. For anErrorobject,ValueMirror::createattempts to access the propertiesname,message, andstackviagetErrorProperty.- While
getErrorPropertyavoids direct user-defined getters, it falls back toobject->Get(...)if the property is not an 'own' property. This allows an attacker to execute custom JavaScript synchronously by placing aProxywith agettrap on the object's prototype chain. - The attacker places a
debugger;statement inside thisgettrap. This forces a synchronous pause, spinning up a nested message loop in V8. - During this nested loop, the renderer continues to process high-priority IPCs. The attacker arranges for a navigation or frame detachment IPC to arrive at this moment. This triggers
V8InspectorImpl::resetContextGroup, which erases theV8ConsoleMessageStorageobject (this) fromm_consoleStorageMap, freeing it. - Still within the nested loop (e.g., via DevTools evaluation), the attacker logs a new message to the identical context group. This invokes
V8InspectorImpl::ensureConsoleMessageStorage, which allocates a new storage object and inserts it intom_consoleStorageMapusing the samecontextGroupId. - The attacker resumes execution, unwinding the stack back to
V8ConsoleMessageStorage::addMessage. addMessageexecutes its liveness guard:if (!inspector->hasConsoleMessageStorage(contextGroupId)) return;. Because a new object was created in Step 6, the ID exists in the map, and the guard incorrectly returnstrue.addMessageproceeds to callm_messages.push_back(...)on the freedthispointer, resulting in a UAF write.
Vector 2: UAF Read in V8RuntimeAgentImpl::enable
V8RuntimeAgentImpl::enablecaches a pointer to the storage and a reference to its message deque:const auto& messages = storage->messages();.- It iterates over this deque, calling
reportMessage. - If
reportMessagetriggers the samedebugger;nested loop sequence described above, the original storage and its deque are freed, and a new storage is created. - The
hasConsoleMessageStorageguard at the end ofreportMessagefalsely returnstrue. - The loop continues to the next iteration, accessing
messages.size()andmessages[i]using the dangling reference, leading to a UAF read.
Impact
This vulnerability could lead to memory corruption within the renderer process. An attacker could leverage the UAF write to corrupt the heap, potentially achieving Remote Code Execution (RCE) within the renderer sandbox. Exploitation requires DevTools to be open and the user to visit a malicious site.
(Note: These are suggested steps based on static analysis; our tooling agent cannot execute code to verify the exploit.)
Suggested Fix
To prevent this vulnerability, the liveness checks must verify the identity of the storage object, not just the existence of the group ID.
- For
V8ConsoleMessageStorage::addMessage: Instead of relying onhasConsoleMessageStorage(contextGroupId), capture abase::WeakPtr(or equivalent weak reference mechanism available in V8) tothisbefore theforEachSessioncall. Check if the weak pointer is still valid after the call returns. - For
V8RuntimeAgentImpl::enable: Do not cache raw references or pointers across calls that can execute JavaScript. Instead, maintain an index and fetch the storage and message at that index dynamically on each iteration, verifying the storage object hasn't been unexpectedly swapped out or deleted.
Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955
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. 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 liveness guard checks only for the presence of a context group ID in a map, not the identity of the specific storage object, so a freed storage can be replaced by a new one with the same ID and the guard returns a false positive.
Impact
This could lead to memory corruption within the renderer process, potentially achieving Remote Code Execution within the renderer sandbox, but exploitation requires DevTools to be open and the user to visit a malicious site.
What the attacker needed
DevTools must be open; Victim visits a malicious site; Attacker can trigger navigation during nested loop
The fix
The liveness checks should verify the identity of the storage object, for example by using a weak pointer or by fetching the storage dynamically on each iteration.
How it was found
- Open DevTools and visit a malicious page that logs a console message with an Error object whose prototype chain contains a Proxy with a get trap.
- The get trap executes a debugger statement, causing a nested message loop.
- During the nested loop, a navigation or frame detachment IPC arrives, triggering resetContextGroup and freeing the storage.
- Still in the nested loop, a new message is logged to the same context group, creating a new storage with the same ID.
- Execution resumes and addMessage's liveness guard falsely returns true, then push_back is called on the freed pointer, causing a UAF write.
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 you open developer tools in a browser, the browser keeps track of console messages in a special storage object. A use-after-free happens when the program keeps using that object after it has been deleted, which can let an attacker corrupt memory. Here, the check that the object still exists only looks at an ID, so if the object is deleted and a new one with the same ID is created, the check wrongly passes and the old, freed object is used.
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.