Talk

GlobalConfusion: TrustZone Trusted Application 0-Day By Design

conf 2024-11-06 14:05 – 14:50 La Marive EN

GlobalConfusion: TrustZone Trusted Application 0-Day By Design

Trusted Execution Environments form the backbone of mobile device security architectures. The GlobalPlatform Internal Core API is the de-facto standard that unites the fragmented landscape of real-world implementations, providing compatibility between different TEEs. In our research we reveal that this API standard is prone to a design weakness. Manifestations of this weakness result in critical type-confusion bugs in real-world user-space applications of the TEE, called Trusted Applications (TAs). At its core, the design weakness consists of a fail-open design leaving an optional type check for untrusted data to TA developers. The API does not mandate this easily forgettable check that in most cases results in arbitrary read-and-write exploitation primitives. To detect instances of these type-confusion bugs, we design and implement GPCheck, a Ghidra-based static binary analysis system capable of vetting real-world TAs. We employ GPCheck to analyze 14,777 TAs deployed on widely used TEEs to investigate the prevalence of the issue. We reconfirm known bugs that fit this pattern and discover unknown instances of the issue in the wild. In total, we confirmed 9 known bugs, found 10 instances of silently-fixed bugs, and discovered a surprising amount of 14 0-days using our GPCheck prototype. Our findings affect mobile devices currently in use by billions of users. We responsibly disclosed these findings, already received >12,000 USD as bug bounty, and were assigned four CVEs. Ten of our 14 0-days are still in the responsible disclosure process. It comes without surprise that a vulnerability in a single TA impacts the security of the entire device and, thus, vendors must rapidly fix such vulnerabilities and revoke vulnerable versions to prevent rollback attacks, i.e., loading an old version of the TA to exploit a known vulnerability. We will supplement the findings from above with a large-scale study on TA rollback prevention indicating severe deficiencies in the mobile ecosystem regarding the usage of N-days against TEEs.