News for hackers. Stuff that matters.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by AnthonyMouse on Sunday February 22, 2015 @10:06PM (#9092332)
> Hard disk makers don’t cryptographically sign the firmware they install on drives the way software vendors do.

That is not a solution for this. You have to assume that a state-level attacker will be able to either coerce the vendor or its employees into signing malicious firmware or just compromise their network and steal the signing key.

The right way to secure firmware updates is with a hardware write-enable switch/jumper that has to be physically set to make any changes to the firmware.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by pdkl95 on Sunday February 22, 2015 @11:45PM (#9092596)
It was a serious design flaw to move away from physical write-enable protection. Physical interlocks for rare-but-important events such as upgrading firmware should exist in almost all situations.

Look back at floppy disks: while many people were caught by the write-protect tab/switch while they were still learning, it was an easy concept for people to understand once taught. I knew many non-technical people that quickly adopted habits that utilized write-protection.

The physical interlock is something that can be taught a lot easier than how to use crypto without screwing up. If you require proactive checking or fancy technique, it will be forgotten and skipped. On the other hand, if you fail the update with a message "did you forget to flip the write-protect switch? [picture of switch]", a lot of people will figure it out.

There are similarities to Schneier's (et al) recommendation to make good (long, random) passwords, but write them down and keep them someplace safe. (i.e. leverage the physical security knowledge that people already have)

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by tehwalrus on Monday February 23, 2015 @03:59AM (#9093284)
I still use write protection on SD cards, since I had a buggy Mac that reformatted one to be unusable by my camera. I just got into the habit of flipping the switch whenever plugging a card into a machine, and it works fine (and is slightly safer).
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by jnbiche on Monday February 23, 2015 @04:29AM (#9093364)
Yeah, as you suggest by your "slightly safer" parenthetical, the mechanical write protection on most SD cards is just a suggestion that the card reader is free to ignore (though obviously most don't).

It's actually specified in the SD spec [1], which says on p. 38 that the mechanical protect switch is "Host responsibility only" and that the "The position of the write protect switch is unknown to the internal circuitry of the card."

1. https://www.sdcard.org/downloads/pls/simplified_specs/part1_... [pdf file]

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by semi-extrinsic on Monday February 23, 2015 @07:34AM (#9093913)
The popular CHDK custom firmware for Canon compact cameras subverts the write-protect tab on the SD card to be a CHDK on/off switch. So it's widely known that software may ignore this switch.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by tehwalrus on Monday February 23, 2015 @05:03AM (#9093440)
I did read that somewhere, but I'd forgotten.. Good catch!

Hardware write protection is harder to find than you think..

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by TeMPOraL on Monday February 23, 2015 @12:24PM (#9095508)
I keep wondering why create a feature only to not implement it? What was the reasoning behind this soft write protection mechanism?
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by userbinator on Monday February 23, 2015 @01:29AM (#9092916)
Even with hardware write-enable, they could just ship the firmware with the backdoor code by default, and sign it too. This somewhat reminds me of Computrace in the BIOS - it's advertised as a "theft recovery" solution, but could also be used as a firmware-level backdoor, and many laptops are sold with this preinstalled in the BIOS without the user's knowledge. (It's easy enough to remove for those who are into hacking BIOSes, but anyone asking how gets accused of stealing hardware...)

The ultimate solution would be to make HDD firmware open-source, just like Coreboot for BIOSes, so the truly paranoid could download, verify, compile, and flash their drives themselves. Unfortunately, I don't see this happening due to all the trade secrets (including some existing backdoors into passworded drives that you can find on data recovery forums, but obviously manufacturers don't want you to know about...) that are likely involved.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by psykovsky on Monday February 23, 2015 @08:30AM (#9094136)
RE: passworded drives.

To access a BIOS passworded drive all you had to do was swap it for another for which you knew the password, boot into the BIOS and change the HDD password. It will ask you for your old password, you enter it and you go to the new password input screen. Now you take out the HDD and put the locked one in its place. You press enter twice, setting the password as blank, and voilá, you have your locked drive unlocked. Just boot the computer and no more HDD password. Have fun.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by zby on Monday February 23, 2015 @04:59AM (#9093433)
I agree with the open source point (but not that it would solve everything - see "Trusting trust"), but shipping with the backdoor by default is is problematic for the attackers, because it makes it public.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by manicdee on Sunday February 22, 2015 @10:51PM (#9092422)
Physical switches are no impediment to people who already gain physical access in transit.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by AnthonyMouse on Monday February 23, 2015 @01:06AM (#9092843)
With physical access they could just program the flash chips directly or replace the entire hard drive with a compromised one. The only way to defend against physical access is to prevent physical access.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by rl3 on Sunday February 22, 2015 @10:58PM (#9092452)
Physical switches would be an impediment, actually.

Some targets may fall under surveillance and not acquire new hardware for long periods of time. Years.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by tedunangst on Monday February 23, 2015 @04:39AM (#9093397)
Not to worry. Soon you'll be able to buy a Librem laptop with a CPU that accepts unsigned microcode updates as well.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by tw04 on Sunday February 22, 2015 @11:06PM (#9092479)
I guess I could see having that as an option, but reality is that every vendor would just ship the dries with the jumper in the "flashme" position by default. Asking a consumer to pull out a drive and move a jumper to install an update is akin to asking them to remove their own spleen.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by hueving on Sunday February 22, 2015 @11:14PM (#9092501)
How often do consumers actually have to flash a hard drive with new firmware?
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by mrsteveman1 on Monday February 23, 2015 @11:38AM (#9095187)
Manufacturers don't seem to release firmware updates for hard drives very often, but even when they do, consumers may never learn that they need to apply an update to a drive they own so the actual update rate in the wild is probably very low.

As an example of a rather serious firmware update that likely went unnoticed by most drive owners, some Samsung F4 EcoGreen hard drives (the ones Samsung actually made before the Seagate buyout) had a serious bug[1] that caused data corruption if a specific S.M.A.R.T. command was issued to the drive during normal operation:

    "The above suggests that the disk sometimes discards a
     pending 64 sector write command when a IDENTIFY DEVICE
     command is received. This data loss occurs silently.
 
     There is no error message in kernel log, SMART Error log, 
     NCQ Command Error log page, or SATA Phy Event Counters 
     log page."
Manufacturers can't notify people directly about these things unless buyers contact info is submitted along with info about which specific drive model they own. I don't know if this patch was pushed out via Windows Update but I'd bet it wasn't. I only heard about it because Smartmontools warned me.

Samsung fixed it in a firmware update but neglected to bump the version number of the firmware, so it's impossible to tell which drives have been fixed. As a result, it's quite easy to assume your drive is fine, so Smartmontools will print this in any system with any HD204UI or HD155UI detected:

    ==> WARNING: Using smartmontools or hdparm with this
    drive may result in data loss due to a firmware bug.
    ****** THIS DRIVE MAY OR MAY NOT BE AFFECTED! ******
    Buggy and fixed firmware report same version number!
    See the following web pages for details:
    http://knowledge.seagate.com/articles/en_US/FAQ/223571en
    http://www.smartmontools.org/wiki/SamsungF4EGBadBlocks
[1] http://www.smartmontools.org/wiki/SamsungF4EGBadBlocks
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by tw04 on Monday February 23, 2015 @02:58PM (#9096586)
First generation SSDs, across the board, were getting firmware at least quarterly.

Even ignoring that, let's move on to... enterprise storage. I don't foresee someone with a 1200 disk storage array being enthused at the prospect of popping out drives one at a time to be able to update firmware (something that is currently an online operation).

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by tedunangst on Monday February 23, 2015 @04:33AM (#9093380)
I think every SSD I've owned, from three manufacturers, recommended firmware updates. Not nearly as rare as such updates were ten years ago.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by semi-extrinsic on Monday February 23, 2015 @07:36AM (#9093921)
I own several SSDs, but have never updated any firmwares. How do you get notified?
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by thoth on Monday February 23, 2015 @11:36AM (#9095176)
Probably from installing the utility program that often comes with the SSD. I bought a Samsung 840 EVO recently and it came with "Samsung Magician" which dutifully tells me about the Feb 2015 update available.

http://www.samsung.com/global/business/semiconductor/minisit...

Now tedu being a BSD guy ;) probably is finding out some other way but I'm going to guess the vast majority of SSD customers have a Windows or Mac computer and just go with the utility provided by the hardware vendor, Samsung or some other company.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by semi-extrinsic on Monday February 23, 2015 @05:03PM (#9097351)
I see. All my computers run ArchLinux. Guess I should skim through the manufacturers recommendations some time.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by marssaxman on Tuesday February 24, 2015 @04:09PM (#9103532)
In thirty years of computing I have never flashed a hard drive with new firmware ever, for any reason.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by sjtrny on Sunday February 22, 2015 @10:27PM (#9092376)
Physical switches can easily be bypassed in the code.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by mmastrac on Sunday February 22, 2015 @10:29PM (#9092378)
Not if the physical switch is directly controlling the NAND's !WP pin. If that's possible it's beyond my knowledge.

eg: http://www.hynix.com/datasheet/pdf/flash/HY27UF084G2M%20Seri...

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by sjtrny on Sunday February 22, 2015 @10:40PM (#9092404)
It seems unlikely that any PC manufacturer (Apple, Dell, HP etc) would force their users to open up their machines and flick the WP switch on the hard drive controller to install a firmware update.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by userbinator on Sunday February 22, 2015 @11:05PM (#9092475)
Motherboards used to have physical write-protection jumpers for the BIOS flash, and that was something no malware could ever bypass. This was also in the days when BIOS updates were quite rare, so opening up the case to do it seems a very reasonable action to take. I have only updated the BIOS twice on two machines, in over a decade; "don't fix it if it ain't broke" is how I tend to approach updates in general.

For HDD firmware, I think it's something that should not be updatable at all through regular software; instead it's something manufacturers should be getting right before shipping product. I've owned disks from over two decades ago, and not once have I needed to update any firmware on them.

Somehow I feel that this "update culture" has just lead to more problems due to propagating an attitude of "it can always be updated later", where shipping devices with imperfect firmware becomes almost acceptable and it can sometimes become a case of fixing one bug and introducing others.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by Pxtl on Monday February 23, 2015 @08:20AM (#9094087)
Yup. I loathe th update culture - every wifi router I've bought in the past decade has been barely useable before updating its firmware to current. Regular WiFi crashes requiring re-setting the router should not be the default state.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by tunap on Monday February 23, 2015 @02:40AM (#9093125)
"update culture"

Don't forget feature bloat & the increased attack surface they inevitably create.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by AnthonyMouse on Monday February 23, 2015 @01:15AM (#9092879)
> It seems unlikely that any PC manufacturer (Apple, Dell, HP etc) would force their users to open up their machines and flick the WP switch on the hard drive controller to install a firmware update.

http://support.apple.com/kb/DL1283

"Locate the programmer's button on the side of the iMac, to the right of the reset button. Press and hold in the programmer's button. You may need to use a pen or a straightened paper clip."

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by sjtrny on Monday February 23, 2015 @03:28AM (#9093220)
> iMac G3

Which they stopped making around 2003. Further the button was accessible from the outside.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by mmastrac on Sunday February 22, 2015 @10:48PM (#9092416)
How often have you honestly installed a firmware update on an HDD ever? I think I've done it maybe twice in my lifetime. Both times required jumping through crazy hoops creating boot floppies.

Apple would likely just ask you to bring it into the Apple store.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by eli on Sunday February 22, 2015 @10:53PM (#9092433)
Apple pushes out HDD firmware updates more often than you think.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by turval on Monday February 23, 2015 @12:27AM (#9092721)
Can you link to some examples?
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by xenophonf on Monday February 23, 2015 @01:03AM (#9092829)
I can:

http://support.apple.com/en-us/HT201966

http://support.apple.com/kb/DL1378

Here's one from Lenovo:

http://support.lenovo.com/us/en/downloads/migr-62282

With suitable search terms you'll find similar updates from other OEMs.

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by andrewpi on Sunday February 22, 2015 @10:46PM (#9092414)
They could wire it to a key on the keyboard, so you have to hold down 'Esc' to flash a firmware update, for example.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by mmastrac on Sunday February 22, 2015 @10:52PM (#9092425)
Unless you've got a direct electrical connection between the Esc key and that pin, you've unfortunately introduced a way for software to do the same thing as holding Esc.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by bdonlan on Sunday February 22, 2015 @10:33PM (#9092385)
Not if the physical switch physically disconnects the write enable pin on the flash chip.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by kabdib on Sunday February 22, 2015 @10:53PM (#9092430)
WP pins are not necessarily meaningful. All of the on-chip flash for embedded micros that I've seen in the last few years have not needed an external WP pin.

Presumably stock external flash parts are okay, but it's still conceivable that evil circuitry could cause a write, or at least an addressing "mistake".

Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by marssaxman on Tuesday February 24, 2015 @04:12PM (#9103549)
Are you talking about flash embedded in the mcu, or separate flash chips? The mcu can usually reflash itself, modulo fuses, but I can't recall having seen a standalone flash chip which lacked a write protect (or write-enable) pin. A physical toggle switch on that line seems like a solid protection against NSA style firmware hacking.
Re:How the NSA’s Firmware Hacking Works and Why It’s So Unse... by kabdib on Wednesday February 25, 2015 @11:50PM (#9111236)
Unless you're talking about a pin supplying a required programming voltage, that WE pin is just hooked up to internal gates that suppress writes. There are relatively easy ways to back-door gates (e.g., with secret access patterns or data sequences).

Yeah, I'm a suspicious cuss.