GHSL-2024-095: Type confusion leading to RCE in the Chrome renderer sandbox - CVE-2024-5830
A type confusion in V8's TryFastAddDataProperty allows a malicious accessor to cause a deprecated map to become a dictionary map, leading to a type confusion between PropertyArray and NameDictionary. This can be exploited to gain RCE in the Chrome renderer sandbox.
Type confusion between fast and dictionary objects in TryFastAddDataProperty in v8
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
TryFastAddDataProperty assumes the transition map remains a fast map, but updating a deprecated map can turn it into a dictionary map, causing a type confusion when writing the property.
What the attacker needed
Victim visits a malicious webpage; Chrome version M125 or earlier
The fix
The issue was fixed in Chrome version 126.0.6478.56/57.
How it was found
- Create an object x with a property a0 and a getter for prop that triggers map deprecation.
- Create another object x1 with a0 and prop to establish a transition map.
- Clone x using spread syntax, which calls the accessor before CreateDataProperty.
- The accessor deprecates the map, and TryFastAddDataProperty uses the deprecated map.
- PrepareForDataProperty updates the map to a dictionary map, but WriteToField still treats it as fast.
- This causes type confusion between PropertyArray and NameDictionary, leading to OOB access.
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 JavaScript objects are copied, the engine tries to optimise by reusing internal layouts. A malicious getter can change an object's layout mid-copy, causing the engine to treat one kind of internal storage as another. This confusion can be abused to corrupt memory and run arbitrary code inside Chrome's renderer process.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.