Slashdot Mirror


Apple Keyboard Firmware Hack Demonstrated

Anonymouse writes with this excerpt from SemiAccurate: "Apple keyboards are vulnerable to a hack that puts keyloggers and malware directly into the device's firmware. This could be a serious problem, and now that the presentation and code (PDF) is out there, the bad guys will surely be exploiting it. The vulnerability was discovered by K. Chen, and he gave a talk on it at Black Hat this year (PDF). The concept is simple: a modern Apple keyboard has about 8K of flash memory, and 256 bytes of working RAM. For the intelligent, this is more than enough space to have a field day. ... The new firmware can do anything you want it to. Chen demonstrated code which, when you put in a password and hit return, starts playing back the last five characters typed in, LIFO. It is a rudimentary keylogger; a proof of concept more than anything else. Since there is about 1K of flash free in the keyboard itself, you can log quite a few keystrokes totally transparently."

13 of 275 comments (clear)

  1. Re:Flash memory in a keyboard? by TheRaven64 · · Score: 5, Informative

    It's a USB keyboard. That means that it communicates with the host via quite a complex protocol. A keyboard is not just a 'send a specific 8-bit signal when each button is pressed or released' device anymore. The amount of logic needed is not very large, but it's a lot more than a PS/2-style keyboard needed. The firmware could have been in ROM, but these days Flash is about as cheap as ROM and gives you the option of distributing fixes if you find bugs after the device ships.

    --
    I am TheRaven on Soylent News
  2. Re:Huh?? by Anonymous Coward · · Score: 5, Informative

    Modern peripherals have microcontrollers that are basically tiny computers all on one chip. The have program flash, data registers, and sometimes data flash or eeprom memory. They are basically small computers about a $1.00 a pop, and are generally more affordable than custom silicon for most low-speed applications (i.e. less than 20 MIPS).

  3. Re:What's next? by unfunk · · Score: 3, Informative

    I feel somewhat obliged to point out that the Sony PSP is vulnerable to a battery hack. If you put in a certain battery, you can then downgrade the system's firmware and play pirated games etc

  4. Re:Flash memory in a keyboard? by Anonymous Coward · · Score: 1, Informative

    I wouldn't be surprised. Modern gaming devices with programmable buttons often store those macros on the device itself, (e.g. the N52te) in order to allow it to work on any computer it's plugged into without needing the extra software - all you need the software for is to program it.

  5. Re:Flash memory in a keyboard? by confidential · · Score: 5, Informative

    The firmware could have been in ROM, but these days Flash is about as cheap as ROM and gives you the option of distributing fixes if you find bugs after the device ships.

    Two such examples of exactly that:

    1. Aluminum Keyboard Firmware Update (desktops)
    2. MacBook, MacBook Pro Keyboard Firmware Update (portables)

    The only news here is that the same mechanism of installing these updates is able to have other third party software installed in their place as well.

  6. Re:Doesn't USB have DMA capability? by TheRaven64 · · Score: 2, Informative

    No, USB DMAs can only be initiated from the host (it's a client-server protocol, remember). A USB device has to trick the driver into starting a DMA, which is probably difficult for a keyboard to do without pretending to be some other kind of device. FireWire, on the other hand, allows one device to initiate a DMA request on another and it is up to the driver to block this.

    --
    I am TheRaven on Soylent News
  7. Re:Makes me glad... by alen · · Score: 2, Informative

    probably a lot of keyboards, but Apple keyboards are probably the largest block of a single identifiable brand out there. everyone probably uses OEM'd logitechs but those are probably customized to each OEM

  8. Re:What about other keyboard manufacturers? by Anonymous Coward · · Score: 5, Informative

    All USB keyboards are vulnerable. The blame here rests on the USB Device Firmware Update Specification, which specifies how firmware updates are supposed to work. Hint: there's no security. The only reason this makes news at all is because it has the word "Apple" in the title.

    Spec compliant, secure: choose one. USB was designed for single user computers without security in mind. The only way to solve this (partially) with existing hardware would be to block access to hardware devices from applications running as non-root users, which is fundamentally contrary to the desire to get device drivers out of the kernel for stability. Short of that, this can only be solved by putting a more powerful CPU in the keyboard controller so that it can do a signature check on its own firmware.

  9. Much easier way... by Longjmp · · Score: 3, Informative

    I only need two keystrokes to hack a Mac when I have access to its keyboard:
    Cmd - "s"
    Voila, root access. documented here :p Start into single user mode

    --
    There are fewer illiterates than people who can't read.
  10. Comment removed by account_deleted · · Score: 5, Informative

    Comment removed based on user account deletion

  11. That's not a bug. by Anonymous Coward · · Score: 3, Informative

    That *is* a feature. It isn't a hacked battery, it is a battery which is hacked to appear as an authentic internal tool, designed to read a certain area on a memory stick, so sony can quickly restore a problematic psp.

    It was designed that way, and obscured. the 'hack' merely makes that information public and usable.

  12. Re:Huh?? by RalphSleigh · · Score: 4, Informative

    No, it's your OS's job to decide what pressing keypad-minus does, the keyboard should simply tell the OS that keypad-minus key was pressed

    --
    Come as you are, do what you must, be who you will.
  13. Re:Makes me glad... by Anonymous Coward · · Score: 1, Informative

    Because Apple and a couple of Logitech keyboards are the only ones to use flash.