Skip to content
Memory corruption Write-up Advanced

**Zero Day Vulnerability: Chromium v8 js engine issue 1303458 — Use After Free in x64 Instruction Optimization Vulnerability Analysis**

A use-after-free vulnerability in Chromium's V8 JavaScript engine on x64 platforms occurs when the instruction selector incorrectly optimises a comparison against zero, causing the engine to access a typed array's memory after it has been garbage-collected. An attacker could exploit this to execute arbitrary code in the context of the browser.

Numen Cyber Labs Follow

Published on infosecwriteups.com

UAF vulnerability has been discovered in the instruction optimization on x64 platform in Chromium v8. Successful exploitation of this vulnerability could allow an attacker to execute arbitrary code in the context of the browser.

Numen Cyber Labs, on infosecwriteups.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 instruction selector's CanCoverForCompareZero function incorrectly assumed that a comparison node could always be covered without registers, leading to a compare instruction that re-reads a typed array's backing store after it has been garbage-collected.

Impact

The vulnerability could allow an attacker to execute arbitrary code in the context of the browser, potentially leading to full system compromise.

What the attacker needed

Victim visits a malicious webpage; browser runs on x64 platform

The fix

The fix removed the CanCoverForCompareZero function and restored the use of CanCover, ensuring the comparison result is stored before branching.

How it was found

  1. Create a typed array of size 0x10000.
  2. Compare the first element to zero and store the boolean result.
  3. Trigger garbage collection inside a loop.
  4. Use the stored boolean in an if statement, causing the crash.

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.

This is a bug in how a web browser's JavaScript engine turns code into machine instructions. When the engine tried to make a comparison faster, it accidentally read memory that had already been freed, which can crash the browser or let an attacker run their own code.

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.