Return-to-Non-Secure Vulnerabilities on ARM Cortex-M TrustZone: Attack and Defense
Zheyuan Ma, Xi Tan, Lukasz Ziarek, Ning Zhang, Hongxin Hu, Ziming Zhao
Abstract
ARM Cortex-M is one of the most popular microcontroller architectures designed for embedded and Internet of Things (IoT) applications. To facilitate efficient execution, it has some unique hardware optimization. In particular, Cortex-M TrustZone has a fast state switch mechanism that allows direct control-flow transfer from the secure state program to the non-secure state userspace program. In this paper, we demonstrate how this fast state switch mechanism can be exploited for arbitrary code execution with escalated privilege in the non-secure state by introducing a new exploitation technique, namely return-to-non-secure (ret2ns). We experimentally confirmed the feasibility of four variants of ret2ns attacks on two Cortex-M hardware systems. To defend against ret2ns attacks, we design two address sanitizing mechanisms that have negligible performance overhead.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
5 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- A Tale of Two Worlds: Assessing the Vulnerability of Enclave Shielding Runtimes cites BOOMERANG: Exploiting the Semantic Gap in Trusted Execution Environments
- SoK: Integrity, Attestation, and Auditing of Program Execution cites SHERLOC: Secure and Holistic Control-Flow Violation Detection on Embedded Systems
- Horizontal Privilege Escalation in Trusted Applications cites BOOMERANG: Exploiting the Semantic Gap in Trusted Execution Environments
- 'We just did not have that on the embedded system': Insights and Challenges for Securing Microcontroller Systems from the Embedded CTF Competitions cites SHERLOC: Secure and Holistic Control-Flow Violation Detection on Embedded Systems
- 'We just did not have that on the embedded system': Insights and Challenges for Securing Microcontroller Systems from the Embedded CTF Competitions cites Protecting Bare-Metal Embedded Systems with Privilege Overlays
- 'We just did not have that on the embedded system': Insights and Challenges for Securing Microcontroller Systems from the Embedded CTF Competitions cites ACES: Automatic Compartments for Embedded Systems
- SHERLOC: Secure and Holistic Control-Flow Violation Detection on Embedded Systems cites ACES: Automatic Compartments for Embedded Systems
- TZ-DATASHIELD: Automated Data Protection for Embedded Systems via Data-Flow-Based Compartmentalization cites Protecting Bare-Metal Embedded Systems with Privilege Overlays
- TZ-DATASHIELD: Automated Data Protection for Embedded Systems via Data-Flow-Based Compartmentalization cites ACES: Automatic Compartments for Embedded Systems
- XCFI: Comprehensive Control-Flow Integrity for Arm TrustZone-M cites SHERLOC: Secure and Holistic Control-Flow Violation Detection on Embedded Systems
- XCFI: Comprehensive Control-Flow Integrity for Arm TrustZone-M cites TZ-DATASHIELD: Automated Data Protection for Embedded Systems via Data-Flow-Based Compartmentalization
- ACES: Automatic Compartments for Embedded Systems cites Protecting Bare-Metal Embedded Systems with Privilege Overlays
Cited by top-tier papers5
- SHERLOC: Secure and Holistic Control-Flow Violation Detection on Embedded SystemsXi Tan, Ziming ZhaoCCS 2023 · 13 citations
- SoK: Integrity, Attestation, and Auditing of Program ExecutionMahmoud Ammar, Adam Caulfield, Ivan De Oliveira NunesS&P 2025
- 'We just did not have that on the embedded system': Insights and Challenges for Securing Microcontroller Systems from the Embedded CTF CompetitionsZheyuan Ma, Gaoxiang Liu, Alex Eastman, Kai Kaufman et al.CCS 2025
- TZ-DATASHIELD: Automated Data Protection for Embedded Systems via Data-Flow-Based CompartmentalizationZelun Kong, Minkyung Park, Le Guan, Ning Zhang et al.NDSS 2025
- XCFI: Comprehensive Control-Flow Integrity for Arm TrustZone-MYunju Gu, Jaeyeol Park, Donghyun KwonUSENIX Security 2026
Builds on5
- A Tale of Two Worlds: Assessing the Vulnerability of Enclave Shielding RuntimesJo Van Bulck, David F. Oswald, Eduard Marin, Abdulla Aldoseri et al.CCS 2019 · 159 citations
- Protecting Bare-Metal Embedded Systems with Privilege OverlaysAbraham A. Clements, Naif Saleh Almakhdhub, Khaled Saab, Prashast Srivastava et al.S&P 2017 · 122 citations
- BOOMERANG: Exploiting the Semantic Gap in Trusted Execution EnvironmentsAravind Machiry, Eric Gustafson, Chad Spensky, Christopher Salls et al.NDSS 2017 · 119 citations
- ACES: Automatic Compartments for Embedded SystemsAbraham A. Clements, Naif Saleh Almakhdhub, Saurabh Bagchi, Mathias PayerUSENIX Security 2018 · 89 citations
- Horizontal Privilege Escalation in Trusted ApplicationsDarius Suciu, Stephen E. McLaughlin, Laurent Simon, Radu SionUSENIX Security 2020
Related papers
- ReZone: Disarming TrustZone with TEE Privilege ReductionDavid Cerdeira, José Martins, Nuno Santos, Sandro PintoUSENIX Security 2022
- M-Step: A Single-Stepping Framework for Side-Channel Analysis on TrustZone-MCristiano Rodrigues, Marton Bognar, Sandro Pinto, Jo Van BulckUSENIX Security 2026
- BUSted!!! Microarchitectural Side-Channel Attacks on the MCU Bus InterconnectCristiano Rodrigues, Daniel Oliveira, Sandro PintoS&P 2024 · 15 citations
- µRAI: Securing Embedded Systems with Return Address IntegrityNaif Saleh Almakhdhub, Abraham A. Clements, Saurabh Bagchi, Mathias PayerNDSS 2020
- CLKSCREW: Exposing the Perils of Security-Oblivious Energy ManagementAdrian Tang, Simha Sethumadhavan, Salvatore J. StolfoUSENIX Security 2017
