Security

Wanna break Microsoft's Edge browser? Google's explained how

JavaScript just-in-time compilation and some memory meddling make a mess


Back in February 2018, Google's Project Zero went public with a Microsoft Edge bug that Redmond couldn't fix in time for its next patch release. Now, the Google researcher - Ivan Fratric - has provided a detailed technical explanation of the problem and says Microsoft's fix might not be adequate.

Fratric discovered that an interaction between just-in-time JavaScript compilation, Edge’s Chakra JavaScript engine, and Arbitrary Code Guard that gave attackers an arbitrary code execution vector.

Arbitrary Code Guard (ACG) is designed to prevent code being dynamically modified, and had its most recent enhancements in March 2017.

Google reveals Edge bug that Microsoft has had trouble fixing

READ MORE

Fratric explained the problem in this post last Thursday: “When ACG is applied to a Microsoft Edge Content Process, it makes it impossible to allocate new executable memory within a process or modify existing executable memory. The goal of this is to make it more difficult for an attacker who already gained some capabilities in the browser’s Content Process to execute arbitrary code.”

This white paper (PDF) explains Fratric’s attack in more detail: his attack vector related to how JavaScript just-in-time (JIT) compilation works when ACG is present.

Because JIT is incompatible with ACG, instead of running JIT as part of the Edge Content Process, Microsoft pulled the JIT Engine into its own process.

If the Chakra JavaScript engine encounters a function that needs JIT compilation, it passes the bytecode to the JIT Server, which “compiles the bytecode and writes the resulting executable code back into the calling process using shared memory.”

That, the white paper explained, lets the Content Process execute the JIT code “without violating the dynamic code policy.”

The other key to the attack surface is the Control Flow Guard (CFG), designed to protect against memory corruption vulnerabilities. The Fratric paper notes that one vector here is that “returns aren’t protected, so overwriting a return address is all that’s needed for a successful bypass. Normally, in order to be able to overwrite a return address on the stack, an attacker first needs to know where stack is. Chakra bytecode removes this requirement by including opcodes that can be used to read & write to the stack”.

There’s a full walk-through of various memory mappings and process interactions before we get to the attack scenario set out in the white paper:

As is so often the case, the fix wasn't as hard as Microsoft feared: Redmond just had to remove the VirtualAllocEx() call.

There’s a proof-of-concept here, and its only assumption was that “an attacker already managed to get a memory read/write primitive in the Content Process through an unrelated vulnerability.” ®

Send us news
35 Comments

Google will delete data collected from 'private' browsing

Declares victory in settlement of class action lawsuit, but individual claims remain possible

Google One VPN axed for everyone but Pixel loyalists ... for now

Another one bytes the dust

Google sues app devs, claims they're Play Store crypto scammers with 100k+ victims

The pair allegedly made 87 apps since 2019 and defrauded folks of tens of thousands of dollars

Google joins the custom server CPU crowd with Arm-based Axion chips

Neoverse V2 cores available in GCP later this year

Google bakes new cookie strategy that will leave crooks with a bad taste

Device Bound Session Credentials said to render cookie theft useless

Google ponders making AI search a premium option

Ad-free search experience might not be on the cards

Microsoft's playdate in Google's Privacy Sandbox gets messy

Targeted ads in Edge may be blocked before they even arrive

AI spam is winning the battle against search engine quality

'Not all AI content is spam, but I think right now all spam is AI content'

Google plunks down $1 billion for extra Japan-US submarine cable

Adds Hawaii stopover for another planned link

Next Vision, or Vision Next? What we really thought about Google and Intel's AI events

We sat through these conferences so you didn't have to

Chrome Enterprise Premium promises extra security – for a fee

Paying for browsers is no longer a memory from the 1990s

Google is wrong to put AI search features behind paywall, says HPC leader

'A huge amount of responsibility to ensure that there is ethical management'