Bypass NXP LPC Family Debug Check
Bypass NXP LPC Family Debug Check
3
GOAL
4
LPC CODE READ PROTECTION
5
LPC CODE READ PROTECTION
6
LPC13xx MEMORY MAP
7
LPC13xx BOOT PROCESS
8
BOOTLOADER RE
R5=CRP3
R6=CRP1
9
BOOTLOADER RE
[0x2fc]:
CRP3
R5=CRP3
R6=CRP1
R4=CRP3
*R4=0x87654321=CRP2 10
BOOTLOADER RE
[0x2fc]:
CRP3
R5=CRP3
R6=CRP1
R4=CRP3
R4=CRP2
*R4=0x87654321=CRP2 11
BOOTLOADER RE
[0x2fc]:
CRP1
CRP3
R5=CRP3
R6=CRP1
R4=CRP1
*R4=0x87654321=CRP2 12
BOOTLOADER RE
[0x2fc]:
CRP1
CRP3
R5=CRP3
R6=CRP1
R4=CRP1
R4=CRP2
*R4=0x87654321=CRP2 13
BOOTLOADER RE
[0x2fc]:
CRP1
CRP2/NO_ISP/NO_CRP…
CRP3
R5=CRP3
R6=CRP1
14
*The value that disables JTAG:0x87654321=CRP2
BOOTLOADER VULNERABILITY
Load configuration
Execute Locking
Startup from Non-Volatile
memory/FUSED! Mechanism
CRP1 0x12345678
Corrupting the configuration values CRP2 0x87654321
Register corruption CRP3 0x43218765
Bypass the load NO_ISP 0x4E697370
Bypass/Corrupt compare instruction —————————————
… NO_CRP 0xFFFFFFFF
0x000000000
0xB4B4B4B4….
15
WHAT IS FAULT INJECTION (GLITCHING)?
16
TECHNIQUES
● Clock
● Voltage
● Electromagnetic
● Laser
● And more…
https://www.mdpi.com/2079-9292/9/7/1153/htm 17
TECHNIQUES
3.2
● Clock
Supply Voltage
● Voltage 2.4
● Electromagnetic 1.6
● Laser
0.8
● And more…
0
Time
18
TECHNIQUES
● Clock
● Voltage
● Electromagnetic
● Laser
● And more…
19
TECHNIQUES
● Clock
● Voltage
● Electromagnetic
● Laser
● And more…
https://www.alphanov.com/en/products-services/double-laser-fault-injection 20
IS IT DIFFICULT?
22
https://www.fraunhofer-innovisions.de/cybersicherheit/laser-fault-injection/
EXAMPLES
https://www.youtube.com/watch?v=_E0PWQvW-14 23
EXAMPLES
How I hacked a hardware crypto wallet and recovered $2 million (Joe Grand)
Wallet.fail (Thomas, Dmitry, Josh)
Kraken Security Labs (Nick)
Glitching Trezor using EMFI Through The Enclosure (Colin O’flynn) 25
BEFORE THE ATTACK
26
BEFORE THE ATTACK
27
ATTACK SETUP
28
ATTACK SETUP
29
POWER ANALYSIS
30
POWER ANALYSIS
31
THE ATTACK
● We did the attack first with a RESET setup, but we didn’t succeed !!
● After we changed the setup. POWER ON is the trigger now.
● And did the attack we succeeded !!
33
THE ATTACK
34
Recorded demo
35
36
RESULT (CRP1 GLITCH)
37
RESULT (CRP1 & NO CRP)
38
RESULT (CRP2 GLITCH)
39
RESLUT (CRP2 & NO_CRP)
40
RESLUT (CRP1,2 & NO_CRP)
41
PHILIPS → NXP
42
https://www.keil.com/dd/docs/datashts/philips/user_manual_lpc214x.pdf https://www.nxp.com/docs/en/user-guide/UM10139.pdf
PHILIPS → NXP
● Sharing same CRP mechanism and boot process (based on user manuals)
○ Cortex-M4 ○ Cortex-M3 ○ Cortex-M0 ○ ARM7
■ LPC5411X ■ LPC18XX ■ LPC8XX ■ LPC2XXX
■ LPC5410X ■ LPC17XX ■ LPC51U68
■ LPC43XX ■ LPC15XX ■ LPC11XX
■ LPC43SXX ■ LPC13XX ■ LPC122X
■ LPC40(8/7)X
45
Q&A
46
Thank you…
47
Resources
48