Security

Research

AMD SEV OMG: Trusted execution in VMs undone by bad hypervisors' cache meddling

Let's do the CacheWarp again


Boffins in Germany and Austria have found a flaw in AMD's SEV trusted execution environment that makes it less than trustworthy.

The researchers – Ruiyi Zhang, Lukas Gerlach, Daniel Weber, Lorenz Hetterich, and Michael Schwarz (all with CISPA Helmholtz Center for Information Security), Youheng Lü (independent), Andreas Kogler (Graz University of Technology) – call the vulnerability CacheWarp for its ability to create inconsistencies between cache lines and memory.

Modern CPUs support virtual memory to keep processes isolated and allow multi-tenant operations. This involves mapping virtual memory to physical memory via page tables so tenant and system processes occupying the same space can be separately managed.

Caches, temporary storage space, help reduce latency when data is moved in and out of memory. CacheWarp works by interfering with this process, using the Advanced Programmable Interrupt Controller or APIC timer to precisely interrupt context switches between guest and host processes.

A successful attack – which assumes an attacker is running a malicious hypervisor protected by AMD SEV – could allow arbitrary code execution within a guest VM, the exposure of sensitive data, or privilege escalation.

CacheWarp (CVE-2023- 20592) is a software-fault attack that targets AMD Secure Encrypted Virtualization (SEV), a CPU extension for securely separating virtual machines (VMs) from their hypervisor. It affects all versions of SEV, including SEV-ES and SEV-SNP, though exploitation is more difficult with this latter variant.

SEV is intended to guard against the possibility of a malicious hypervisor, a level of security not provided by VMs.

In a paper titled, "CacheWarp: Software-based Fault Injection using Selective State Reset," the team explains that CacheWarp is not a transient execution attack or a side-channel attack like Spectre and Meltdown. Rather, it is a software-based fault attack along the lines of Rowhammer or Plundervolt, and relies on introducing errors, specifically memory (page table) errors to achieve its ends.

"CacheWarp is based on our analysis of the invd instruction, which shows that invalidating dirty cache lines without triggering a write-back is feasible on AMD CPUs, even if AMD SEV is enabled," the team explains in the paper.

"Specifically, a malicious hypervisor can selectively drop any writes of an AMD SEV-ES and SEV-SNP guest that occurred at an attacker-chosen point. The consequence of such a drop is that the VM architecturally uses stale data."

When the VM uses stale data, its behavior can be altered. For example, an attacker could use the technique to revert a variable to a previous state that indicated the user was authenticated. Thus the attacker would become authenticated.

The researchers describe three case studies in which they extract the private key from an IPP RSA implementation, access an OpenSSH server without credentials, and gain root privileges via the sudo tool.

The boffins say that AMD was notified of their findings on April 25, 2023, and plans to issue a microcode patch for SEV-SNP and an SEV firmware update for Zen 3 EPYC Milan CPUs.

"Ultimately, CacheWarp has to be fixed on the hardware level," they state in their paper. "One solution is to prevent the invd instruction from being used if AMD SEV is enabled."

They allow a microcode update to alter the invd instruction so it behaves like the non-exploitable wbinvd instruction would suffice. And they plan to publish relevant code on GitHub.

Asked to comment, an AMD spokesperson said the biz plans to publish details on Tuesday. You can find those bulletins here and here. ®

Send us news
7 Comments

AMD slaps together a silicon sandwich with MI300-series APUs, GPUs to challenge Nvidia’s AI empire

Chips boast 1.3x lead in AI, 1.8x in HPC over Nv's H100

Dump C++ and in Rust you should trust, Five Eyes agencies urge

Memory safety vulnerabilities need to be crushed with better code

Polish train maker denies claims its software bricked rolling stock maintained by competitor

Says it was probably hacked, which isn't good news either

Weak session keys let snoops take a byte out of your Bluetooth traffic

BLUFFS spying flaw present in iPhones, ThinkPad, plenty of chipsets

AMD thinks it can solve the power/heat problem with chiplets and code

CTO Mark Papermaster lays out the plan for the next two years

Australia building 'top secret' cloud to catch up and link with US, UK intel orgs

Plans to share 'vast amounts of data' – very carefully

Atlassian security advisory reveals four fresh critical flaws – in mail with dead links

Bitbucket, Confluence and Jira all in danger, again. Sigh

Boffins devise 'universal backdoor' for image models to cause AI hallucinations

Data poisoning appears open to all

AWS previews AppFabric for productivity – pitched as AI-powered glue between apps

Park user data in Amazon's servers for ML-generated insights and actions – yea or nay for you?

Five Eyes nations warn Moscow's mates at the Star Blizzard gang have new phishing targets

The Russians are coming! Err, they've already infiltrated UK, US inboxes

Microsoft issues deadline for end of Windows 10 support – it's pay to play for security

Limited options will be available into 2028, for an undisclosed price

Open source forkers stick an OpenBao in the oven

HashiCorp software faces challenge after licensing change