Skip to content
RCE Write-up Advanced

From object transition to RCE in the Chrome renderer

A type confusion bug in V8's map transition handling during object cloning with spread syntax could let an attacker corrupt a dictionary object and build arbitrary read/write primitives in the V8 heap. The author then describes escaping the V8 heap sandbox via Blink API objects to reach remote code execution in the Chrome renderer with a single malicious page visit.

github.blog

Published on github.blog

Man Yue Mo·@m-y-mo

Man Yue Mo, on github.blog

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely, PrepareForDataProperty assumed the map returned by Update would always be a fast map, but a getter invoked during spread cloning could force the update to return a dictionary map, so later code treated a NameDictionary as a PropertyArray.

Impact

An attacker could achieve remote code execution in the Chrome renderer sandbox by a single visit to a malicious site, though escaping the V8 heap sandbox required additional work with Blink API objects.

What the attacker needed

Victim visits a malicious page; Chrome version before 126.0.6478.56/57

The fix

The bug was fixed in Chrome version 126.0.6478.56/57.

How it was found

  1. Create an object with a normal property and a getter property.
  2. In the getter, create another object with the same layout and assign a double to its property so the map becomes deprecated.
  3. Add many transitions to that map so it can no longer hold more transitions.
  4. Clone the first object with spread syntax, which calls the getter and makes the map update return a dictionary map.
  5. Trigger MigrateSlowToFast on the cloned object by making it a prototype and accessing a property, causing an out-of-bounds read of a fake object.
  6. Use the fake double array to obtain arbitrary read and write in the V8 heap, then escape the heap sandbox via Blink API objects.

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 write-up has not been written yet. The Original tab links to the source.

Chrome runs JavaScript in a separate, restricted process called the renderer, and V8 is the part that executes the script. V8 keeps a hidden 'map' describing each object's layout, and when an object is copied with spread syntax, a getter can run mid-copy and leave the copy with an unexpected internal layout. The researcher abused that mismatch to read and write memory, then broke out of the extra V8 heap sandbox to run code.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.