A team of cybersecurity researchers yesterday revealed details of a new side-channel attack on dynamic random-access memory (DRAM) that could allow malicious programs installed on a modern system to read sensitive memory data from other processes running on the same hardware.
Dubbed RAMBleed and identified as CVE-2019-0174, the new attack is based on a well-known class of DRAM side channel attack called Rowhammer, various variants [GLitch, RAMpage, Throwhammer, Nethammer, Drammer] of which have been demonstrated by researchers in recent years.
Known since 2012, Rowhammer bug is a hardware reliability issue that was found in the new generation of DRAM chips.
It turned out that repeatedly and rapidly accessing (hammering) a row of memory can cause bit flips in adjacent rows, i.e., changing their bit values from 0 to 1 or vice-versa.
In the following years, researchers also demonstrated successful exploits to achieve privilege escalation on the vulnerable computers by flipping (writing) bits in the victim’s memory.
Discovered by a team of researchers from the University of Michigan, Graz University of Technology and the University of Adelaide, the new RAMBleed also relies on the bit-flip mechanism; but instead of writing data in the adjacent rows, this attack allows attackers to read the information in protected memory belonging to other programs and users.
“More specifically, we show how an unprivileged attacker can exploit the data dependence between Rowhammer induced bit flips and the bits in nearby rows to deduce these bits, including values belonging to other processes and the kernel.”
“Thus, the primary contribution of this work is to show that Rowhammer is a threat to not only integrity but to confidentiality as well.”
As shown in the image, if an attacker wants to read secret data contained in the “Secret” memory cells, he has to:
- Find a flippable bit (Sampling page) at the same offset in a memory page as the secret bit.
- Manipulate the memory layout using memory massaging techniques to carefully place the victim’s secret data in the rows above and below the attacker’s memory row, the arrangement as illustrated in the image, so that the bit flips in the attacker’s rows becomes dependent on the values of the victim’s secret data.
- Hammer the rows A0 and A2 and induce bit flips on row A1 (Sampling page), whose initial value has been set to 1, influencing its value using the victim’s data in “secret” cells.
“If the bit flipped, the attacker deduces that the value of the secret bit is 0. Otherwise, the attacker deduces that the value is 1,” the researchers said in the paper. “Repeating the procedure with flippable bits at different offsets in the page allows the attacker to recover all of the bits of the victim’s secret.”
o demonstrate the read side channel technique, researchers presented an attack against OpenSSH 7.9 running on a Linux machine and successfully extracted an RSA-2048 key from the root level SSH daemon.
According to researchers, even ECC (Error Correcting Code) memory protections—which can detect and correct unwanted bit-flips and also mitigates many Rowhammer-based attacks—don’t prevent RAMBleed attack.
Though both DDR3 and DDR4 are vulnerable to RAMBleed attack, researchers advised users to mitigate the risk by upgrading their memory to DDR4 with targeted row refresh (TRR) enabled, as it’s harder to exploit.