Reflections on Trusting TrustZone
summary
Reverse-engineered Qualcomm TrustZone (QSE/QCE) firmware with IDA Pro and firmware images pulled via DD, finds an integer overflow in SMC command length checks that lets a crafted SMC command buffer pass all sanity checks. Exploit writes a hard-coded 12-byte response header (12,12,1) into arbitrary secure memory, then performs an SMC table extension attack to redirect handler parsing and achieve arbitrary TrustZone code execution. Demo permanently unlocks a Moto X bootloader by blowing a QFuse; ADB/fastboot used for the live exploit.
AI-written summary · about
chapters (25)
- 0:00Intro
- 0:16What is TrustZone?
- 0:38TrustZone Architecture
- 2:06Real-World Uses
- 4:02Prior Work
- 5:50Motivation
- 7:26Toolchain
- 8:45Attack Surface
- 11:13Attacker Assumptions
- 13:48QSEE SCM Interface
- 14:14SCM Call-by-Register Convention
- 14:44SCM Command Structures
- 16:08Structure Sanity Checking
- 19:10Secure Memory Checking Pseudocode
- 20:19Review: Integer Overflow
- 21:04Integer Overflow Vulnerability
- 21:59Pathological Command Buffer
- 24:06What is Written to Response Header?
- 25:49Sorcery!
- 26:45Building Better Primitives
- 29:20Choosing A New Write Primitive
- 29:54SMC Handler Table
- 31:03SMC Table Extension Attack
- 32:20Arbitrary TZ Code Execution
- 36:03Lessons Learned
related talks
43mBreaking Samsung's ARM TrustZone
19mDisARMed: Attacking ARM TrustZone from Userspace with Memory Aliasing
27mCLKSCREW: Exposing the Perils of Security-Oblivious Energy Management
22mUnearthing the TrustedCore: A Critical Review on Huawei’s Trusted Execution Environment
34mCore Escalation: Unleashing the Power of Cross-Core Attacks on Heterogeneous System
45mExploiting Qualcomm WLAN and Modem Over The Air
36mOut Of The Box Exploitation Breaking The Trust Chain Of The Ethereum Phone
44mCan You Trust Me Now? An Exploration Into the Mobile Threat Landscape
