Live data from Hacker News

Pwn the ESP32 Forever: Flash Encryption and SEC. Boot Keys Extraction

limitedresults.com

1–10 of 78 posts

Re: Pwn the ESP32 Forever: Flash Encryption and SEC. Boot Keys Extraction

#3
Synopsis: Secret keys are embedded in the device's e-fuses and are not readable by normal means because of a protection e-fuse. By measuring current draw during power up an interval is determined to be the time when the CPU is reading the e-fuses. At that time the power supplies are "glitched" from 3.3v to 6v using unspecified patterns from a signal generator. This causes errors in the e-fuse reading, one of which is to make a bank of read protected fuses readable. The read values have errors in them, but multiple runs and statistical error correction can retrieve the actual values.

Physical access to the device is required. Security compromise is permanent.

Re: Pwn the ESP32 Forever: Flash Encryption and SEC. Boot Keys Extraction

#4

I believe this requires physical access to the MCU.

It does, but major part of flash encryption is to protect your supply chain. Ie. to keep people from cloning your boards and just dumping your software on them. It's also a bit of security through obscurity (which despite the memes can be an important piece of defense in depth) to make the MCUs a bit more difficult to attack if you don't know the code that's running.

Re: Pwn the ESP32 Forever: Flash Encryption and SEC. Boot Keys Extraction

#5

I believe this requires physical access to the MCU.

Indeed. It's odd to see "Pwn" in the title, and then read the details and have to completely reverse the context. This situation is closer to the original sense of "own", as in "home ownership". If some squirrels get into your home and you evict them, you wouldn't say you "pwnt" your house.

Re: Pwn the ESP32 Forever: Flash Encryption and SEC. Boot Keys Extraction

#6
This is an interesting attack, and certainly looks highly successful in terms of allowing a determined hardware hacker to gain root/bootloader access to a device that the manufacturer has attempted to lock them out of. Glitching with a 6V supply on a 3.3V bus is certainly something I'd want to be a little cautious of if the hardware was more expensive than a $10 dev board - I wouldn't buy a $800 IoT fridge and use this to install alternate firmware just for fun, but it's nice to know it's possible in case my fridge stops working because the manufacturer declares it end-of-life. It's just not clear to me if or how this is a bad thing. The author writes:

> This FATAL exploit allows an attacker to decrypt an encrypted firmware because he is now in possession of the AES Flash Encryption Key.

> Worst case scenario, he is now able to forge his own valid firmware (using the Secure Boot Key) then encrypt it (using the Flash Encryption Key) to replace the original firmware PERMANENTLY.

> This last post closes my security investigation on ESP32, which I consider now as a broken platform.

Isn't that a good thing for me as a consumer? I like the ability to decrypt and modify my own devices. I like that this is a permanent modification, unlike eg. dd-wrt where you have to prevent the bootloader from overwriting your software with that of the manufacturer.

The only thing I can think of that would be really bad is if I had a device with an ESP32 inside physically stolen then reinstalled by an attacker (or a counterfeit sold to me with malicious code from the vendor) and this exploit allowed them to get private data from my network to an Internet location. But they could already just buy or build their own device, ESP32 or not, to do that.

This is only bad for draconian IoT manufacturers who want to enforce their terms of service and artificial limitations on hardware they think consumers are leasing but consumers think they are buying.

Re: Pwn the ESP32 Forever: Flash Encryption and SEC. Boot Keys Extraction

#7
Props for the effort, but who expects a cheap china MCU for consumer products to be resilient against glitching attacks? You don’t use that stuff in high-security settings anyway. For consumers products resilient to advanced hardware attacks, I can only think of the iPhone and some consoles. Anything else?

Re: Pwn the ESP32 Forever: Flash Encryption and SEC. Boot Keys Extraction

#8
post #4

I believe this requires physical access to the MCU.

It does, but major part of flash encryption is to protect your supply chain. Ie. to keep people from cloning your boards and just dumping your software on them. It's also a bit of security through obscurity (which despite the memes can be an important piece of defense in depth) to make the MCUs a bit more difficult to attack if you don't know the code that's running.

Except an attacker operating at that scale would just start decapping the chips and inspecting them.

Re: Pwn the ESP32 Forever: Flash Encryption and SEC. Boot Keys Extraction

#9
Some additional info is in Espressif's notification (CVE-2019-17391) which is linked to in the write up: https://www.espressif.com/en/news/Security_Advisory_Concerni...

The fix is in ESP32-D0WD-V3 and ESP32-WROVER-E, but of course that doesn't do you any good if you've already shipped product.

Re: Pwn the ESP32 Forever: Flash Encryption and SEC. Boot Keys Extraction

#10

This is an interesting attack, and certainly looks highly successful in terms of allowing a determined hardware hacker to gain root/bootloader access to a device that the manufacturer has attempted to lock them out of. Glitching with a 6V supply on a 3.3V bus is certainly something I'd want to be a little cautious of if the hardware was more expensive than a $10 dev board - I wouldn't buy a $800 IoT fridge and use th…

Might as well call the PC a broken platform since you can install your own OS.

Imo a platform is broken if the user can't control it.

Post reply on HN