On-Prem

Systems

AMD secure VM tech undone by DRAM meddling

Boffins devise BadRAM attack to pilfer secrets from SEV-SNP encrypted memory


Researchers have found that the security mechanism AMD uses to protect virtual machine memory can be bypassed with $10 of hardware – and perhaps not even that.

AMD Secure Encrypted Virtualization (SEV) is designed to provide a Trusted Execution Environment (TEE) that safeguards computation and memory, along the lines of similar TEE offerings from rival vendors like Intel's Software Guard Extensions (SGX) and Trusted Domain Extensions (TDX), and Arm's Confidential Compute Architecture (CCA).

SEV and the like are commonly used by cloud service providers to ensure that those with access to datacenter hardware cannot siphon secrets from tenant virtual machines. These technologies encrypt memory, so that users have some defense against an untrustworthy provider or snooping authorities.

Boffins from KU Leuven in Belgium, the University of Lübeck in Germany, and the University of Birmingham in the UK have taken a look at AMD SEV-SNP (Secure Nested Paging) – a recent SEV enhancement that adds protection against memory remapping attacks from a malicious hypervisor. And they've found that it's not as secure as its name suggests.

In a paper [PDF] titled "BadRAM: Practical Memory Aliasing Attacks on Trusted Execution Environments," co-authors Jesse De Meulemeester, Luca Wilke, David Oswald, Thomas Eisenbarth, Ingrid Verbauwhede, and Jo Van Bulck describe how they devised a way to bypass TEE-based memory access restrictions with a Raspberry Pi Pico, a DDR socket, and a 9V battery.

The BadRAM attack – which does require physical access to hardware (for example, a rogue admin scenario) – works by abusing the SPD (Serial Presence Detect) chip on a memory module, which identifies the module to hardware. It manipulates the SPD into creating aliases for physical memory, which subsequently can be scoured for secrets in contravention of the TEE integrity goals.

"In our attacks, we double the apparent size of the Dual Inline Memory Module (DIMM) installed in the system to trick the CPU's memory controller into using additional 'ghost' addressing bits," the authors explain. "These addressing bits will be unused within the virtually enlarged DIMM, creating an interesting aliasing effect where two different physical addresses now refer to the same DRAM location."

The technique, which applies to DDR4 and DDR5 memory, could potentially also be functional for local, software-only attackers without physical access to hardware (via SSH), because some DRAM vendors leave the SPD chip unlocked. While most vendors lock their memory modules, per the JEDEC specification, the authors report they found at least two off-the-shelf DDR4 DIMMS from Corsair "that leave the base configuration entirely unprotected, possibly exposing them to software-only BadRAM attacks."

Older memory like DDR3 that would otherwise prevent memory size meddling through permanent write protection can also be affected – by removing or swapping the SPD, it's claimed.

"BadRAM completely undermines trust in AMD's latest Secure Encrypted Virtualization (SEV-SNP) technology, which is widely deployed by major cloud providers, including Amazon AWS, Google Cloud, and Microsoft Azure," Jo Van Bulck, professor in the DistriNet lab at the Department of Computer Science of KU Leuven, told The Register in an email.

"BadRAM for the first time studies the security risks of bad RAM – rogue memory modules that deliberately provide false information to the processor during startup. We show how BadRAM attackers can fake critical remote attestation reports and insert undetectable backdoors into any SEV-protected VM."

Intel scalable SGX and TDX are not affected, because they implement countermeasures against memory aliasing. Arm CCA appears to be protected based on the specification, according to the boffins, but no hardware was available to test it. The older, discontinued classic version of SGX is said to be partially vulnerable.

The researchers write that they disclosed their SPD aliasing attack and proof of concept code to AMD on February 26, 2024. They are scheduled to present their paper at the 2025 IEEE Symposium on Security and Privacy.

AMD is tracking the vulnerability under CVE-2024-21944 and AMD-SB-3015. The Ryzen designer confirmed to The Register that it plans to issue an advisory on Tuesday, December 10, 2024.

"AMD believes exploiting the disclosed vulnerability requires an attacker either having physical access to the system, operating system kernel access on a system with unlocked memory modules, or installing a customized, malicious BIOS," the Epyc house explained in a statement.

"AMD recommends utilizing memory modules that lock Serial Presence Detect (SPD), as well as following physical system security best practices. AMD has also released firmware updates to customers to mitigate the vulnerability." ®

Send us news
10 Comments

AMD looks to undercut Nvidia, win gamers' hearts with RX 9070 series

The question is whether we can find them in stock and at MSRP

How nice that state-of-the-art LLMs reveal their reasoning ... for miscreants to exploit

Blueprints shared for jail-breaking models that expose their chain-of-thought process

Under Trump 2.0, Europe's dependence on US clouds back under the spotlight

Technologist Bert Hubert tells The Reg Microsoft Outlook is a huge source of geopolitical risk

C++ creator calls for help to defend programming language from 'serious attacks'

Bjarne Stroustrup wants standards body to respond to memory-safety push as Rust monsters lurk at the door

Yup, AMD's Elba and Giglio definitely sound like they work corporate security

Which is why Cisco is adding these Pensando DPUs to more switches

Does terrible code drive you mad? Wait until you see what it does to OpenAI's GPT-4o

Model was fine-tuned to write vulnerable software – then suggested enslaving humanity

FYI: An appeals court may kill a GNU GPL software license

Defense of FOSS licensing rests on the shoulders of a guy in Virginia

Qualcomm pledges 8 years of security updates for Android kit using its chips (YMMV)

Starting with Snapdragon 8 Elite and 'droid 15

If you thought training AI models was hard, try building enterprise apps with them

Aleph Alpha's Jonas Andrulis on the challenges of building sovereign AI

Open Source Initiative defends disallowing board candidate after timezone SNAFU

Here's another thing AI can do: Cause conflict around whether it's compatible with the very idea of open source

US Cyber Command reportedly pauses cyberattacks on Russia

PLUS: Phishing suspects used fishing gear as alibi; Apple's 'Find My' can track PCs and Androids; and more

Microsoft expands Copilot bug bounty targets, adds payouts for even moderate messes

Said bugs 'can have significant implications' – glad to hear that from Redmond