Skip to content
Memory corruption Advisory Advanced CVE-2026-19165

Use after free in Extensions (CVE-2026-19165)

A use-after-free occurs in the extension API event dispatch code when converting event arguments can re-enter JavaScript, allowing an extension-controlled getter to tear down its own context and free the emitter map. The stale reference is then dereferenced, causing a renderer-side native memory corruption crash.

bean5oup Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 19 days

Report description

UAF in Extension API event dispatch


Bug location

Where do you want to report your vulnerability?

Chrome VRP – Report security issues affecting the Chrome browser. See program rules

Which URL (or repository) have you found the vulnerability in?

https://source.chromium.org/chromium/chromium/src/+/586fb22d7314488f688c0d2d6b572e19ef3a880b:extensions/renderer/bindings/api_event_handler.cc;l=109-121;bpv=0;bpt=0


The problem

Please describe the technical details of the vulnerability

VULNERABILITY DETAILS

Summary

DispatchEvent() stores a reference to a v8::Global from the emitter map and then calls FromV8() on event arguments, which can reenter JS. During reentrancy, the extension context can be torn down, triggering emitters.clear() and freeing that map. When control returns, DispatchEvent() uses the stale v8::Global again via Get(), causing a use-after-free.

Details

Through FromV8(), Array conversion performs observable indexed property access and can synchronously execute JS. An getter controlled by extension removes its own iframe during this conversion. Context teardown clears the emitter map and frees the referenced map.

C++
auto iter = data->emitters.find(event_name);
if (iter == data->emitters.end()) {
  return;
}
v8::Global<v8::Object>& v8_emitter = iter->second;

v8::LocalVector<v8::Value> args(isolate);
CHECK(gin::Converter<v8::LocalVector<v8::Value>>::FromV8(isolate, info[0],
                                                         &args));

EventEmitter* emitter = nullptr;
gin::Converter<EventEmitter*>::FromV8(isolate, v8_emitter.Get(isolate),
                                      &emitter);

To call DispatchEvent(), printerProvider extension API is used.

The sequence is:

printerProvider event dispatch
  -> save reference to the emitter map node
  -> convert argument array
  -> execute attacker-controlled getter
  -> remove the extension iframe
  -> synchronous ScriptContext invalidation
  -> APIEventHandler::InvalidateContext()
  -> emitters.clear() frees the map node
  -> return to DispatchEvent()
  -> stale v8_emitter.Get() dereference

REPRODUCTION CASE

Run Chrome:

C++
ASAN_OPTIONS="symbolize=1:print_stacktrace=1:halt_on_error=1:abort_on_error=0:detect_leaks=0:external_symbolizer_path=/path/to/llvm-symbolizer"
/path/to/chrome \
--user-data-dir=/tmp/poc0 \
--load-extension=/path/to/extension \
about:blank

Open chrome://newtab to load top.html in the extension context

Open Print Preview (Ctrl + P) and click See more… on the destination section

ASAN symbols were not fully resolved, so I used:

C
python3 /path/to/chromium/src/tools/valgrind/asan/asan_symbolize.py < /path/to/asan.log

Attached as poc.mov which shows the full repro steps.

Impact analysis

This vulnerability enables a renderer-side native use-after-free triggered via extension-controlled event dispatch


The cause

What version of Chrome have you found the security issue in?

Chromium: Tested on asan-linux-release-1664338, 152.0.7958.0

Is the security issue related to a crash?

Yes, it is related to a crash.

Choose the type of vulnerability

Memory Corruption (in a sandboxed process)

How would you like to be publicly acknowledged for your report?

@bean5oup

The original report as published on the Chromium issue tracker, by @bean5oup. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 code holds a reference into a map across a call that can re-enter JavaScript and trigger context teardown, which clears the map and frees the referenced node.

Impact

This vulnerability enables a renderer-side native use-after-free triggered via extension-controlled event dispatch, which crashes the sandboxed renderer and may allow memory corruption.

What the attacker needed

A malicious extension installed; user opens Print Preview; user expands destination section

How it was found

  1. Launch Chrome with the proof-of-concept extension loaded and open a blank page.
  2. Open the extension's new-tab page so the extension context is active.
  3. Open Print Preview and expand the destination section to trigger the printerProvider event dispatch.
  4. The event argument conversion runs the extension's getter, which removes its own iframe and frees the emitter map.
  5. Control returns to the dispatch code, which dereferences the stale reference and crashes under ASAN.

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 a browser extension fires an event, the browser looks up a stored reference to the event handler and then converts the event's arguments. Converting those arguments can run JavaScript written by the extension, and that JavaScript can remove the extension's own page. Removing the page frees the stored reference, but the browser still tries to use it afterwards, touching memory that no longer belongs to it. This kind of mistake is called a use-after-free and can crash the browser or, in principle, be exploited for memory corruption.

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.

More by bean5oup

View all

6 more disclosed reports, best first.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.