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

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

A use-after-free flaw in Chromium's extension script update code leaves dangling pointers if mapping new shared memory fails. A malicious web page could potentially reclaim that memory and execute arbitrary JavaScript in the extension's privileged Isolated World.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 months

Flapjack (go/flapjack), an LLM-powered static analysis tool, has identified the following potential security issue.

Overview: A Use-After-Free vulnerability exists in UserScriptSet::UpdateUserScripts when updating extension scripts. If mapping the new shared memory region fails (e.g., due to address space exhaustion), the old mapping is destroyed but the scripts_ vector is not cleared, leaving dangling pointers to the unmapped memory. A malicious web page could potentially reclaim this memory and execute arbitrary JavaScript in the extension's privileged Isolated World.

Affected files:

  • extensions/renderer/user_script_set.cc

Estimated timestamp from git blame: 2026-02-10

Description

A Use-After-Free (UAF) vulnerability exists in extensions/renderer/user_script_set.cc. In the UserScriptSet::UpdateUserScripts method, the existing shared memory mapping (shared_memory_mapping_) is replaced with a new mapping before the existing UserScript objects (stored in scripts_) are cleared.

If the attempt to map the new shared memory region fails, the renderer process is left in a corrupted state with dangling pointers that can be exploited by a malicious web page to escalate privileges into the extension's Isolated World.

Root Cause

When the browser sends an IPC message to update extension scripts, UserScriptSet::UpdateUserScripts receives a base::ReadOnlySharedMemoryRegion (shared_memory). At line 160, the method attempts to map this region:

C++
160:   shared_memory_mapping_ = shared_memory.Map();
161:   if (!shared_memory.IsValid())
162:     return false;

The assignment to shared_memory_mapping_ invokes the move-assignment operator of base::SharedMemoryMapping. This operator immediately unmaps the existing memory pages, returning them to the operating system.

If the shared_memory.Map() call fails (e.g., due to address space exhaustion or hitting OS mapping limits like vm.max_map_count), it returns an invalid mapping. Because shared_memory.IsValid() checks the validity of the region handle (which is valid), execution continues.

At lines 165-168, the code attempts to read the pickle header:

C++
165:   const base::Pickle::Header* pickle_header =
166:       shared_memory_mapping_.GetMemoryAs<base::Pickle::Header>();
167:   if (!pickle_header)
168:     return false;

Because the mapping failed and is invalid, GetMemoryAs safely returns nullptr. This causes the condition if (!pickle_header) to evaluate to true, resulting in an early return.

Crucially, this early return bypasses the cleanup of the scripts_ vector at lines 189-190:

C++
189:   scripts_.clear();
190:   script_sources_.clear();

As a result, the scripts_ vector retains the UserScript objects from the previous update. These objects store std::string_view members pointing directly into the virtual memory address range that was unmapped by the move-assignment operator at line 160.

Exploitation and Impact

While the original report suggested this could be exploited by an already "compromised renderer," Chromium's security model dictates that an attacker with RCE in a renderer already possesses full control over that process's isolated worlds. Therefore, a post-compromise UAF is not a security boundary bypass.

However, a severe security boundary bypass exists if an uncompromised, malicious web page triggers this flaw:

  1. Trigger the Mapping Failure: A malicious web page aggressively consumes the renderer's virtual address space (e.g., creating numerous ArrayBuffer objects) or exhausts the OS mapping limits. This is particularly feasible on 32-bit platforms (like 32-bit Android) where the 3GB address space can be exhausted without triggering PartitionAlloc's OOM killer (base::TerminateBecauseOutOfMemory).
  2. Await an Update: The attacker waits for an extension script update (e.g., an auto-update or dynamic script registration) that triggers the UpdateUserScripts IPC. At that exact moment, the Map() call fails, unmapping the old extension scripts but leaving the scripts_ vector populated with dangling pointers.
  3. Reclaim Memory: The attacker immediately allocates a large ArrayBuffer in JavaScript to predictably reclaim the recently freed virtual address space. They populate this ArrayBuffer with a malicious JavaScript payload.
  4. Execute Payload: The attacker triggers a DOM event or iframe navigation that matches the injection criteria for the extension's content scripts. The browser instructs the renderer to inject the script. The renderer iterates over the stale UserScript objects, reads the dangling std::string_view pointers (now pointing to the attacker's ArrayBuffer), and executes the malicious payload within the extension's Isolated World.

Executing arbitrary JavaScript within an extension's Isolated World from a normal web origin is a Privilege Escalation (S1 Severity), as the isolated world possesses elevated privileges (e.g., bypassing CORS for the extension's declared permissions).

Mitigation

The scripts_ and script_sources_ vectors must be cleared at the beginning of UpdateUserScripts, or at the very least, before the existing shared_memory_mapping_ is replaced. Alternatively, the new mapping should be validated in a temporary variable before it replaces the member variable, ensuring that the renderer state is not corrupted if the Map() operation fails.

Note: This analysis identifies a potential theoretical exploit path. As an AI agent, Flapjack cannot execute code to provide a functional proof-of-concept.

Evaluated with Chrome root at commit: 43c4f3945742db6f06efbaf9a77b90f34a720277


Results from Flapjack so far have been promising, but it can be wrong in its deductions. At this time, it does not produce proof of concepts or fuzzer tests. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve Flapjack’s accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The code replaces the shared memory mapping before clearing the script vector, so a failed mapping leaves dangling pointers.

Impact

A malicious web page could potentially execute arbitrary JavaScript in an extension's Isolated World, bypassing security boundaries, though the report notes this is a theoretical exploit path without a proof-of-concept.

What the attacker needed

Victim visits a malicious web page; extension script update occurs; memory mapping failure (e.g., address space exhaustion)

The fix

The script vectors should be cleared before replacing the shared memory mapping, or the new mapping should be validated in a temporary variable first.

How it was found

  1. A malicious web page consumes the renderer's virtual address space to make memory mapping fail.
  2. The attacker waits for an extension script update that triggers the vulnerable function.
  3. The mapping fails, unmapping old scripts but leaving dangling pointers in the script vector.
  4. The attacker allocates a large ArrayBuffer to reclaim the freed memory and fills it with a malicious payload.
  5. The attacker triggers a DOM event or iframe navigation that causes the extension to inject the stale script, executing the payload in the Isolated World.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a program frees memory but keeps using it, that's a use-after-free. Here, if a memory mapping step fails, the code still holds pointers to the old, now-unmapped memory. An attacker could fill that memory with their own data and trick the browser into running it with extra privileges.

What is Memory corruption?

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

More 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.