Use after free in Inspector (CVE-2025-2136)
A use-after-free flaw exists in the LegacyDOMSnapshotAgent::VisitNode function of Chrome's Inspector. An attacker could potentially exploit this to cause a crash or possibly execute arbitrary code by loading a malicious extension.
- Fix shipped in 29 days
VULNERABILITY DETAILS UAF in blink::LegacyDOMSnapshotAgent::VisitNode
VERSION Chrome Version: 134.0.6986.0(Developer Build) Operating System: Ubuntu
REPRODUCTION CASE
- put manifest.json/background.js into the extension_path
- run the command: ./chrome --user-data-dir=./noexist --no-sandbox --load-extension="extension_path"
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION Type of crash: tab Crash State: see asan.log file
CREDIT INFORMATION Externally reported security bugs may appear in Chrome release notes. If this bug is included, how would you like to be credited? Reporter credit: Sakana.S
What the report shows
This is a Chrome VRP advisory for a use-after-free (UAF) in the Inspector feature, tracked as CVE-2025-2136 and credited to Sakana.S. The platform records it as medium severity with a bounty of 3,000 USD, disclosed on 10 March 2025. The report itself is short and consists of a vulnerability summary, a version line, a reproduction case and a crash note.
The vulnerable function named in the report is blink::LegacyDOMSnapshotAgent::VisitNode. The report describes the bug as a UAF in that function and gives the affected build as:
Chrome Version: 134.0.6986.0(Developer Build)
Operating System: Ubuntu
The reproduction is driven by a browser extension. The researcher's steps are:
- Put
manifest.jsonandbackground.jsinto the extension directory (referred to asextension_path). - Launch Chrome with that extension loaded using the following command:
./chrome --user-data-dir=./noexist --no-sandbox --load-extension="extension_path"
The report does not include the contents of manifest.json or background.js, so the exact trigger logic is not shown in the text. What it does tell us is that the crash is reached by loading an unpacked extension into a fresh profile directory and starting the browser.
The crash section states the crash type is a tab crash and points to an asan.log file for the crash state. That log is not reproduced in the report, so the stack trace and the exact allocation and free sites are not available here. The credit section confirms the reporter name, Sakana.S, and notes that externally reported security bugs may appear in Chrome release notes.
Root cause
The report points to a use-after-free in blink::LegacyDOMSnapshotAgent::VisitNode. The report does not describe the cause; it only names the function where the use-after-free occurs. Because the report does not include the ASan trace or the extension source, the precise lifetime mistake, whether a missing keep-alive, a stale cached pointer, or a re-entrancy issue during the walk, is not established by the text.
Impact
The report classifies the crash as a tab crash. A use-after-free in the renderer is memory corruption, and in principle memory corruption in a browser process can be steered beyond a crash, but the report does not demonstrate exploitation, code execution or any sandbox escape. The stated outcome is a crash in a tab, and the severity recorded for the issue is medium.
How this kind of bug works
A use-after-free happens when code keeps a pointer or reference to an object, the object is destroyed (for example because the last owning reference is dropped, or because a collection is cleared during a callback), and the stale pointer is then dereferenced. In a DOM traversal this is easy to introduce: the walker visits a node, something in the visit triggers script or a lifecycle change that removes and frees nodes, and the walker continues with a pointer that is no longer valid. Garbage-collected heaps make it worse because the free may be deferred and the reuse may happen later, so the corruption can surface far from the cause.
Defences are lifetime discipline and memory safety. Owning references (smart pointers, garbage-collected handles, Member/Trace style rooting in Blink) keep objects alive for the duration of a traversal; re-checking validity after any callback that can mutate the tree prevents stale use; and allocator hardening plus ASan in developer builds turns the bug into a deterministic crash during testing. Address-space layout randomisation and heap partitioning raise the cost of turning the corruption into control of execution, but they do not remove the bug.
How to test for it
This class of bug is found by making an object die while another part of the engine still expects it to be alive. A general method:
- Identify a feature that walks or caches a structure and exposes callbacks or events during the walk: DOM snapshotting, accessibility tree building, serialisation, mutation observers, inspector protocol handlers.
- Find the inputs that can mutate or destroy the structure mid-walk: script that removes nodes, navigations, extension APIs, devtools commands, or lifecycle events.
- Drive the walk and the mutation so they interleave, and repeat with timing variation, since the free may be deferred.
- Run against an ASan or debug build where possible; a positive result is a heap-use-after-free report naming the read and the free, with a stack that shows the traversal frame.
- Confirm reproducibility and minimise to the smallest input that still crashes.
Common false positives are ordinary null dereferences, assertion failures in debug-only code, and crashes caused by the test harness itself. A genuine UAF report should show the allocation, the free and the later access in one trace.
How it is fixed
The standard fix is to correct the lifetime: hold a strong reference to the visited object for the duration of the traversal, revalidate the pointer after any callback that can mutate the tree, or defer the visit until the mutation has settled. Where the design allows, the traversal should operate on a stable snapshot rather than live nodes. The report does not describe how the bug was fixed.
Hunting notes
UAFs of this shape tend to hide in code that combines traversal with user-controllable mutation: DOM and accessibility snapshots, inspector and devtools protocol handlers, extension APIs that observe pages, and serialisation paths. Recon signals include features that expose a snapshot or tree to script or to an extension, and any API where a callback fires while an internal walk is in progress. To get a report accepted, show a minimal reproducer, the exact build and platform, and a sanitizer trace that names the freed object and the stale access; state clearly whether the result is a crash or something stronger, and do not claim exploitation you have not demonstrated.
What happened, in plain words
This is a public bug report from the Chrome Vulnerability Rewards Program (VRP), the scheme Google runs to pay people who find and report security flaws in Chrome. The report describes a bug in Chrome's Inspector feature, tracked as CVE-2025-2136 and credited to Sakana.S. The platform records it as medium severity with a bounty of 3,000 USD, disclosed on 10 March 2025.
A quick word on the two main ideas before we go further. Chrome is the browser you are using to read this. The Inspector is the part of Chrome that lets a developer look inside a web page: its structure, its elements, its state. A use-after-free (UAF) is a bug where a program keeps a note pointing at a piece of memory, that memory gets cleaned up and handed back to the system, and then the program uses the old note anyway. Think of it like writing down a friend's old address, the friend moves out, someone else moves in, and you post a letter to the old address expecting your friend to get it. The letter goes to the wrong person, or the post office complains. In software, the result is usually a crash, and sometimes worse.
The report is short. It has four parts: a one-line summary of the bug, the version of Chrome affected, a reproduction case, and a crash note.
The details in the report
The vulnerable function named in the report is blink::LegacyDOMSnapshotAgent::VisitNode. Blink is the engine inside Chrome that turns HTML into the page you see. A DOM (Document Object Model) is the tree of elements that makes up a page: the page body contains a heading, the heading contains text, and so on. A snapshot is a copy of that tree taken at one moment. VisitNode is the function that walks the tree, one node at a time, to build that snapshot.
The report gives the affected build as:
Chrome Version: 134.0.6986.0(Developer Build)
Operating System: Ubuntu
That is a developer build of Chrome 134 running on Ubuntu, a Linux distribution. Developer builds are the versions Chrome engineers use while working on the browser; they include extra checks that normal release builds leave out.
The reproduction is driven by a browser extension. An extension is a small add-on you install into Chrome to add features. It is made of files, and two of them are named here: manifest.json, which describes the extension (its name, permissions, which scripts to run), and background.js, a script that runs in the background while the extension is active. The researcher's steps are:
- Put
manifest.jsonandbackground.jsinto the extension directory (referred to asextension_path). - Launch Chrome with that extension loaded using the following command:
./chrome --user-data-dir=./noexist --no-sandbox --load-extension="extension_path"
Line by line, that command does the following:
./chromeruns the Chrome binary sitting in the current directory.--user-data-dir=./noexisttells Chrome to use a fresh profile folder callednoexist. A profile is where Chrome stores your bookmarks, history, settings and cookies. Using a fresh one means the test starts clean, with no leftover state that could affect the result.--no-sandboxturns off Chrome's sandbox. The sandbox is a security boundary that stops a compromised tab from reaching the rest of your computer. Turning it off makes debugging easier, but it is not something you would do in normal use.--load-extension="extension_path"loads the unpacked extension from the folder namedextension_path.
The report does not include the contents of manifest.json or background.js, so the exact trigger logic is not shown. What it does tell us is that the crash is reached by loading an unpacked extension into a fresh profile and starting the browser.
The crash section states the crash type is a tab crash and points to an asan.log file for the crash state. ASan (AddressSanitizer) is a tool built into developer builds that watches memory and shouts loudly when a program reads or writes memory it should not. The log it produces would show exactly where the bad access happened. That log is not reproduced in the report, so the stack trace and the exact allocation and free sites are not available here.
The credit section confirms the reporter name, Sakana.S, and notes that externally reported security bugs may appear in Chrome release notes.
In general, how this kind of bug works
A use-after-free happens when code keeps a pointer or reference to an object, the object is destroyed (for example because the last owning reference is dropped, or because a collection is cleared during a callback), and the stale pointer is then used. In a DOM traversal this is easy to introduce: the walker visits a node, something in the visit triggers script or a lifecycle change that removes and frees nodes, and the walker continues with a pointer that is no longer valid. Garbage-collected heaps make it worse because the free may be deferred and the reuse may happen later, so the corruption can surface far from the cause.
Defences are lifetime discipline and memory safety. Owning references (smart pointers, garbage-collected handles, Member/Trace style rooting in Blink) keep objects alive for the duration of a traversal; re-checking validity after any callback that can mutate the tree prevents stale use; and allocator hardening plus ASan in developer builds turns the bug into a deterministic crash during testing. Address-space layout randomisation and heap partitioning raise the cost of turning the corruption into control of execution, but they do not remove the bug.
In general, how to test for it
This class of bug is found by making an object die while another part of the engine still expects it to be alive. A general method:
- Identify a feature that walks or caches a structure and exposes callbacks or events during the walk: DOM snapshotting, accessibility tree building, serialisation, mutation observers, inspector protocol handlers.
- Find the inputs that can mutate or destroy the structure mid-walk: script that removes nodes, navigations, extension APIs, devtools commands, or lifecycle events.
- Drive the walk and the mutation so they interleave, and repeat with timing variation, since the free may be deferred.
- Run against an ASan or debug build where possible; a positive result is a heap-use-after-free report naming the read and the free, with a stack that shows the traversal frame.
- Confirm reproducibility and minimise to the smallest input that still crashes.
Common false positives are ordinary null dereferences, assertion failures in debug-only code, and crashes caused by the test harness itself. A genuine UAF report should show the allocation, the free and the later access in one trace.
In general, how it is fixed
The standard fix is to correct the lifetime: hold a strong reference to the visited object for the duration of the traversal, revalidate the pointer after any callback that can mutate the tree, or defer the visit until the mutation has settled. Where the design allows, the traversal should operate on a stable snapshot rather than live nodes. The report does not describe how the bug was fixed.
Glossary
- Chrome VRP: Google's Vulnerability Rewards Program, which pays researchers for reporting security bugs in Chrome.
- CVE: Common Vulnerabilities and Exposures, a public identifier given to a known security flaw so people can refer to it unambiguously.
- Use-after-free (UAF): a bug where a program uses memory after it has been freed, usually causing a crash and sometimes allowing an attacker to control what happens next.
- Blink: the rendering engine inside Chrome that turns HTML and CSS into the page you see.
- DOM: Document Object Model, the tree of elements that makes up a web page.
- Snapshot: a copy of a structure (here, the DOM tree) taken at one moment in time.
- Inspector: the part of Chrome that lets a developer inspect a page's structure and state.
- Extension: a small add-on installed into Chrome to add features, made of files such as
manifest.jsonandbackground.js. - manifest.json: the file that describes an extension: its name, permissions and which scripts to run.
- background.js: a script that runs in the background while an extension is active.
- Profile: the folder where Chrome stores bookmarks, history, settings and cookies.
- Sandbox: a security boundary that stops a compromised tab from reaching the rest of your computer.
- ASan (AddressSanitizer): a tool in developer builds that detects reads and writes to memory that should not be touched.
- Stack trace: a list of the function calls that led to a particular point in a program, useful for finding where a crash happened.
- Pointer / reference: a note inside a program that says where a piece of data lives in memory.
- Garbage collection: automatic cleanup of memory that is no longer in use.
- Heap: the area of memory where a program stores objects it creates while running.
- Address-space layout randomisation (ASLR): a defence that shuffles where things sit in memory, making it harder for an attacker to predict addresses.
- Heap partitioning: a defence that separates different kinds of objects in memory so corruption in one area is less likely to affect another.
- Null dereference: a crash caused by using a pointer that points at nothing.
- Assertion failure: a check in code that fires when something the programmer assumed to be true turns out not to be; common in debug builds.
- False positive: a test result that looks like a bug but is not one.