Abstract
With the significant development of the Internet of Things and low-cost cloud services, the sensory and data processing requirements of IoT systems are continually going up. TrustZone is a hardware-protected Trusted Execution Environment (TEE) for ARM processors specifically designed for IoT handheld systems. It provides memory isolation techniques to protect trusted application data from being exploited by malicious entities. In this work, we focus on identifying different vulnerabilities of the TrustZone extension of ARM Cortex-M processors. Then design and implement a threat model to execute those attacks. We have found that TrustZone is vulnerable to buffer overflow-based attacks. We have used this to create an attack called MOFlow and successfully leaked the data of another trusted app. This is done by intentionally overflowing the memory of one app to access the encrypted memory of other apps inside the secure world. We have also found that, by not validating the input parameters in the entry function, TrustZone has exposed a security weakness. We call this Achilles heel and present an attack model showing how to exploit this weakness too. Our proposed novel attacks are implemented and successfully tested on two recent ARM Cortex-M processors available on the market (M23 and M33).
The TrustZone-M Isolation Gap
The Internet of Things (IoT) relies heavily on ARM TrustZone to create a Trusted Execution Environment (TEE). TrustZone hardware-isolates a "Secure World" (for sensitive tasks like cryptography) from a "Normal World" (for the main OS and apps). While TrustZone for high-power processors (Cortex-A) is well-studied, the version for low-power microcontrollers (TrustZone-M) is fundamentally different. It lacks a cache and relies on a more compact, lightweight design.
As shown in the architecture above, TrustZone-M provides the mechanism for isolation but leaves the responsibility of memory management and input validation entirely to the developer. Because there is no built-in garbage collection or automatic boundary checking, a single poorly written or malicious app in the Secure World can compromise the entire system. The researchers identified that while hardware units like the SAU (Secure Attribute Unit) protect the Secure World from the Normal World, they do not protect secure apps from each other.
Exploiting the Secure World: MOFlow and Achilles’ Heel
The researchers developed a threat model specifically for the Cortex-M architecture and implemented two primary attack vectors:
- MOFlow (Memory Overflow): This attack exploits the fact that multiple applications in the Secure World share the same memory space without "tight coupling" (strict hardware-enforced boundaries between individual secure apps). By intentionally overflowing a buffer in one secure app, the attacker can read or corrupt the memory allocated to a neighboring secure app.
- Achilles’ heel (Input Validation): This attack targets the "Veneer Table" located in the Non-Secure Callable (NSC) region—the entry point where the Normal World calls functions in the Secure World. If the secure function doesn't manually validate the memory addresses passed to it as parameters, an attacker can pass a pointer to a secure memory location. The secure function then unwittingly operates on its own sensitive data and returns it to the Normal World.
Experimental Validation
As this is a systems security study, the researchers evaluated their attacks on physical hardware rather than synthetic datasets. The evaluation platforms included:
- NXP LPC55S69: Featuring a dual-core ARM Cortex-M33.
- Nuvoton M2351: Featuring an ARM Cortex-M23.
- QEMU Emulator: Used for initial feasibility testing and architectural modeling.
The researchers successfully implemented MOFlow on both M23 and M33 hardware, leaking data from one secure app to another and eventually back to the Normal World. They proved that by skipping the SG (Secure Gateway) instruction or passing invalid pointers, they could trigger secure faults or unauthorized memory reads.
Key Findings and Mitigation
The study highlights a critical "Shared Space" trap: unlike desktop environments where processes have virtualized, isolated memory, Secure World apps in TrustZone-M often share a flat memory space. If an attacker can break the bounds of one app, they can access them all. This is particularly dangerous as IoT ecosystems grow and users begin downloading 3rd-party secure apps; a single "buggy" app acts as a Trojan horse.
To address these vulnerabilities, the paper proposes a defense-in-depth architecture featuring a Boundary Verifier and a Leak Collector. The researchers demonstrated that adding a software-based Boundary Verifier in the NSC region can effectively block "Achilles’ heel" attacks by validating all incoming address ranges before they reach the secure core.
Conclusion
While TrustZone-M provides a robust foundation for IoT security, it is not a "silver bullet." The discovery of MOFlow and Achilles' heel demonstrates that software-level vulnerabilities can bypass hardware-level isolation. Future work will involve investigating newer processors like the Cortex-M35P and M55 to determine if Tightly-Coupled Memory (TCM) architectures offer better protection against these memory-variant attacks.
Summary updated