Use after free in Extensions (CVE-2026-17778)
A logic error in the extension binding system's lazy-initialization path allows a live APIBinding object to be destroyed while V8 still holds raw pointers to its internal structures. An attacker could potentially trigger a use-after-free and achieve arbitrary code execution in the renderer process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A logic error in the extension binding system's lazy-initialization path allows a live APIBinding object to be destroyed while V8 still holds raw pointers to its internal structures. This leads to a potential Use-After-Free (UAF) vulnerability in the renderer process.
Affected files:
extensions/renderer/bindings/api_bindings_system.ccextensions/renderer/bindings/api_binding.ccextensions/renderer/bindings/api_binding_js_util.ccextensions/renderer/bindings/api_type_reference_map.ccextensions/renderer/native_extension_bindings_system.cc
Estimated timestamp from git blame: 2017-02-10
Description
A potential Use-After-Free (UAF) vulnerability exists in the extension renderer's API binding system. The issue is located in APIBindingsSystem::InitializeType, which is responsible for the lazy initialization of extension APIs. The function unconditionally replaces existing APIBinding objects in its internal map, leading to the destruction of objects that V8 still references via raw pointers.
Root Cause Analysis
In extensions/renderer/bindings/api_bindings_system.cc, the InitializeType function performs the following logic:
void APIBindingsSystem::InitializeType(const std::string& type_name) {
// ...
std::string api_name = type_name.substr(0, dot);
// If we've already instantiated the binding, the type should have been in there.
DCHECK(!api_bindings_.contains(api_name)) << api_name; // Stripped in release builds
api_bindings_[api_name] = CreateNewAPIBinding(api_name); // Unconditional overwrite
}
In release builds, the DCHECK is removed. If InitializeType is triggered for an API that is already loaded (for example, by requesting a non-existent method or type name with a valid API prefix), the move-assignment destroys the existing unique_ptr<APIBinding>.
When an APIBinding is created, it initializes V8 functions for its methods. These functions use v8::External objects to store raw pointers to MethodData::callback members, which are owned by the APIBinding object. Although the APIBinding is destroyed, the V8 functions may persist in V8's per-context cache. When these functions are later called, the system attempts to dereference the dangling pointer stored in the v8::External to execute the callback.
Potential Exploitation Path
While we do not have a working proof-of-concept, an attacker could potentially follow these steps within an extension renderer process:
- Obtain a reference to a cached API method (e.g.,
const staleFunc = chrome.runtime.sendMessage;). This V8 function now holds av8::Externalwith a raw pointer to internal C++ structures. - Trigger a call to
InitializeTypefor the already-loaded "runtime" API using a non-existent member name (e.g., viabindingUtil.validateType('runtime.bogus', {})). This causes the destruction of the originalAPIBindingfor the "runtime" API. - Use a JavaScript reentrancy window (such as a getter on an object passed to the initialization call) to perform heap grooming and reclaim the memory previously occupied by the freed internal structures.
- Invoke the cached API method (
staleFunc()). This triggersRunAPIBindingHandlerCallback, which dereferences the dangling pointer and executes the callback. If the attacker successfully reclaimed the memory, they could achieve a controlled indirect call and arbitrary code execution.
Note: The bindingUtil object is primarily used by internal Chrome modules, but any path that allows an attacker to influence the strings passed to the binding system's initialization logic would make this reachable.
Suggested Fix
Replace the DCHECK in APIBindingsSystem::InitializeType with a runtime check and an early return if the API is already initialized:
void APIBindingsSystem::InitializeType(const std::string& type_name) {
// ... parsing api_name ...
if (api_bindings_.contains(api_name)) {
return;
}
api_bindings_[api_name] = CreateNewAPIBinding(api_name);
}
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the InitializeType function unconditionally overwrites an existing APIBinding in its map, destroying the object while V8 functions still hold raw pointers to its internals.
Impact
If the attacker successfully reclaims the memory, they could achieve a controlled indirect call and arbitrary code execution, though the report notes no working proof-of-concept and that the bindingUtil object is primarily used by internal Chrome modules.
What the attacker needed
Ability to influence binding initialization strings; extension renderer process
The fix
The DCHECK should be replaced with a runtime check and an early return if the API is already initialized.
How it was found
- Obtain a reference to a cached API method.
- Trigger InitializeType for an already-loaded API using a non-existent member name.
- Use a JavaScript reentrancy window to perform heap grooming and reclaim freed memory.
- Invoke the cached API method to dereference the dangling pointer.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This report describes a memory safety bug in Chrome's extension system. When an extension API is loaded twice, the old internal object is deleted but some JavaScript functions still point to it, so calling those functions later can crash or run attacker-controlled code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.