A new set of security vulnerabilities affecting all major operating systems (Windows, macOS, Linux, and FreeBSD) has been discovered. The vulnerabilities, known as Thunderclap, could allow attackers to bypass protection mechanisms meant to guard against DMA (Direct Memory Access) attacks.
The discovery was made public during the Network and Distributed Systems Security Symposium in San Diego. The research is described as a “joint work with Colin Rothwell, Brett Gutstein, Allison Pearce, Peter Neumann, Simon Moore and Robert Watson”. According to the report:
Direct Memory Access (DMA) attacks have been known for many years: DMA-enabled I/O peripherals have complete access to the state of a computer and can fully compromise it including reading and writing all of system memory. With the popularity of Thunderbolt 3 over USB Type-C and smart internal devices, opportunities for these attacks to be performed casually with only seconds of physical access to a computer have greatly broadened.
In other words, such attacks enable hackers to compromise a system by simply plugging a malicious hot plug device which could be an external network card, mouse, keyboard, printer, storage, and graphics card, into Thunderbolt 3 port or the latest USB-C port.
Technical Overview of the Thunderclap Vulnerabilities
Thunderclap affects the way Thunderbolt-based peripherals are allowed to connect and interact with the afore-mentioned operating systems. This would eventually allow a malicious device to steal data directly from the operating system’s memory, such as highly sensitive information.
It’s noteworthy that the team of researchers (from the University of Cambridge, Rice University, and SRI International) disclosed these security flaws in 2016. It took three years in silent work with hardware and OS versions to try and fix the issues. Unfortunately, OS vendors haven’t reacted adequately enough to the discovery, and most of the attacks based on Thunderclap are still valid and exploitable.
It turns out that hardware and OS vendors are widely aware of the threats presented by these vulnerabilities, and employ an Input-Output Memory Management Unit (IOMMU) to limit access by DMA-enabled peripherals to system memory. MacOS, Linux, and FreeBSD, for example, can be configured to open up only limited portions of kernel memory to DMA, in order to prevent malicious device, the report highlights.
How protected are the affected operating systems at the moment?
Microsoft have enabled support for the IOMMU for Thunderbolt devices in Windows 10 version 1803, which shipped in 2018, the report says. Earlier hardware upgraded to 1803 needs a firmware vendor update. Despite these efforts, the more complex vulnerabilities the researchers describe remain relevant.
In macOS 10.12.4 and later, Apple addressed the specific network card vulnerability the researchers utilized to achieve a root shell. Nonetheless, Thunderbolt devices still have access to all network traffic and sometimes keystrokes and framebuffer data.
What about Linux? Intel released patches to version 5.0 of the Linux kernel (shortly to be released) that enable the IOMMU for Thunderbolt and prevent the protection-bypass vulnerability that uses the ATS feature of PCI Express.
As for FreeBSD, the project “indicated that malicious peripheral devices are not currently within their threat model for security response. However, FreeBSD does not currently support Thunderbolt hotplugging”.
The researchers also released proof-of-concept Thunderclap code on GitHub.
Further measures needed
Unfortunately, isolating device memory, as implemented by macOS in 2012 and now Windows 10 1803 is far from enough to mitigate the Thunderclap issues. Malicious devices can mold themselves to target vulnerable interfaces, choosing the weakest software to attack, among other things.
“It is not sufficient to simply enable basic IOMMU protections in the PCIe bus framework and consider the job finished. Our findings show there is no defense in depth: the layers beyond, such as communication stacks and memory allocators, are not hardened against malicious devices,” the researchers warned.
Fortunately, co-operation with OS vendors has led to an improvement in IOMMU (Input-Output Memory Management Unit) security and vulnerability mitigation through currently deployed software updates. For full technical disclosure, refer to the researchers’ detailed report.