HOME

TheInfoList



OR:

A DMA attack is a type of side channel attack in
computer security Computer security (also cybersecurity, digital security, or information technology (IT) security) is a subdiscipline within the field of information security. It consists of the protection of computer software, systems and computer network, n ...
, in which an attacker can penetrate a computer or other device, by exploiting the presence of high-speed expansion ports that permit
direct memory access Direct memory access (DMA) is a feature of computer systems that allows certain hardware subsystems to access main system computer memory, memory independently of the central processing unit (CPU). Without DMA, when the CPU is using programmed i ...
(DMA). DMA is included in a number of connections, because it allows a connected device (such as a
camcorder A camcorder is a self-contained portable electronic device with video and recording as its primary function. It is typically equipped with an articulating screen mounted on the left side, a belt to facilitate holding on the right side, hot-sw ...
,
network card A network interface controller (NIC, also known as a network interface card, network adapter, LAN adapter and physical network interface) is a computer hardware component that connects a computer to a computer network. Early network interface ...
, storage device or other useful accessory or internal
PC card PC Card is a technical standard specifying an expansion card interface for laptops and personal digital assistants, PDAs. The PCMCIA originally introduced the 16-bit Industry Standard Architecture, ISA-based PCMCIA Card in 1990, but renamed it to ...
) to transfer
data Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
between itself and the computer at the maximum speed possible, by using direct hardware access to read or write directly to
main memory Computer data storage or digital data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers. The central processin ...
without any
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
supervision or interaction. The legitimate uses of such devices have led to wide adoption of DMA accessories and connections, but an attacker can equally use the same facility to create an accessory that will connect using the same port, and can then potentially gain direct access to part or all of the physical memory address space of the computer, bypassing all OS security mechanisms and any lock screen, to read all that the computer is doing, steal data or
cryptographic key A key in cryptography is a piece of information, usually a string of numbers or letters that are stored in a file, which, when processed through a cryptographic algorithm In mathematics and computer science, an algorithm () is a finite sequenc ...
s, install or run
spyware Spyware (a portmanteau for spying software) is any malware that aims to gather information about a person or organization and send it to another entity in a way that harms the user by violating their privacy, endangering their device's securit ...
and other exploits, or modify the system to allow backdoors or other malware. Preventing physical connections to such ports will prevent DMA attacks. On many computers, the connections implementing DMA can also be disabled within the
BIOS In computing, BIOS (, ; Basic Input/Output System, also known as the System BIOS, ROM BIOS, BIOS ROM or PC BIOS) is a type of firmware used to provide runtime services for operating systems and programs and to perform hardware initialization d ...
or
UEFI Unified Extensible Firmware Interface (UEFI, as an acronym) is a Specification (technical standard), specification for the firmware Software architecture, architecture of a computing platform. When a computer booting, is powered on, the UEFI ...
if unused, which depending on the device can nullify or reduce the potential for this type of exploit. Examples of connections that may allow DMA in some exploitable form include
FireWire IEEE 1394 is an interface standard for a serial bus for high-speed communications and isochronous real-time data transfer. It was developed in the late 1980s and early 1990s by Apple in cooperation with a number of companies, primarily Sony a ...
, CardBus,
ExpressCard ExpressCard, initially called NEWCARD, is an interface to connect peripheral, peripheral devices to a computer, usually a laptop, laptop computer. The ExpressCard technical standard specifies the design of slots built into the computer and of expa ...
, Thunderbolt, USB 4.0, PCI,
PCI-X PCI-X, short for Peripheral Component Interconnect eXtended, is a computer bus and expansion card standard that enhances the 32-bit Conventional PCI, PCI local bus for higher Bandwidth (computing), bandwidth demanded mostly by Server (computing ...
, and
PCI Express PCI Express (Peripheral Component Interconnect Express), officially abbreviated as PCIe, is a high-speed standard used to connect hardware components inside computers. It is designed to replace older expansion bus standards such as Peripher ...
.


Description

In modern
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s, non-system (i.e. user-mode) applications are prevented from accessing any memory locations not explicitly authorized by the virtual memory controller (called
memory management unit A memory management unit (MMU), sometimes called paged memory management unit (PMMU), is a computer hardware unit that examines all references to computer memory, memory, and translates the memory addresses being referenced, known as virtual mem ...
(MMU)). In addition to containing damage that may be caused by software flaws and allowing more efficient use of physical memory, this architecture forms an integral part of the security of the operating system. However, kernel-mode drivers, many hardware devices, and user-mode vulnerabilities allow direct, unimpeded access of the physical memory address space. The physical address space includes all of the main system memory, as well as memory-mapped buses and hardware devices (which are controlled by the operating system through reads and writes as if they were ordinary RAM). The OHCI 1394 specification allows devices, for performance reasons, to bypass the operating system and access physical memory directly without any security restrictions. But SBP2 devices can easily be spoofed, making it possible to trick an operating system into allowing an attacker to both read and write physical memory, and thereby to gain unauthorised access to sensitive cryptographic material in memory. Systems may still be vulnerable to a DMA attack by an external device if they have a
FireWire IEEE 1394 is an interface standard for a serial bus for high-speed communications and isochronous real-time data transfer. It was developed in the late 1980s and early 1990s by Apple in cooperation with a number of companies, primarily Sony a ...
,
ExpressCard ExpressCard, initially called NEWCARD, is an interface to connect peripheral, peripheral devices to a computer, usually a laptop, laptop computer. The ExpressCard technical standard specifies the design of slots built into the computer and of expa ...
, Thunderbolt or other expansion port that, like PCI and
PCI Express PCI Express (Peripheral Component Interconnect Express), officially abbreviated as PCIe, is a high-speed standard used to connect hardware components inside computers. It is designed to replace older expansion bus standards such as Peripher ...
in general, connects attached devices directly to the physical rather than
virtual memory In computing, virtual memory, or virtual storage, is a memory management technique that provides an "idealized abstraction of the storage resources that are actually available on a given machine" which "creates the illusion to users of a ver ...
address space. Therefore, systems that do not have a FireWire port may still be vulnerable if they have a PCMCIA/ CardBus/
PC Card PC Card is a technical standard specifying an expansion card interface for laptops and personal digital assistants, PDAs. The PCMCIA originally introduced the 16-bit Industry Standard Architecture, ISA-based PCMCIA Card in 1990, but renamed it to ...
or ExpressCard port that would allow an expansion card with a FireWire to be installed.


Uses

An attacker could, for example, use a social engineering attack and send a "lucky winner" a rogue Thunderbolt device. Upon connecting to a computer, the device, through its direct and unimpeded access to the physical address space, would be able to bypass almost all security measures of the OS and have the ability to read encryption keys, install malware, or control other system devices. The attack can also easily be executed where the attacker has physical access to the target computer. In addition to the abovementioned nefarious uses, there are some beneficial uses too as the DMA features can be used for kernel
debugging In engineering, debugging is the process of finding the Root cause analysis, root cause, workarounds, and possible fixes for bug (engineering), bugs. For software, debugging tactics can involve interactive debugging, control flow analysis, Logf ...
purposes. There is a tool called Inception for this attack, only requiring a machine with an expansion port susceptible to this attack. Another application known to exploit this vulnerability to gain unauthorized access to running Windows, Mac OS and Linux computers is the spyware FinFireWire.


Mitigations

DMA attacks can be prevented by
physical security Physical security describes security measures that are designed to deny unauthorized access to facilities, equipment, and resources and to protect personnel and property from damage or harm (such as espionage, theft, or terrorist attacks). Physi ...
against potentially malicious devices. Kernel-mode drivers have many powers to compromise the security of a system, and care must be taken to load trusted, bug-free drivers. For example, recent 64-bit versions of Microsoft Windows require drivers to be tested and digitally signed by Microsoft, and prevent any non-signed drivers from being installed. An IOMMU is a technology that applies the concept of virtual memory to such system busses, and can be used to close this security vulnerability (as well as increase system stability). Intel brands its IOMMU as VT-d. AMD brands its IOMMU as AMD-Vi. Linux and Windows 10 supports these IOMMUs and can use them to block I/O transactions that have not been allowed. As of 2012, Apple MacOS also supports using IOMMUs to thwart DMA attacks. Newer operating systems may take steps to prevent DMA attacks. Recent
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
kernels include the option to disable DMA by FireWire devices while allowing other functions.
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
8.1 can prevent access to DMA ports of an unattended machine if the console is locked. But as of 2019, the major OS vendors had not taken into account the variety of ways that a malicious device could take advantage of complex interactions between multiple emulated peripherals, exposing subtle bugs and vulnerabilities. Never allowing sensitive data to be stored in RAM unencrypted is another mitigation venue against DMA attacks. However, protection against reading the RAM's content is not enough, as writing to RAM via DMA may compromise seemingly secure storage outside of RAM by
code injection Code injection is a computer security exploit where a program fails to correctly process external data, such as user input, causing it to interpret the data as executable commands. An attacker using this method "injects" code into the program whi ...
. An example of the latter kind of attack is TRESOR-HUNT, which exposes cryptographic keys that are never stored in RAM (but only in certain CPU registers); TRESOR-HUNT achieves this by overwriting parts of the operating system. Microsoft recommends changes to the default Windows configuration to prevent this if it is a concern.


See also

* FireWire security issue *
Cold boot attack In computer security, a cold boot attack (or to a lesser extent, a platform reset attack) is a type of side channel attack in which an attacker with physical access to a computer performs a memory dump of a computer's random-access memory (RAM) ...
* Pin control attack


References

{{reflist


External links


0wned by an iPod - hacking by Firewire
presentation by Maximillian Dornseif from the PacSec/core04 conference, Japan, 2004
Physical memory attacks via Firewire/DMA - Part 1: Overview and Mitigation (Update)
Side-channel attacks