That Unpatchable USB Malware Now Has a Patch ... Sort Of

When security researchers Adam Caudill and Brandon Wilson publicly released attack code two weeks ago that takes advantage of an insidious vulnerability in USB devices, they argued that publishing their exploits would get the problems fixed faster. Now they’ve released a partial fix themselves—albeit one that’s so messy it includes coating your USB thumb drive […]
usbepoxyinline
Adam Caudill putting epoxy in a USB drive to prevent physical tampering.courtesy Adam Caudill

When security researchers Adam Caudill and Brandon Wilson publicly released attack code two weeks ago that takes advantage of an insidious vulnerability in USB devices, they argued that publishing their exploits would get the problems fixed faster. Now they've released a partial fix themselves---albeit one that's so messy it includes coating your USB thumb drive in epoxy.

Over the weekend, the two hackers released a software patch for USB thumb drives meant to demonstrate one method of addressing a fundamental vulnerability: the security issue known as BadUSB. Brought to light at the Black Hat security conference last August by researchers Karsten Nohl and Jakob Lell, BadUSB makes it possible to invisibly alter the firmware in controller chips that oversee the tiny devices' most basic functions. That means a hacker can hide tough-to-detect instructions in a memory stick to make it impersonate a keyboard and type malicious commands into a victim's computer, or corrupt files with malware as they're copied from the thumb drive to a PC, among other nasty tricks.

Rather than try to prevent any of those specific attacks, Caudill and Wilson's fix is meant to prevent firmware changes altogether. Their patch code, which they've released on Github, does this by disabling "boot mode" on a USB device, the state in which its firmware is meant to be reprogrammed. Without boot mode, Caudill says it would become far harder to pull off any BadUSB attack, and would virtually eliminate the threat of malware that spreads from USB stick to PC and vice versa. "By making that change, you can drastically change the risk associated with this," says Caudill. "It makes any type of self-replicating, worm-type malware very, very difficult to use."

Caudill and Wilson's firmware patch is far from universal: it only works for one version of USB code, the latest USB 3.0 firmware distributed by the Taiwanese firm Phison, the world's top manufacturer of USB controller chips. That's the same USB maker whose code Nohl reverse-engineered for his presentation in August, and that Caudill and Wilson targeted with the demonstration exploit code they released last month at the Derbycon hacker conference. They're working now to extend the fix to all Phison USB firmware.

And, in fact, that's not the only limitation. Their software patch alone doesn't even completely cover Phison chips from reprogramming. With boot mode disabled, Caudill says an attacker can still alter a USB stick's firmware if he or she has physical access to a thumb drive, using a technique called "pin shorting." That method involves plugging the drive into a computer while placing a piece of conductive metal across two or three of the pins that connect the controller chip to the USB stick's circuit board. That finicky method acts as a sort of "hard reset" that allows the firmware to be reprogrammed.

To prevent that physical tampering, Caudill suggests that the most security-conscious users should paint a layer of epoxy on both the inner walls of a thumb drive's case with a thick brush to prevent its being opened up without their knowledge. He suggests Gorilla brand epoxy, and says he's experimented with using a medical syringe to coat the inside of his own drives. "Just coat the entire device in a thick hard material that’s nearly impossible to get off without destroying the drive in the process," he says. "If you want to hand a USB drive to a stranger and know you can trust it later, this is what it's come to."

Caudill admits that for now, he doesn't expect his and Wilson's patch to be a practical fix so much as a proof-of-concept, merely demonstrating one way to alleviate the risk from BadUSB. Only a tiny fraction of users, after all, would have the knowhow to implement firmware changes they've taken as raw code from Github---not to mention the paranoia required to coat their favorite memory stick in industrial glue.

Berlin-based researcher Karsten Nohl, who first put the fundamental insecurity of USB firmware into the spotlight, dismissed the new patch as an impractical band-aid. He points out that while boot mode is the manufacturer's intended way of altering a USB drive's firmware, bugs in that firmware would likely allow hackers to find other ways of altering it. Given how little attention has been paid to USB firmware security, he says shutting down boot mode wouldn't present much of a challenge to a motivated hacker. "The normal, ordinary way to reprogram the firmware is what they’re removing now," says Nohl. "That just creates an incentive to find a bug...I'm sure that bugs will be plentiful."

In an interview with WIRED before his Black Hat talk in August, Nohl argued that USB makers need to instead implement code-signing, a security measure that makes it impossible to alter a device's firmware without the unforgeable cryptographic signature of the manufacturer. Until then, he argues that partial fixes like Caudill's and Wilson's aren't as effective as just trashing the vulnerable devices altogether. "In the end you’re deploying a tool to reprogram USB sticks with something that may or may not work," Nohl says. "If you’re really paranoid, why stop there? Why not throw these things away?"

But Caudill maintains that a patch that turns off boot mode could at least act as a stop-gap measure until code-signing comes into effect, a future fix that could still be years away. "Until there are signed updates, restricting boot mode is not a bad idea," says Caudill. "What we’re doing today is about experimenting, learning what can be done, and hoping the community will join in these experiments and take it further."