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

Use after free in CSS (CVE-2026-2313)

A use-after-free vulnerability exists in the RouteMap::UpdateActiveRoutes function where JavaScript can trigger a rehash of the routes_ container during iteration, invalidating iterators. An attacker could potentially exploit this to cause a crash or possibly achieve code execution.

Han Zheng Follow

Originally disclosed on Chrome VRP

Bounty$8,000 High View original
  • Fix shipped in 2 months

Steps to reproduce the problem

  1. open test.html with flag --enable-blink-features=RouteMatching
  2. click button
  3. UAP!

Problem Description

C++
void RouteMap::UpdateActiveRoutes() {
  bool changed = false;
  for (const auto& entry : routes_) {
    Route& route = *entry.value;
    changed = route.UpdateMatchStatus(previous_url_, next_url_) || changed; //<= trigger JS
  }
  for (const auto& entry : anonymous_routes_) {
    Route& route = *entry.value;
    changed = route.UpdateMatchStatus(previous_url_, next_url_) || changed;
  }
  if (changed) {
    GetDocument().GetStyleEngine().NavigationsMayHaveChanged();
  }
}

// JS trigger this snippet

      if (it == routes_.end()) {
        routes_.insert(name, route); // <= insert to container, rehash happen and invalidate all iterators
      }
   

Summary

Use-After-Poison in RouteMap::UpdateActiveRoutes

Custom Questions

Type of crash:

tab

Additional Data

Category: Security
Chrome Channel: Not sure
Regression: N/A \

The original report as published on the Chromium issue tracker, by Han Zheng (HexHive), Wenhao Fang (University of St. Andrews), and Qinying Wang (HexHive). Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

This is a Chrome VRP advisory for a use-after-free in the CSS engine, tracked as CVE-2026-2313 and rated high severity. The affected feature is route matching in Blink, which the report reaches through a command-line flag. The researcher is credited as Han Zheng (HexHive), Wenhao Fang (University of St. Andrews) and Qinying Wang (HexHive), and the bounty was 8,000 USD. The report was disclosed on 2026-02-10.

The reproduction is short and consists of three steps:

  1. open test.html with flag --enable-blink-features=RouteMatching
  2. click button
  3. UAP!

The crash type is recorded as a tab crash.

Root cause

The report points at RouteMap::UpdateActiveRoutes(). The function walks two containers, routes_ and anonymous_routes_, and for each entry calls route.UpdateMatchStatus(previous_url_, next_url_):

C++
void RouteMap::UpdateActiveRoutes() {
  bool changed = false;
  for (const auto& entry : routes_) {
    Route& route = *entry.value;
    changed = route.UpdateMatchStatus(previous_url_, next_url_) || changed; //<= trigger JS
  }
  for (const auto& entry : anonymous_routes_) {
    Route& route = *entry.value;
    changed = route.UpdateMatchStatus(previous_url_, next_url_) || changed;
  }
  if (changed) {
    GetDocument().GetStyleEngine().NavigationsMayHaveChanged();
  }
}

// JS trigger this snippet

      if (it == routes_.end()) {
        routes_.insert(name, route); // <= insert to container, rehash happen and invalidate all iterators
      }

The comment marks the call to UpdateMatchStatus as the point where JavaScript runs. That call can reach script, and script can insert a new entry into routes_. The insertion rehashes the container and invalidates the iterators the loop is using. The loop then continues over invalidated state, and the object it dereferences has already been freed. The summary names the class as a use-after-poison in RouteMap::UpdateActiveRoutes, which is the sanitizer's description of the same invalidated-memory access.

In short, the code mutates the container it is iterating over, from inside the loop body, through a callback that is allowed to run arbitrary script.

Impact

The report records a tab crash, which is the observable outcome in the reproduction. A use-after-free in a renderer is memory corruption, and in the general case that can be steered beyond a crash, but this report does not demonstrate anything beyond the crash and does not describe exploitability. The report does not describe exploitability beyond the crash.

How this kind of bug works

A use-after-free happens when code keeps a reference to an object after the object has been freed, then reads or writes through that reference. In C++ containers, the common trigger is invalidation: inserting into or erasing from a container can move or reallocate its internal storage, so pointers, references and iterators obtained earlier stop pointing at valid objects. If the program continues to use them, it touches freed memory.

The dangerous pattern here is re-entrancy during iteration. A loop holds an iterator into a container and calls out to code that can run script. Script is not supposed to be able to change engine-internal state mid-iteration, but any callback that can reach the DOM, style recalculation or a route table can do exactly that. The engine must either finish the iteration before running script, take a copy of the entries it needs, or detect that the container changed and restart.

Defences fall into a few groups: not running script while holding iterators, snapshotting the collection before iterating, using stable node-based containers or index-based access with generation checks, and, at the platform level, partitioning the heap and using memory-safe languages for new code. Sanitizers such as AddressSanitizer and the memory tools Chrome uses turn these bugs into deterministic crashes during testing, which is how they are usually caught before release.

How to test for it

Look for features where a loop over an internal collection calls into script. In a browser engine that means style, layout, DOM mutation observers, custom elements, animation frames and experimental features behind flags. In server software it means request handlers that iterate over sessions, routes or caches and invoke user callbacks.

A practical method:

  1. Identify the collection and the callback. Read the code or the feature documentation and find where iteration and script execution meet.
  2. Build a page that registers a callback which mutates the same collection the engine is iterating. For a route table, that means adding or removing routes from inside a match callback.
  3. Run it under a sanitizer build or with the relevant flag enabled, and watch for a crash in the iteration code.
  4. Vary the timing: mutate on the first entry, the last entry, and during nested callbacks, since rehashing may only happen at certain sizes.
  5. Confirm the crash is in the target function and not in unrelated code.

A positive result is a deterministic crash whose stack points at the iteration and the mutation, ideally with a sanitizer report naming the freed allocation. Common false positives are crashes caused by the test harness, by an unrelated flag combination, or by a null dereference that looks similar but is not memory corruption. Check that the crash disappears when the mutation is removed.

How it is fixed

The standard fixes are to stop iterating a container that script can mutate. Engineers either collect the entries into a local vector before the loop, defer the script-triggering work until after iteration completes, or re-check the container after each callback and restart if it changed. Where the container must stay live, they switch to a structure whose iterators survive insertion, or they hold strong references so objects cannot be freed underneath the loop. Regression tests then exercise the mutation-during-iteration path under a sanitizer.

Hunting notes

This class hides wherever engine code calls out to script while holding internal state: event dispatch, style and layout recalculation, custom element reactions, and experimental features that are still behind flags. Flags are a strong recon signal, because code paths that are not yet default are less exercised and more likely to miss re-entrancy handling. So are comments in the source that mention invalidation, rehash or iterator lifetime.

To get a report accepted, show a minimal reproduction, name the exact function and the mutation that invalidates state, and include the sanitizer output. State clearly whether the result is a crash only or whether you have shown more, and do not overclaim exploitability. A clean, deterministic repro against a current build is what turns a crash into a bounty.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 8 min read.

What happened, in plain words

This is a public bug bounty advisory from Google's Chrome Vulnerability Reward Program (VRP), the scheme that pays people for finding and reporting security bugs in the Chrome browser. The bug is tracked as CVE-2026-2313, a use-after-free in the CSS engine, and it is rated high severity. The bounty paid was 8,000 USD, and the report was disclosed on 2026-02-10. The researchers credited are Han Zheng (HexHive), Wenhao Fang (University of St. Andrews) and Qinying Wang (HexHive).

A few words before the details. Chrome is a web browser, and inside it sits a rendering engine called Blink, which turns HTML and CSS into what you see on screen. CSS is the language that describes how a page looks: colours, spacing, layout. A use-after-free is a memory bug where a program keeps a pointer to a piece of memory after that memory has been handed back to the system, then reads or writes through the pointer anyway. Think of it like keeping a key to a hotel room after you have checked out: the room may now belong to someone else, and walking in can cause trouble for everyone.

The feature involved is route matching, an experimental part of Blink that is not switched on by default. The report reaches it through a command-line flag, which is a switch you add when starting the browser to turn on features that are still being developed.

The reproduction is only three steps:

  1. open test.html with flag --enable-blink-features=RouteMatching
  2. click button
  3. UAP!

Step 1 opens the test page with the experimental route matching feature enabled. Step 2 clicks a button on that page. Step 3 is "UAP!". The report records the crash type as a tab crash: the browser tab falls over, rather than the whole browser or the operating system.

Root cause

The report points at a function called RouteMap::UpdateActiveRoutes(). A function is a named block of code that does one job; this one updates which routes are currently active. It walks two collections of routes, routes_ and anonymous_routes_, and for each entry asks the route to update its match status against the previous and next URL:

C++
void RouteMap::UpdateActiveRoutes() {
  bool changed = false;
  for (const auto& entry : routes_) {
    Route& route = *entry.value;
    changed = route.UpdateMatchStatus(previous_url_, next_url_) || changed; //<= trigger JS
  }
  for (const auto& entry : anonymous_routes_) {
    Route& route = *entry.value;
    changed = route.UpdateMatchStatus(previous_url_, next_url_) || changed;
  }
  if (changed) {
    GetDocument().GetStyleEngine().NavigationsMayHaveChanged();
  }
}

// JS trigger this snippet

      if (it == routes_.end()) {
        routes_.insert(name, route); // <= insert to container, rehash happen and invalidate all iterators
      }

Line by line, the first block declares a changed flag, then loops over routes_. For each entry it takes a reference to the route and calls UpdateMatchStatus. The comment //<= trigger JS marks the important point: this call can end up running JavaScript. The second loop does the same for anonymous_routes_. If anything changed, the function tells the style engine that navigations may have changed, so styles get recalculated.

The second block is the JavaScript-triggered snippet. It checks whether a lookup has reached the end of routes_ without finding a match, and if so inserts a new route into the container. The comment explains the consequence: the insert causes a rehash, which invalidates all iterators.

An iterator is a small object that points at a position inside a collection while you loop over it. A container is a data structure that holds many items, and a rehash is what happens when the container reorganises its internal storage, for example because it has grown and needs more room. When that happens, the old positions no longer mean anything: the iterators the loop is holding now point at memory that has been freed or moved. The loop carries on using them, and the object it reaches has already been freed. That is the use-after-free.

The summary calls it a use-after-poison in RouteMap::UpdateActiveRoutes. Poisoning is a debugging technique: when memory is freed, a tool fills it with a recognisable pattern so that any later use is caught immediately. It is the same invalidated-memory access, just described by the tool that detected it. In short, the code changes the collection it is looping over, from inside the loop, through a callback that is allowed to run arbitrary script.

Impact

The report records a tab crash, which is what the reproduction produces. A use-after-free in a renderer, the part of Chrome that processes a page, is memory corruption, and in general that can be pushed further than a crash. This report does not demonstrate anything beyond the crash and does not describe exploitability. The report does not describe exploitability beyond the crash.

In general, how this kind of bug works

A use-after-free happens when code keeps a reference to an object after the object has been freed, then reads or writes through that reference. In C++ containers, the usual trigger is invalidation: inserting into or erasing from a container can move or reallocate its internal storage, so pointers, references and iterators obtained earlier stop pointing at valid objects. If the program keeps using them, it touches freed memory.

The dangerous pattern here is re-entrancy during iteration. A loop holds an iterator into a container and calls out to code that can run script. Script is not supposed to be able to change engine-internal state mid-iteration, but any callback that can reach the page, style recalculation or a route table can do exactly that. The engine must either finish the iteration before running script, take a copy of the entries it needs, or detect that the container changed and restart.

Defences fall into a few groups: not running script while holding iterators, snapshotting the collection before iterating, using stable containers or index-based access with generation checks, and, at the platform level, partitioning the heap and using memory-safe languages for new code. Sanitizers such as AddressSanitizer and the memory tools Chrome uses turn these bugs into deterministic crashes during testing, which is how they are usually caught before release.

In general, how to test for it

Look for features where a loop over an internal collection calls into script. In a browser engine that means style, layout, DOM mutation observers, custom elements, animation frames and experimental features behind flags. In server software it means request handlers that iterate over sessions, routes or caches and invoke user callbacks.

A practical method:

  1. Identify the collection and the callback. Read the code or the feature documentation and find where iteration and script execution meet.
  2. Build a page that registers a callback which mutates the same collection the engine is iterating. For a route table, that means adding or removing routes from inside a match callback.
  3. Run it under a sanitizer build or with the relevant flag enabled, and watch for a crash in the iteration code.
  4. Vary the timing: mutate on the first entry, the last entry, and during nested callbacks, since rehashing may only happen at certain sizes.
  5. Confirm the crash is in the target function and not in unrelated code.

A positive result is a deterministic crash whose stack points at the iteration and the mutation, ideally with a sanitizer report naming the freed allocation. Common false positives are crashes caused by the test harness, by an unrelated flag combination, or by a null dereference that looks similar but is not memory corruption. Check that the crash disappears when the mutation is removed.

In general, how it is fixed

The standard fixes are to stop iterating a container that script can mutate. Engineers either collect the entries into a local vector before the loop, defer the script-triggering work until after iteration completes, or re-check the container after each callback and restart if it changed. Where the container must stay live, they switch to a structure whose iterators survive insertion, or they hold strong references so objects cannot be freed underneath the loop. Regression tests then exercise the mutation-during-iteration path under a sanitizer.

In general, hunting notes

This class hides wherever engine code calls out to script while holding internal state: event dispatch, style and layout recalculation, custom element reactions, and experimental features that are still behind flags. Flags are a strong signal, because code paths that are not yet default are less exercised and more likely to miss re-entrancy handling. So are comments in the source that mention invalidation, rehash or iterator lifetime.

To get a report accepted, show a minimal reproduction, name the exact function and the mutation that invalidates state, and include the sanitizer output. State clearly whether the result is a crash only or whether you have shown more, and do not overclaim exploitability. A clean, deterministic reproduction against a current build is what turns a crash into a bounty.

Glossary

  • Chrome VRP: Google's Vulnerability Reward Program, which pays researchers for reporting security bugs in Chrome.
  • CVE: a public identifier given to a specific security vulnerability so people can refer to it unambiguously.
  • Blink: the rendering engine inside Chrome that turns HTML and CSS into a visible page.
  • CSS: the language that describes how a web page looks.
  • Use-after-free: a memory bug where code uses memory after it has been freed.
  • Use-after-poison: the same kind of bug as seen by a debugging tool that fills freed memory with a pattern so misuse is caught.
  • Renderer: the part of a browser that processes a page.
  • Flag: a command-line switch that turns on a feature, often one still in development.
  • JavaScript: the programming language web pages use to react to user actions and change themselves.
  • Function: a named block of code that performs one job.
  • Container: a data structure that holds many items.
  • Iterator: an object that points at a position inside a container while you loop over it.
  • Rehash: the reorganisation of a container's internal storage, which invalidates earlier iterators and pointers.
  • Invalidation: the moment previously valid pointers or iterators stop pointing at valid objects.
  • Re-entrancy: a situation where code calls out to other code, such as script, which then re-enters and changes state the caller was relying on.
  • Callback: a function passed to other code, to be run later when something happens.
  • Sanitizer: a debugging tool that detects memory errors such as use-after-free at runtime.
  • AddressSanitizer: a widely used sanitizer that catches memory errors in C and C++ programs.
  • Heap: the area of memory a program uses for objects it creates while running.
  • Null dereference: using a pointer that points at nothing, which crashes but is not the same as memory corruption.
  • Regression test: a test that checks a fixed bug does not come back.
  • DOM: the browser's in-memory model of a page, which script can read and change.

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.