SlideShare a Scribd company logo
1
Hardware Wallet Security
Sergei Volokitin
2
What is a hardware wallet?
• Secure device with:
• Connection to PC/smartphone/network
• Trusted screen
• Trusted controls
• Protected firmware
• Tamper resistant
3
What is a hardware wallet?
4
Who is your attacker?
• Somebody who controls your computer
• Malware
• Another user
• Somebody who has physical access to the device
• Flatmate
• Evil maid
• Thief
• Somebody who had access to the device before you got it:
• Courier
• Evil maid government
• Previous owner
5
Security features
• Secrets never leave the device
• Small API
• Protected memory
• There is no easy way to access keys
• Protected firmware
• The authenticity of firmware is verified on boot and updates
Generated
Stored
Used
Wiped
6
Software attacks – Leger Nano S
7
Software attacks
8
Software attacks
9
Software attacks
• MPU isolates memory
• Application has
• ~16 KB of Flash
• ~1 KB of RAM
• Over 100 syscalls
10
Vulnerabilities
• x4 vulnerabilities in the system calls
• partial memory disclosure of the following app
• partial memory disclosure due to null pointer dereferencing
• memory oracle on all the system memory
• Vulnerability in memory protection of debug app
• Vulnerability in device wipe process
• Vulnerability allowing supply chain attack
11
Vulnerabilities
• x4 vulnerabilities in the system calls
• partial memory disclosure of the following app
• partial memory disclosure due to null pointer dereferencing
• memory oracle on all the system memory
• Vulnerability in memory protection of debug app
• Vulnerability in device wipe process
• Vulnerability allowing supply chain attack
13
Debug app installation flag
• There are per application flags you can set, such as:
• Application with debug flag can read ~16kB of flash belonging to another
app!
14
Debug app installation flag
U2F App Flash
BTC App Flash
System Flash
Debug App Flash
15
Debug app installation flag
U2F App Flash
BTC App Flash
System Flash
Debug App Flash
16
Debug app installation flag
BTC App Flash
System Flash
Debug App Flash
17
Debug app installation flag
System Flash
Debug App Flash
18
Flash state after device wipe
19
Secrets in Flash memory
• The keys should not be stored in flash if possible
21
Conclusions
• Software cannot be trusted
• Large attack surface difficult to protect
• Even small bugs, combined, can lead to an attack
The end?
22
No software bug no exploit?
23
Features
• STM32
• Flash on the chip
• Large attack surface (22 input commands without auth)
• Built-in 4 digit PIN security lock
• Open Source (bootloader and firmware)
• Built-in onboarding (seed generation and recovery)
• USB connectivity
• Super secure boot with three signatures and five keys!
24
Using HW wallet
25
Hardware architecture
• STM32F205
• 1MB of internal flash
• There is secure boot
26
Why bother with a hardware attack?
• Popular open source project
• SW is tested and patched over time
• General purpose MCU is used to keep the secrets
27
What is FI and how can it help?
• Corrupt data (0x00, 0xFF, 0x??)
• Corrupt instructions
• Skip instructions
• ...
28
Cracking the case
29
Can we glitch it?
30
No code execution, no easy trigger
• The power comes from USB and is quite noisy
• No modifications to the device were made
• When a command is sent a similar pattern is observed
CMD
RESP
GLITCH!
31
Characterization results
32
DEMO
33
34
Glitching the screen output
35
Glitching the screen output
36
Getting full access to the device
GLITCH!
37
SW Design leading to exploitable FI
• The glitch of the if statement is possible but does not change the flash
• fsm_msgResetDevice command once glitched only changes the PIN in RAM
• fsm_msgChangePin compares against the PIN in RAM and saves a new one to FLASH
KeepKey
RAM
PIN
FLASH
PIN
fsm_msgResetDevice
fsm_msgChangePin
38
The attack:
1. Steal Find a device
2. Glitch the lifecycle check
3. Set a new PIN on the device, keep the seed
4. Unlock the device using the new pin
...
5. Get full access to the coins on the device
Getting full access to the device
GLITCH!
39
Getting full access to the device #2
GLITCH!
1.
fsm_ResetDevice()
GLITCH!
GLITCH!
PIN RAM
2.
3.
PIN FLASH
fsm_msgChangePin(PIN RAM)
GLITCH!GLITCH!
GLITCH!
Profit!
4.
…
5.
40
Results
Success rate ~1.2%
Attempt rate 0.3 att/sec
On average it takes 5 minutes to glitch the PIN
41
Conclusions
• Software cannot be trusted
• Large attack surface is difficult to protect
• Even small bugs, combined, can lead to an attack
• Hardware cannot be trusted
• Non-secure hardware is easily glitchable
• Simple FI counter measures are not sufficient against
EMFI
42
The end?
43
Challenge your security
Sergei Volokitin
Security Analyst
📩 sergei@riscure.com

More Related Content

PDF
ATM Compromise with and without Whitelisting
PDF
Yunusov babin 7 sins pres atm v2
PDF
Symantec Freak Vulnerability Infographic
PDF
Leave ATM Forever Alone
PPT
Tek systems it guidelines
PPTX
RCS Demo HackingTeam
PDF
Neo900: Crafting The Private Phone
PDF
Embedded government espionage
ATM Compromise with and without Whitelisting
Yunusov babin 7 sins pres atm v2
Symantec Freak Vulnerability Infographic
Leave ATM Forever Alone
Tek systems it guidelines
RCS Demo HackingTeam
Neo900: Crafting The Private Phone
Embedded government espionage

What's hot (20)

PDF
Kavya racharla ndh-naropanth_fin
PDF
Revisiting atm vulnerabilities for our fun and vendor’s
PDF
Hack your ATM with friend's Raspberry.Py (Black Hat EU-2014)
PPT
Tek systems it guidelines - animation
PDF
EntroWatch V1.2 (1)
PDF
Disabling Ports 135 and 445 to protect the Road Warrior
PDF
CONFidence 2014: Yaniv Miron: ATMs – We kick their ass
PPTX
Trusted platform module copy
PPTX
Necto 16 training 18 access security
PPTX
The trusted computing architecture
PPTX
Security for io t apr 29th mentor embedded hangout
PDF
Introduction to Trusted Computing
PDF
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls short
PPTX
Thesis presentation
PDF
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
PPTX
Mobile device security using transient authentication
PDF
Jakub Bartoszek (Samsung Electronics) - Hardware Security in Connected World
PPTX
Identify and mitigate high risk port vulnerabilities
PDF
CCTV UAE, DVR CCTV Camera, IP Camera UAE
PDF
Comelit 6231 Data Sheet
Kavya racharla ndh-naropanth_fin
Revisiting atm vulnerabilities for our fun and vendor’s
Hack your ATM with friend's Raspberry.Py (Black Hat EU-2014)
Tek systems it guidelines - animation
EntroWatch V1.2 (1)
Disabling Ports 135 and 445 to protect the Road Warrior
CONFidence 2014: Yaniv Miron: ATMs – We kick their ass
Trusted platform module copy
Necto 16 training 18 access security
The trusted computing architecture
Security for io t apr 29th mentor embedded hangout
Introduction to Trusted Computing
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls short
Thesis presentation
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
Mobile device security using transient authentication
Jakub Bartoszek (Samsung Electronics) - Hardware Security in Connected World
Identify and mitigate high risk port vulnerabilities
CCTV UAE, DVR CCTV Camera, IP Camera UAE
Comelit 6231 Data Sheet
Ad

Similar to [CB19] Hardware Wallet Security (20)

PDF
Tower defense for hackers: Layered (in-)security for microcontrollers
PDF
Software Attacks on Hardware Wallets
PDF
Software Attacks on Hardware Wallets
PDF
Track 5 session 4 - st dev con 2016 - life cycle management for web
PPT
Embabded system security for feuture .ppt
PPTX
Pentesting embedded
PDF
Using fault injection attacks for digital forensics
PDF
Bitcoin hardware wallets security
PDF
Finding the needle in the hardware haystack - HRES (1)
PPTX
How to create a secure IoT device
PDF
Hacking Smartcards & RFID
PDF
Eloi Sanfélix y Javier Moreno - Hardware hacking on your couch [RootedCON 2012]
PPTX
Timothy Wright & Stephen Halwes - Finding the Needle in the Hardware – Identi...
PDF
Reverse engineering
PDF
eu-19-LimitedResults-Fatal-Fury-On-ESP32-Time-To-Release-Hardware-Exploits.pdf
PDF
ASFWS 2011 - Secure software development for mobile devices
PDF
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
PDF
PEW PEW PEW: Designing Secure Boot Securely
PDF
PEW PEW PEW: Designing Secure Boot Securely
Tower defense for hackers: Layered (in-)security for microcontrollers
Software Attacks on Hardware Wallets
Software Attacks on Hardware Wallets
Track 5 session 4 - st dev con 2016 - life cycle management for web
Embabded system security for feuture .ppt
Pentesting embedded
Using fault injection attacks for digital forensics
Bitcoin hardware wallets security
Finding the needle in the hardware haystack - HRES (1)
How to create a secure IoT device
Hacking Smartcards & RFID
Eloi Sanfélix y Javier Moreno - Hardware hacking on your couch [RootedCON 2012]
Timothy Wright & Stephen Halwes - Finding the Needle in the Hardware – Identi...
Reverse engineering
eu-19-LimitedResults-Fatal-Fury-On-ESP32-Time-To-Release-Hardware-Exploits.pdf
ASFWS 2011 - Secure software development for mobile devices
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
PEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot Securely
Ad

More from CODE BLUE (20)

PDF
[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
PDF
[cb22] Tales of 5G hacking by Karsten Nohl
PDF
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
PDF
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
PDF
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
PDF
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
PDF
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
PDF
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
PDF
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
PDF
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
PDF
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
PDF
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
PPTX
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
PPTX
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
PDF
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
PDF
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
PDF
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
PDF
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
PDF
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
PDF
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...

Recently uploaded (20)

PDF
oil_refinery_presentation_v1 sllfmfls.pdf
PDF
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
PPTX
Introduction to Effective Communication.pptx
PPTX
2025-08-10 Joseph 02 (shared slides).pptx
PPTX
Project and change Managment: short video sequences for IBA
PPTX
nose tajweed for the arabic alphabets for the responsive
PPTX
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
PPTX
Non-Verbal-Communication .mh.pdf_110245_compressed.pptx
PPTX
An Unlikely Response 08 10 2025.pptx
PPTX
The Effect of Human Resource Management Practice on Organizational Performanc...
PPTX
Impressionism_PostImpressionism_Presentation.pptx
PPT
The Effect of Human Resource Management Practice on Organizational Performanc...
PPTX
Relationship Management Presentation In Banking.pptx
DOCX
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
PPTX
Emphasizing It's Not The End 08 06 2025.pptx
PPTX
Tablets And Capsule Preformulation Of Paracetamol
DOC
学位双硕士UTAS毕业证,墨尔本理工学院毕业证留学硕士毕业证
PPTX
PHIL.-ASTRONOMY-AND-NAVIGATION of ..pptx
PPTX
Presentation for DGJV QMS (PQP)_12.03.2025.pptx
PPTX
Primary and secondary sources, and history
oil_refinery_presentation_v1 sllfmfls.pdf
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
Introduction to Effective Communication.pptx
2025-08-10 Joseph 02 (shared slides).pptx
Project and change Managment: short video sequences for IBA
nose tajweed for the arabic alphabets for the responsive
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
Non-Verbal-Communication .mh.pdf_110245_compressed.pptx
An Unlikely Response 08 10 2025.pptx
The Effect of Human Resource Management Practice on Organizational Performanc...
Impressionism_PostImpressionism_Presentation.pptx
The Effect of Human Resource Management Practice on Organizational Performanc...
Relationship Management Presentation In Banking.pptx
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
Emphasizing It's Not The End 08 06 2025.pptx
Tablets And Capsule Preformulation Of Paracetamol
学位双硕士UTAS毕业证,墨尔本理工学院毕业证留学硕士毕业证
PHIL.-ASTRONOMY-AND-NAVIGATION of ..pptx
Presentation for DGJV QMS (PQP)_12.03.2025.pptx
Primary and secondary sources, and history

[CB19] Hardware Wallet Security

  • 2. 2 What is a hardware wallet? • Secure device with: • Connection to PC/smartphone/network • Trusted screen • Trusted controls • Protected firmware • Tamper resistant
  • 3. 3 What is a hardware wallet?
  • 4. 4 Who is your attacker? • Somebody who controls your computer • Malware • Another user • Somebody who has physical access to the device • Flatmate • Evil maid • Thief • Somebody who had access to the device before you got it: • Courier • Evil maid government • Previous owner
  • 5. 5 Security features • Secrets never leave the device • Small API • Protected memory • There is no easy way to access keys • Protected firmware • The authenticity of firmware is verified on boot and updates Generated Stored Used Wiped
  • 6. 6 Software attacks – Leger Nano S
  • 9. 9 Software attacks • MPU isolates memory • Application has • ~16 KB of Flash • ~1 KB of RAM • Over 100 syscalls
  • 10. 10 Vulnerabilities • x4 vulnerabilities in the system calls • partial memory disclosure of the following app • partial memory disclosure due to null pointer dereferencing • memory oracle on all the system memory • Vulnerability in memory protection of debug app • Vulnerability in device wipe process • Vulnerability allowing supply chain attack
  • 11. 11 Vulnerabilities • x4 vulnerabilities in the system calls • partial memory disclosure of the following app • partial memory disclosure due to null pointer dereferencing • memory oracle on all the system memory • Vulnerability in memory protection of debug app • Vulnerability in device wipe process • Vulnerability allowing supply chain attack
  • 12. 13 Debug app installation flag • There are per application flags you can set, such as: • Application with debug flag can read ~16kB of flash belonging to another app!
  • 13. 14 Debug app installation flag U2F App Flash BTC App Flash System Flash Debug App Flash
  • 14. 15 Debug app installation flag U2F App Flash BTC App Flash System Flash Debug App Flash
  • 15. 16 Debug app installation flag BTC App Flash System Flash Debug App Flash
  • 16. 17 Debug app installation flag System Flash Debug App Flash
  • 17. 18 Flash state after device wipe
  • 18. 19 Secrets in Flash memory • The keys should not be stored in flash if possible
  • 19. 21 Conclusions • Software cannot be trusted • Large attack surface difficult to protect • Even small bugs, combined, can lead to an attack The end?
  • 20. 22 No software bug no exploit?
  • 21. 23 Features • STM32 • Flash on the chip • Large attack surface (22 input commands without auth) • Built-in 4 digit PIN security lock • Open Source (bootloader and firmware) • Built-in onboarding (seed generation and recovery) • USB connectivity • Super secure boot with three signatures and five keys!
  • 23. 25 Hardware architecture • STM32F205 • 1MB of internal flash • There is secure boot
  • 24. 26 Why bother with a hardware attack? • Popular open source project • SW is tested and patched over time • General purpose MCU is used to keep the secrets
  • 25. 27 What is FI and how can it help? • Corrupt data (0x00, 0xFF, 0x??) • Corrupt instructions • Skip instructions • ...
  • 28. 30 No code execution, no easy trigger • The power comes from USB and is quite noisy • No modifications to the device were made • When a command is sent a similar pattern is observed CMD RESP GLITCH!
  • 31. 33
  • 34. 36 Getting full access to the device GLITCH!
  • 35. 37 SW Design leading to exploitable FI • The glitch of the if statement is possible but does not change the flash • fsm_msgResetDevice command once glitched only changes the PIN in RAM • fsm_msgChangePin compares against the PIN in RAM and saves a new one to FLASH KeepKey RAM PIN FLASH PIN fsm_msgResetDevice fsm_msgChangePin
  • 36. 38 The attack: 1. Steal Find a device 2. Glitch the lifecycle check 3. Set a new PIN on the device, keep the seed 4. Unlock the device using the new pin ... 5. Get full access to the coins on the device Getting full access to the device GLITCH!
  • 37. 39 Getting full access to the device #2 GLITCH! 1. fsm_ResetDevice() GLITCH! GLITCH! PIN RAM 2. 3. PIN FLASH fsm_msgChangePin(PIN RAM) GLITCH!GLITCH! GLITCH! Profit! 4. … 5.
  • 38. 40 Results Success rate ~1.2% Attempt rate 0.3 att/sec On average it takes 5 minutes to glitch the PIN
  • 39. 41 Conclusions • Software cannot be trusted • Large attack surface is difficult to protect • Even small bugs, combined, can lead to an attack • Hardware cannot be trusted • Non-secure hardware is easily glitchable • Simple FI counter measures are not sufficient against EMFI
  • 41. 43 Challenge your security Sergei Volokitin Security Analyst 📩 sergei@riscure.com