How to spot a side order of Rowhammer in a benign binary
Rowhammer and similar side-channel attacks aren’t caught by anti-virus, so a bunch of US boffins have set about working out how to catch their signatures.
Once considered the stuff of laboratories and spies, side-channel attacks have become increasingly practical. Rowhammer, for example, is a software-only way to flip bits in one row of RAM by rapidly writing and re-writing bits in another row. Ultimately, it lets the attacker crash a kernel process to get root access.
The trio from America’s Worcester Polytechnic Institute (WPI) in Massachusetts – Gorka Irazoqui, Thomas Eisenbarth, and Berk Sunar – have published a paper at the International Association for Cryptologic Research (IACR), presenting what they say is analogous to a virus-scan for side-channel attacks.
As they note in the paper, standard anti-virus software doesn’t detect an exploit for something like Rowhammer, because such attacks are “based on (apparently) innocent instructions.”
While it’s possible to defend a system against what they call “microarchitectural” attacks, what Irazoqui, Eisenbarth and Sunar offer is a way to scan software to spot side-channel malice before it’s distributed – for example, in app stores – “to ensure the sanity of the binaries.”
Their MASScan (Micro Architectural Static Scan) tool is based on an analysis of how various side-channel attacks work:
Cache attacks – work by creating cache contention.
The common feature of these attacks is that they need high-resolution timers; they use memory barriers to serialise targeted reads; and they implement cache eviction, for example using shared memory flush instructions.
DRAM access attacks – in which the attacker collides with system memory.
These attacks share the timer, memory barrier and cache eviction features as cache attacks.
Rowhammer attacks – whose only distinguishing feature is cache evictions.
Covert channels created by blocking the memory bus – a combination of high-resolution timers and lock instructions, designed to “stall the memory bus to establish a covert channel between two co-resident processes.”
The point of MASScan is to analyse binaries to spot these characteristics, which the boffins say get past today’s virus scanners. MASScan is a set of scripts for the IDA Pro disassembler/debugger, which they say can be translated for use in other binary analysers.
For example, the cflush instruction isn’t in itself malicious, so what MASScan looks for is cflush executed from within a loop, which cache attacks, DRAM access attacks, and Rowhammer attacks all exploit. ®
Bootnote: It’s perhaps regrettable that apart from capitalisation, MASScan is also the name of the notorious Masscan port scanner by Robert Graham of Errata Security. Hopefully when the WPI group release their code, they’ll revise the name to avoid that collision.
Sponsored: Next gen cybersecurity.
Visit The Register’s security hub