Error-correcting code (ECC) memory are vulnerable to Rowhammer attacks, according to security researchers.
A team called VUSec, the security group at Vrije University in Amsterdam, Netherlands, found that a new attack can reliably flip bits that completely bypass ECC protection.
In a blog post, researchers said that four years ago, the Rowhammer attacks came to light which exploits a flaw in the way DRAM memory chips store data. As the cells are very close together when many reads or writes access a particular memory location, a bit may flip (from 1 to 0, or from 0 to 1) in a completely different location. This is known as "hammering" and can lead to a DoS attack or even increasing privileged on a targetted device.
Until now, it was thought that ECC memory had protections against such attacks. ECC memory is a special type of memory that stores extra (redundant) information that the CPU uses to detect and repair these "bit flips".
If one bit is flipped, ECC can fix this problem. When two bits flip, a system will crash. "Only if you have three bitflips in the right places, will you be able to bypass ECC," the VUSec team said.
To research the attack, the team reverse engineered several ECC implementations as well as freezing memory chips and transplanting them ("cold boot attack"), sticking syringe needles into the sockets of memory modules to inject errors, and many other techniques besides.
The researchers showed that ECC merely slows down the Rowhammer attack and is not enough to stop it. The technique works by causing three bitflips but not two.
"The first thing we discovered was a technique to ensure that at most one particular bitflip occurs in a memory word," said researchers.
They had to make sure that all bits in the location that they attacked and the bits in the location that they wanted to attack are the same, except one.
"If the bits at the same position in the two locations are the same, no bitflip will occur. If they are different, the bit may flip," researchers said.
The trick to a successful exploit is timing. "What we found is that we can detect that a bit has been corrected by means of a timing side channel. Simply put: it will typically take measurably longer to read from a memory location where a bitflips needs to be corrected, than it takes to read from an address where no correction was needed," they said.
Researchers could try each bit in turn, until they found a word in which they could flip three bits that are vulnerable.
"he final step is then to make all three bits in the two locations different and hammer one final time, to flip all three bits in one go: mission accomplished," said researchers.
Researchers said the exploit took around 32 minutes to find exploitable bit-flips when the bit-flips are directly observable. They noted that the attack could work via an unprivileged remote shell.
"The gist is that an attacker gathers information about the ECC engine in his own secluded/controlled environment that is similar to the target system. Then, using this information, they can launch the attack."
Researchers proposed several software defences that generally incur a high memory or run-time overhead. The attack is curreny tracked as CVE-2018-18904.