HackerPapers

arXiv:2110.06657cs.CR

SmashEx: Smashing SGX Enclaves Using Exceptions

Jinhua Cui, Jason Zhijingcheng Yu, Shweta Shinde, Prateek Saxena, Zhiping Cai

Abstract

Exceptions are a commodity hardware functionality which is central to multi-tasking OSes as well as event-driven user applications. Normally, the OS assists the user application by lifting the semantics of exceptions received from hardware to program-friendly user signals and exception handling interfaces. However, can exception handlers work securely in user enclaves, such as those enabled by Intel SGX, where the OS is not trusted by the enclave code? In this paper, we introduce a new attack called SmashEx which exploits the OS-enclave interface for asynchronous exceptions in SGX. It demonstrates the importance of a fundamental property of safe atomic execution that is required on this interface. In the absence of atomicity, we show that asynchronous exception handling in SGX enclaves is complicated and prone to re-entrancy vulnerabilities. Our attacks do not assume any memory errors in the enclave code, side channels, or application-specific logic flaws. We concretely demonstrate exploits that cause arbitrary disclosure of enclave private memory and code-reuse (ROP) attacks in the enclave. We show reliable exploits on two widely-used SGX runtimes, Intel SGX SDK and Microsoft Open Enclave, running OpenSSL and cURL libraries respectively. We tested a total of 14 frameworks, including Intel SGX SDK and Microsoft Open Enclave, 10 of which are vulnerable. We discuss how the vulnerability manifests on both SGX1-based and SGX2-based platforms. We present potential mitigation and long-term defenses for SmashEx.

arXiv comments
Accepted to ACM CCS 2021
Journal reference
DOI
doi:10.1145/3460120.3484821
Subjects
cs.CRCryptography and Security

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Oct 2021 to Nov 2022.

Comments linking this paper, per year.

Discussed in comments2 threads

  1. How Stuff Gets eXposed 1 comment
    • You're making an apple-to-oranges comparison between TEEs and SGX. The attacks on SGX here are on the processor/model of SGX itself. Buffer overflows are bugs in the applets that run inside the TEE. SGX applications can and do have similar bugs. Here's a random paper I found…

      saagarjhaView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.