Use after free in Blink (CVE-2026-4449)
A reference into a hash map of pending style invalidations is kept alive while a helper call can re-enter the same code and insert into that map, causing a rehash that frees the backing store. The stale reference is then used, producing a use-after-free crash in the Blink renderer.
- Fix shipped in 23 days
Summary
PendingInvalidations::ScheduleInvalidationSetsForNode() takes a NodeInvalidationSets& reference to a value stored inside PendingInvalidations::pending_invalidation_map_ (a HeapHashMap) and then calls PossiblyScheduleNthPseudoInvalidations(node) while that reference is still live. PossiblyScheduleNthPseudoInvalidations() can synchronously re-enter invalidation scheduling on the parent (via StyleEngine::ScheduleNthPseudoInvalidations(parent)), which can insert into the same HeapHashMap and trigger Rehash(). That rehash frees/poisons the old hash table backing, invalidating the outer reference. Therefore, when the outer frame resumes, it access the stale NodeInvalidationSets and crash with UAF.
Details
PendingInvalidations::ScheduleInvalidationSetsForNode keeps a reference into pending_invalidation_map_ while calling out to a helper that can re-enter scheduling:
NodeInvalidationSets& pending_invalidations = EnsurePendingInvalidations(node);
for (auto& invalidation_set : invalidation_lists.siblings) {
if (pending_invalidations.Siblings().Contains(invalidation_set)) {
continue;
}
if (invalidation_set->InvalidatesNth()) {
PossiblyScheduleNthPseudoInvalidations(node);
}
pending_invalidations.Siblings().push_back(invalidation_set);
}
The callout is synchronous. In PossiblyScheduleNthPseudoInvalidations, when the parent has positional-rule flags set, it immediately schedules nth invalidations on the parent:
if ((parent->ChildrenAffectedByForwardPositionalRules() && node.nextSibling()) ||
(parent->ChildrenAffectedByBackwardPositionalRules() &&
node.previousSibling())) {
node.GetDocument().GetStyleEngine().ScheduleNthPseudoInvalidations(*parent);
}
StyleEngine::ScheduleNthPseudoInvalidations() then re-enters the same PendingInvalidations instance (source):
pending_invalidations_.ScheduleInvalidationSetsForNode(invalidation_lists,
nth_parent);
The re-entrant call can insert into the same HeapHashMap via PendingInvalidations::EnsurePendingInvalidations:
PendingInvalidationMap::AddResult add_result =
pending_invalidation_map_.insert(&node, NodeInvalidationSets());
return add_result.stored_value->value;
When the insertion crosses the hash table's expansion threshold and MustRehashInPlace() is true, HashTable::Expand can do a same-size rehash:
// ...
else if (MustRehashInPlace()) {
new_size = table_size_;
} else {
new_size = table_size_ * 2;
}
return Rehash(new_size, entry);
When returned to the outer ScheduleInvalidationSetsForNode() frame, it continues operating on the stale pending_invalidations reference. The next Vector access through that stale/invalid value (Vector::size() in wtf/vector.h:1348) and triggers the UAF.
Bisection
This issue is introduced by the commit c98887131608ef87756a77a3493aac8b6b8ec02e, hence it affects all stable versions.
Reproduction
Download the chrome from https://storage.googleapis.com/chromium-browser-asan/linux-release/asan-linux-release-1588577.zip
Run the following commandline:
./chrome --no-sandbox poc.html
You would get the ASAN crash with UAP in asan.txt.
Suggested Fix
Avoid holding references/pointers into pending_invalidation_map_ across any call that can re-enter PendingInvalidations and mutate/rehash the same map.
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 a reference into a heap hash map is held across a synchronous call that can re-enter the same scheduling code and insert into that map, triggering a rehash that invalidates the reference.
What the attacker needed
Victim loads a crafted HTML page; ASAN build to observe the crash
The fix
The code should not hold references or pointers into the pending invalidation map across calls that can re-enter and mutate it.
How it was found
- Build or download the ASAN-instrumented Chrome build referenced in the report.
- Run the browser against the provided HTML proof-of-concept file with sandboxing disabled.
- Observe the ASAN report showing a use-after-free in the invalidation scheduling code.
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.
The browser keeps a table of style changes it still has to apply. One function holds a pointer into that table while calling another function, and that second call can add an entry, which makes the table move its contents to a new memory area. The first function then reads the old, freed memory, which is a use-after-free and crashes the browser.
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.