Author Topic: ccc talk - bypassing code protection on multiple MCU types  (Read 2173 times)

0 Members and 1 Guest are viewing this topic.

Online mikeselectricstuffTopic starter

  • Super Contributor
  • ***
  • Posts: 13774
  • Country: gb
    • Mike's Electric Stuff
ccc talk - bypassing code protection on multiple MCU types
« on: September 11, 2023, 12:51:37 pm »
https://media.ccc.de/v/camp2023-57401-unlock_the_door_to_my_secrets_but_don_t_forget_to_glitch#t=213

TL;DR -
Most MCUs have a way to erase a secured part so it can be reprogrammed.
The erase operation happens in multiple stages - erase memory, erase config bits, re-enable access.
Glitching during the first phase prevents the flash erase bit not the later stages.
They only show on ST but sufggest other mfrs parts have similar vulnerabilities.
 

Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 
The following users thanked this post: thm_w, I wanted a rude username, DavidAlfa

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5961
  • Country: es
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #1 on: September 11, 2023, 02:39:31 pm »
Love those hacking videos!
I guess you first buy few virgin MCUS and do the work on them, when it works consistently then try on the final device.
Still, how many devices will you break before being successful?
The device manufacturer might suspect if you suddenly want to buy 50 mainboards replacements for the machine :D

Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online mikeselectricstuffTopic starter

  • Super Contributor
  • ***
  • Posts: 13774
  • Country: gb
    • Mike's Electric Stuff
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #2 on: September 11, 2023, 02:42:07 pm »
Love those hacking videos!
I guess you first buy few virgin MCUS and do the work on them, when it works consistently then try on the final device.
Still, how many devices will you break before being successful?
The device manufacturer might suspect if you suddenly want to buy 50 mainboards replacements for the machine :D
In one of the questions at the end, he says that once the timings have been established it always works, though not clear if this would apply to different chips of the same type, but seems pretty likely
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5961
  • Country: es
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #3 on: September 11, 2023, 02:51:57 pm »
But there're also device revisions, which might be a nightmware to deal with.
You want to attack a device made in 2013, containing STM32F103 rev. A.
You might only get rev. X , Y, or Z now. Perhabs the revision can't be extracted from the marking, and it's a "Scratch and win" thing.
So a different revision might have a totally different timing, or increased security, whatever, that ensures this can't be done.
But for sure anyone with enough resources will end getting the same chip rev. in their hands :).
Very enjoyable talk!
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline AMDFX8150

  • Newbie
  • Posts: 3
  • Country: us
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #4 on: September 14, 2023, 04:36:08 pm »
Need this done for a few Ryobi 40v units
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: gb
  • Doing electronics since the 1960s...
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #5 on: September 17, 2023, 04:01:33 pm »
Watched a bit of the video in post #1

This attack vector leverages that many microcontrollers allow to deactivate their debug interface protection under the condition that the entire flash memory is erased first.


I don't think the 32F4 series has this option, does it? Once you set Level 2, that's it. No way to erase it.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5961
  • Country: es
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #6 on: September 17, 2023, 04:17:40 pm »
Not sure if you booted using BOOT0=1
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: gb
  • Doing electronics since the 1960s...
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #7 on: September 17, 2023, 05:18:47 pm »
Sorry I don't understand how BOOT0 pin affects the ability to erase (and thus re-use) a Level 2 secured 32F4xx. Did some digging around and can't find anything obviously relevant.

I am booting with BOOT0 = BOOT1 = 0.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8288
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #8 on: September 18, 2023, 12:29:37 am »
This is the easier approach, but for a few k$ some companies in the East will extract the code for you physically.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: gb
  • Doing electronics since the 1960s...
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #9 on: September 18, 2023, 06:41:07 pm »
If somebody is going to de-capsulate a chip and read out the FLASH, all the "fuse" protection is dud.

Smartcard chips have special measures (buried layers) and stuff like Icc obfuscation to make this supposedly impossible. But AFAIK this works only for keys and such, not for a large area of FLASH ?
« Last Edit: September 18, 2023, 08:37:29 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online mikeselectricstuffTopic starter

  • Super Contributor
  • ***
  • Posts: 13774
  • Country: gb
    • Mike's Electric Stuff
Re: ccc talk - bypassing code protection on multiple MCU types
« Reply #10 on: September 20, 2023, 07:02:21 pm »
If somebody is going to de-capsulate a chip and read out the FLASH, all the "fuse" protection is dud.

Smartcard chips have special measures (buried layers) and stuff like Icc obfuscation to make this supposedly impossible. But AFAIK this works only for keys and such, not for a large area of FLASH ?
If a system is properly designed, you can disclose everything but the keys and it's still secure.
Of course in practice bad design, e.g. security by obscurity, means in practice this may not be the case, and access to code makes it easier to find vulnerabilitues
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf