Skip to content
Memory corruption Write-up Advanced

CVE-2024-3832: Object corruption on wasm functions installation

The WebAssembly global object's conditional feature installation used a property-adding routine that did not check whether a property name already existed, so a duplicate key could be created. An attacker could then trigger a write into the wrong property slot, corrupting the object and producing a type confusion that leaked heap data.

docs.google.com

Published on docs.google.com

https://chromereleases.googleblog.com/2024/04/stable-channel-update-for-desktop16.html

The author, on docs.google.com

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 the feature-installation code added properties without checking for an existing key, and the lookup reload then selected the old descriptor index instead of the newly created one.

Impact

The corruption could be turned into a type confusion that reads out eight bytes from a function object, though the author notes the leak seemed useless.

What the attacker needed

Ability to run JavaScript in the browser; a build with JSPI features enabled

The fix

The text does not state a fix, but the code should check whether the property name already exists before adding it, as the setter path does.

How it was found

  1. Create a duplicate property on the WebAssembly global object by adding and deleting a property, then adding it again.
  2. Convert the object to a fast prototype so its map is optimised.
  3. Set the Suspender property to a value of a different kind, such as a number.
  4. Replace the WebAssembly global and trigger conditional feature installation.
  5. Observe the corrupted property value with the debug print.

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.

A JavaScript object stores its properties in a list, and each name is meant to appear only once. Here the browser's engine added a second entry with the same name, so later code that looked up the name could pick the wrong entry and write a value of one kind where another kind was expected. That mismatch is called a type confusion and can let an attacker read memory they should not see.

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.

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.