Apple computers vulnerable to 'Thunderstrike 2' firmware worm

An improved attack on the firmware in Apple computers makes them vulnerable to hard-to-detect malware without even being connected to a network, according to a Black Hat conference presentation due to be given later this week.

The new research highlights ongoing weaknesses in the low-level software that runs on every computer before an operating system is loaded.

It comes from researchers Xeno Kovah and Corey Kallenberg of LegbaCore and Trammell Hudson of Two Sigma Investments. They showed earlier this year how they could infect a Mac's firmware with malware by connecting malicious devices to them using Thunderbolt, Apple's high-speed data transfer interface. The attack was dubbed Thunderstrike.

On Thursday, they will unveil Thunderstrike 2, an attack that improves on the former since it can spread to other machines through removable peripherals.

Their attack uses several vulnerabilities in firmware used by Apple. The company patched some of the flaws in June, but some remain, Hudson wrote on his blog.

In theory, firmware shouldn't be able to be modified or rewritten. Malware that sits within firmware is particularly dangerous since security products don't check the integrity of firmware, meaning users would have no idea it has been tampered with.

The Thunderstrike 2 attack uses a local root privilege exploit that loads a kernel module and gives it access to raw memory, according to a two-minute preview video posted by the researchers on YouTube.

In some cases, the attack code can immediately unlock and rewrite the boot flash firmware. In other instances it can take advantage of a problem when a computer is put into sleep mode and then resume running, a problem that has been explored by another researcher.

The malware can write itself to the Option ROMs of removable Thunderbolt peripherals. If an infected peripheral is inserted into another Mac, the Option ROM is executed before the OS's kernel launches.

It can't tamper with the firmware just yet, though. It has to wait for the computer to go to sleep and wake up again. After that happens, the boot flash isn't protected anymore, and Thunderstrike 2 can write itself to the firmware.

"Once installed in the boot flash, it is very difficult to remove since it controls the system from the very first instruction executed upon booting," the video says. "This includes the keys for updating the firmware."

Reinstalling the OS won't remove the malware and neither will replacing the hard drive.

The attack could be used to reach computers that have been intentionally isolated for security reasons. For example, a Mac could be infected using a Web-based attack. Then, Thunderstrike 2's code could infect a Thunderbolt peripheral. If that device is then inserted into an air-gapped machine, it's infected.