AMD Zenbleed chip bug leaks secrets fast and easy
(2023/07/24)
- Reference: 1690231288
- News link: https://www.theregister.co.uk/2023/07/24/amd_zenbleed_bug/
- Source link:
AMD has started issuing some patches for its processors affected by a serious silicon-level bug dubbed Zenbleed that can be exploited by rogue users and malware to steal passwords, cryptographic keys, and other secrets from software running on a vulnerable system.
Zenbleed affects Ryzen and Epyc Zen 2 chips, and can be abused to swipe information at a rate of at least 30Kb per core per second. That's practical enough for someone on a shared server, such as a cloud-hosted box, to spy on other tenants. Exploiting Zenbleed involves abusing speculative execution, though unlike the related [1]Spectre family of design flaws, the bug is pretty easy to exploit. It is more on a par with [2]Meltdown .
Malware already running on a system, or a rogue logged-in user, can exploit Zenbleed without any special privileges and inspect data as it is being processed by applications and the operating system, which can include sensitive secrets, such as passwords. It's understood a malicious webpage, running some carefully crafted JavaScript, could quietly exploit Zenbleed on a personal computer to snoop on this information.
[3]
The vulnerability was highlighted today by Google infosec guru Tavis Ormandy, who discovered the data-leaking vulnerability while fuzzing hardware for flaws, and reported it to AMD in May. Ormandy, who acknowledged some of his colleagues for their help in investigating the security hole, said AMD intends to address the flaw with microcode upgrades, and [4]urged users to "please update" their vulnerable machines as soon as they are able to.
[5]
[6]
Proof-of-concept exploit code, produced by Ormandy, is available [7]here , and we've confirmed it works on a Zen 2 Epyc server system when running on the bare metal. While the exploit runs, it shows off all the sensitive data being processed by the box. If you stick any emulation layer in between, such as Qemu, then the exploit understandably fails.
What's hit?
The bug affects all AMD Zen 2 processors including the following series: Ryzen 3000; Ryzen Pro 3000; Ryzen Threadripper 3000; Ryzen 4000 Pro; Ryzen 4000, 5000, and 7020 with Radeon Graphics; and Epyc Rome datacenter processors.
AMD today issued a security advisory [8]here , using the identifiers AMD-SB-7008 and CVE-2023-20593 to track the vulnerability. The chip giant scored the flaw as a medium severity one, describing it as a "cross-process information leak."
A microcode patch for Epyc 7002 processors is available now. As for the rest of its affected silicon: AMD is targeting December 2023 for updates for desktop systems (eg, Ryzen 3000 and Ryzen 4000 with Radeon); October for high-end desktops (eg, Threadripper 3000); November and December for workstations (eg, Threadripper Pro 3000); and November to December for mobile (laptop-grade) Ryzens. Shared systems are the priority, it would seem, which makes sense given the nature of the design blunder.
[9]
Ormandy noted at least some microcode updates from AMD are [10]making their way into the Linux kernel. OpenBSD has some details [11]here . Our advice is to keep an eye out for AMD's Zenbleed microcode updates, and for any security updates for your operating system, and apply them as necessary when available. There's no word yet on whether there will be a performance hit from installing these but we can imagine it'll mostly depend on your workloads.
There is a workaround in the meantime, which Ormandy set out in [12]his write-up of the bug ( [13]archived copy as his site was being pummeled with traffic earlier). This involves setting a control bit that disables some functionality that prevents exploitation. We imagine this dials back some of the speculative execution required to exploit Zenbleed, and this may cause some kind of performance hit.
[14]Linux kernel logic allowed Spectre attack on 'major cloud provider'
[15]Do you want speed or security as expected? Spectre CPU defenses can cripple performance on Linux in tests
[16]Older AMD, Intel chips vulnerable to data-leaking 'Retbleed' Spectre variant
[17]Google half-patches Cloud Build permissions exploit, the rest is on you
How does the bug work?
For the full technical details, see the above write-up. But we'll summarize it here; understanding of how CPU cores work at the machine-code level is useful here.
As a modern x86 processor family, AMD's Zen 2 chips offer vector registers, a bunch of long registers for performing operations. These vector registers are used by applications and operating systems to do all kinds of things, such as doing math operations and processing strings. As such these registers have all sorts of data flying through them, including passwords and keys.
There is an instruction called vzeroupper[18]AMD PDF , page 860] that zeroes some of these vector registers, and it's used in OS and application library routines that are invoked hundreds or thousands of times a second by all processor cores in a box. For example, the strlen() function uses vzeroupper , and that's called quite a lot.
Zenbleed affects Ryzen and Epyc Zen 2 chips, and can be abused to swipe information at a rate of at least 30Kb per core per second. That's practical enough for someone on a shared server, such as a cloud-hosted box, to spy on other tenants. Exploiting Zenbleed involves abusing speculative execution, though unlike the related [1]Spectre family of design flaws, the bug is pretty easy to exploit. It is more on a par with [2]Meltdown .
Malware already running on a system, or a rogue logged-in user, can exploit Zenbleed without any special privileges and inspect data as it is being processed by applications and the operating system, which can include sensitive secrets, such as passwords. It's understood a malicious webpage, running some carefully crafted JavaScript, could quietly exploit Zenbleed on a personal computer to snoop on this information.
[3]
The vulnerability was highlighted today by Google infosec guru Tavis Ormandy, who discovered the data-leaking vulnerability while fuzzing hardware for flaws, and reported it to AMD in May. Ormandy, who acknowledged some of his colleagues for their help in investigating the security hole, said AMD intends to address the flaw with microcode upgrades, and [4]urged users to "please update" their vulnerable machines as soon as they are able to.
[5]
[6]
Proof-of-concept exploit code, produced by Ormandy, is available [7]here , and we've confirmed it works on a Zen 2 Epyc server system when running on the bare metal. While the exploit runs, it shows off all the sensitive data being processed by the box. If you stick any emulation layer in between, such as Qemu, then the exploit understandably fails.
What's hit?
The bug affects all AMD Zen 2 processors including the following series: Ryzen 3000; Ryzen Pro 3000; Ryzen Threadripper 3000; Ryzen 4000 Pro; Ryzen 4000, 5000, and 7020 with Radeon Graphics; and Epyc Rome datacenter processors.
AMD today issued a security advisory [8]here , using the identifiers AMD-SB-7008 and CVE-2023-20593 to track the vulnerability. The chip giant scored the flaw as a medium severity one, describing it as a "cross-process information leak."
A microcode patch for Epyc 7002 processors is available now. As for the rest of its affected silicon: AMD is targeting December 2023 for updates for desktop systems (eg, Ryzen 3000 and Ryzen 4000 with Radeon); October for high-end desktops (eg, Threadripper 3000); November and December for workstations (eg, Threadripper Pro 3000); and November to December for mobile (laptop-grade) Ryzens. Shared systems are the priority, it would seem, which makes sense given the nature of the design blunder.
[9]
Ormandy noted at least some microcode updates from AMD are [10]making their way into the Linux kernel. OpenBSD has some details [11]here . Our advice is to keep an eye out for AMD's Zenbleed microcode updates, and for any security updates for your operating system, and apply them as necessary when available. There's no word yet on whether there will be a performance hit from installing these but we can imagine it'll mostly depend on your workloads.
There is a workaround in the meantime, which Ormandy set out in [12]his write-up of the bug ( [13]archived copy as his site was being pummeled with traffic earlier). This involves setting a control bit that disables some functionality that prevents exploitation. We imagine this dials back some of the speculative execution required to exploit Zenbleed, and this may cause some kind of performance hit.
[14]Linux kernel logic allowed Spectre attack on 'major cloud provider'
[15]Do you want speed or security as expected? Spectre CPU defenses can cripple performance on Linux in tests
[16]Older AMD, Intel chips vulnerable to data-leaking 'Retbleed' Spectre variant
[17]Google half-patches Cloud Build permissions exploit, the rest is on you
How does the bug work?
For the full technical details, see the above write-up. But we'll summarize it here; understanding of how CPU cores work at the machine-code level is useful here.
As a modern x86 processor family, AMD's Zen 2 chips offer vector registers, a bunch of long registers for performing operations. These vector registers are used by applications and operating systems to do all kinds of things, such as doing math operations and processing strings. As such these registers have all sorts of data flying through them, including passwords and keys.
There is an instruction called vzeroupper
Seems you can have fast or (maybe) secure, not both.
Oh well, I guess it is Intel's turn to laugh.