Use after free in GarbageCollection (CVE-2026-106291)
A double-free vulnerability exists in Blink's Oilpan garbage collection when a HeapHashMap uses HeapLinkedHashSet as its value type. An attacker could trigger the double-free by inserting elements into empty buckets after a GC cycle, potentially leading to renderer remote code execution.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 6 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 without the security team.
Overview: A potential double-free vulnerability exists in Blink's memory management when a HeapHashMap uses HeapLinkedHashSet as its value type. Empty buckets allocate a GC-managed backing store that gets swept during GC, and subsequent inserts into these buckets trigger a move-assignment that explicitly frees the already-swept backing.
Affected files:
third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.hthird_party/blink/renderer/core/frame/local_frame_view.hthird_party/blink/renderer/core/frame/local_frame_view.cc
Estimated timestamp from git blame: 2026-02-26
Final Assessment
A confirmed double-free vulnerability exists in Blink's Oilpan garbage collection, providing a path to renderer Remote Code Execution (RCE). The issue is triggered by a collision between HeapHashMap's empty bucket optimization and HeapLinkedHashSet's default constructor allocating an out-of-line heap buffer.
Technical Breakdown
Initial logic and memory allocation parameters are validated: LocalFrameView::canvas_elements_needing_onpaint_ expands and populates empty buckets with default-constructed HeapLinkedHashSet objects. These objects immediately allocate a GC-managed vector backing for their list anchor. Because Oilpan's TraceHashTableBackingInCollectionTrait::Trace intentionally skips empty buckets for performance, these initial allocations are systematically ignored during GC marking and are swept.
When an attacker inserts a new element that lands in an empty bucket, the system leaps directly into a destructive state transformation. The HashMapTranslator::Store operation executes a move-assignment (location.value = std::move(mapped)), forcing the old, already-freed Vector to clean up its state. The Vector::operator=(Vector&&) implementation calls clear(), skipping intermediate teardown logic and jumping straight to cppgc::subtle::FreeUnreferencedObject(). This issues an explicit free on memory that GC has already reclaimed, corrupting the Oilpan FreeList.
Potential Trigger Steps
(Note: These are suggested/potential steps; our tooling agent does not currently run live code to provide a working PoC.)
- Enable the
CanvasDrawElementexperimental feature flag. - Call
requestPaint()on anHTMLCanvasElementto initialize and expand thecanvas_elements_needing_onpaint_map, populating empty buckets. - Induce a Garbage Collection cycle to sweep the untraced vector backings.
- Call
requestPaint()on a second canvas element. The map insertion hits an empty bucket, move-assigns theHeapLinkedHashSet, and triggers the double-free. - Allocate attacker-controlled objects of the same size to consume the corrupted free list entries, leading to overlapping objects and type confusion.
Suggested Fix
Refactor BasicHeapLinkedHashSet and its underlying VectorBackedLinkedList so the default constructor does not immediately allocate an out-of-line buffer. Allocation of the anchor node should be deferred until the first actual element is inserted, preventing empty hash table buckets from holding live GC allocations.
Evaluated with Chrome root at commit: 09ec9e7cc4d24823d20b6d37cf3d282734f6bf0f
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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 default constructor of HeapLinkedHashSet allocates a backing store that is not traced during garbage collection, leading to a double-free when the bucket is later reused.
What the attacker needed
CanvasDrawElement feature flag enabled; Ability to call requestPaint() on canvas elements; Trigger a garbage collection cycle
The fix
Refactor BasicHeapLinkedHashSet and its underlying VectorBackedLinkedList so the default constructor does not immediately allocate an out-of-line buffer, deferring allocation until the first element is inserted.
How it was found
- Enable the CanvasDrawElement experimental feature flag.
- Call requestPaint() on an HTMLCanvasElement to initialize and expand the canvas_elements_needing_onpaint_ map, populating empty buckets.
- Induce a Garbage Collection cycle to sweep the untraced vector backings.
- Call requestPaint() on a second canvas element. The map insertion hits an empty bucket, move-assigns the HeapLinkedHashSet, and triggers the double-free.
- Allocate attacker-controlled objects of the same size to consume the corrupted free list entries, leading to overlapping objects and type confusion.
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 management bug in a web browser's rendering engine. When certain data structures are used in a particular way, the garbage collector (which automatically frees unused memory) and the code that inserts new items can both try to free the same memory, causing corruption. An attacker who can trigger this might be able to run their own code on the victim's machine.
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.