Deconstructing and Exploiting CVE-2020-6418
The V8 optimising compiler Turbofan could treat an object's type information as reliable when it was not, so a type check could be skipped. An attacker could then use a crafted JavaScript page to make the engine operate on an object of the wrong type, which is the first step towards memory corruption in the browser.
starlabs.sg
Published on starlabs.sg
As part of my internship at STAR Labs, I conducted n-day analysis of CVE-2020-6418. This vulnerability lies in the V8 engine of Google Chrome, namely its optimizing compiler Turbofan.
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, Turbofan marked an object's type information as reliable even though an earlier operation in the same optimised code could have changed it, so a needed type check was omitted.
Impact
A crafted web page could trigger the missing type check and cause memory corruption in the renderer, which may lead to code execution in the browser.
What the attacker needed
Victim visits a crafted web page; Chrome older than 80.0.3987.122
The fix
The flaw was fixed in Chrome 80.0.3987.122, where the compiler no longer treats the type information as reliable in that situation.
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.
JavaScript objects can change shape at runtime, so the engine keeps a small record of each object's current type and normally checks it before using the object. This bug meant the optimiser sometimes trusted that record when it could already be out of date, so the check was skipped and the engine could treat one kind of object as another. That mismatch is the starting point for corrupting memory inside the browser.
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.