Abstract
Modern CPU architectures offer strong isolation guarantees towards user applications in the form of enclaves. However, Intel’s threat model for SGX assumes fully trusted enclaves and there doubt about how realistic this is. In particular, it is unclear to what extent enclave malware could harm a system. In this work, we practically demonstrate the first enclave malware which fully and stealthily impersonates its host application. Together with poorly-deployed application isolation on personal computers, such malware can not only steal or encrypt documents for extortion but also act on the user’s behalf, e.g., send phishing emails or mount denial-of-service attacks. Our SGX-ROP attack uses new TSX-based memory-disclosure primitive and a write-anything-anywhere primitive to construct a code-reuse attack from within an enclave which is then inadvertently executed by the host application. With SGX-ROP, we bypass ASLR, stack canaries, and address sanitizer. We demonstrate that instead of protecting users from harm, SGX currently poses a security threat, facilitating so-called super-malware with ready-to-hit exploits. With our results, we demystify the enclave malware threat and lay ground for future research on defenses against enclave malware.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
The implementation can be found at https://github.com/IAIK/sgxrop.
- 2.
References
Adamski, A.: Overview of Intel SGX - Part 2, SGX Externals, August 2018
Andriesse, D., Bos, H.: Instruction-level steganography for covert trigger-based malware. In: Dietrich, S. (ed.) DIMVA 2014. LNCS, vol. 8550, pp. 41–50. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08509-8_3
Arnautov, S., et al.: SCONE: secure Linux containers with Intel SGX. In: OSDI (2016)
Aumasson, J.P., Merino, L.: SGX secure enclaves in practice: security and crypto review. In: Black Hat Briefings (2016)
Bauman, E., Lin, Z.: A case for protecting computer games with SGX. In: Workshop on System Software for Trusted Execution (2016)
Bittau, A., Belay, A., Mashtizadeh, A., Mazières, D., Boneh, D.: Hacking blind. In: S&P (2014)
Borrello, P., Coppa, E., D’Elia, D.C., Demetrescu, C.: The ROP needle: hiding trigger-based injection vectors via code reuse. In: ACM Symposium on Applied Computing (SAC) (2019)
Brasser, F., Müller, U., Dmitrienko, A., Kostiainen, K., Capkun, S., Sadeghi, A.R.: Software grand exposure: SGX cache attacks are practical. In: WOOT (2017)
Brenner, S., Hundt, T., Mazzeo, G., Kapitza, R.: Secure cloud micro services using Intel SGX. In: IFIP International Conference on Distributed Applications and Interoperable Systems (2017)
Gesetz zur effektiveren und praxistauglicheren Ausgestaltung des Strafverfahrens (2017)
Carlini, N., Barresi, A., Payer, M., Wagner, D., Gross, T.R.: Control-flow bending: on the effectiveness of control-flow integrity. In: USENIX Security (2015)
Caulfield, T., Ioannidis, C., Pym, D.: The US vulnerabilities equities process: an economic perspective. In: International Conference on Decision and Game Theory for Security (2017)
Chiueh, T.c., Hsu, F.H.: RAD: a compile-time solution to buffer overflow attacks. In: Conference on Distributed Computing Systems (2001)
Costan, V., Devadas, S.: Intel SGX explained (2016)
Cowan, C., et al.: StackGuard: automatic adaptive detection and prevention of buffer-overflow attacks. In: USENIX Security (1998)
Crandall, J.R., Wassermann, G., de Oliveira, D.A., Su, Z., Wu, S.F., Chong, F.T.: Temporal search: detecting hidden malware timebombs with virtual machines. In: ACM SIGARCH Computer Architecture News, vol. 34 (2006)
Davenport, S., Ford, R.: SGX: the good, the bad and the downright ugly, January 2014. https://www.virusbulletin.com/virusbulletin/2014/01/sgx-good-bad-and-downright-ugly
Dunn, A.M., Hofmann, O.S., Waters, B., Witchel, E.: Cloaking malware with the trusted platform module. In: USENIX Security Symposium (2011)
Egelman, S., Herley, C., Van Oorschot, P.C.: Markets for zero-day exploits: ethics and implications. In: New Security Paradigms Workshop (2013)
Electronic Frontier Foundation: New FBI documents provide details on government’s surveillance spyware (2011)
Guan, L., Lin, J., Luo, B., Jing, J., Wang, J.: Protecting private keys against memory disclosure attacks using hardware transactional memory. In: S&P (2015)
Hall, C.G.: Time sensitivity in cyberweapon reusability. Ph.D. thesis, Monterey. Naval Postgraduate School, California (2017)
Intel: Intel\(\textregistered \) 64 and IA-32 Architectures Software Developer’s Manual, Volume 3 (3A, 3B & 3C): System Programming Guide (325384) (2016)
Intel Corporation: Software Guard Extensions Programming Reference, Rev. 2 (2014)
Intel Corporation: Intel SGX: Debug, Production, Pre-release what’s the difference? January 2016
Intel Corporation: Enclave Signing Key Management, May 2018
Jang, Y., Lee, S., Kim, T.: Breaking kernel address space layout randomization with Intel TSX. In: CCS (2016)
Jiang, X., Wang, X., Xu, D.: Stealthy malware detection through VMM-based out-of-the-box semantic view reconstruction. In: CCS (2007)
King, S., Chen, P.: SubVirt: implementing malware with virtual machines. In: S&P (2006)
Kuvaiskii, D., Faqeh, R., Bhatotia, P., Felber, P., Fetzer, C.: Haft: Hardware-assisted fault tolerance. In: EuroSys (2016)
Lee, J., et al.: Hacking in darkness: Return-oriented programming against secure enclaves. In: USENIX Security (2017)
Leitch, J.: Process hollowing (2013)
Liu, Y., Xia, Y., Guan, H., Zang, B., Chen, H.: Concurrent and consistent virtual machine introspection with hardware transactional memory. In: High Performance Computer Architecture (HPCA) (2014)
Marschalek, M.: The Wolf in SGX Clothing. Bluehat IL, January 2018
Miller, M.: Safely searching process virtual address space (2004)
Marlinspike, M.: technology preview: private contact discovery for signal (2017)
Myers, M., Youndt, S.: An introduction to hardware-assisted virtual machine (HVM) rootkits. Mega Security (2007)
Németh, Z.L., Erdődi, L.: When every byte counts - writing minimal length shellcodes. In: Intelligent Systems and Informatics (SISY) (2015)
Bacca, N.: Soft launching ledger SGX enclave (2017)
Noubir, G., Sanatinia, A.: Trusted code execution on untrusted platforms using Intel SGX. Virus Bulletin (2016)
PaX Team: Address space layout randomization (ASLR) (2003)
PaX Team: RAP: RIP ROP (2015)
Polychronakis, M., Anagnostakis, K.G., Markatos, E.P.: Comprehensive shellcode detection using runtime heuristics. In: ACSAC (2010)
Prakash, A., Yin, H.: Defeating ROP through denial of stack pivot. In: ACSAC (2015)
Russinovich, M.: Sony, rootkits and digital rights management gone too far, October 2005
Rutkowska, J.: Thoughts on Intel’s upcoming Software Guard Extensions (Part 2) (2013)
Schuster, F., Costa, M., Fournet, C., Gkantsidis, C., Peinado, M., Mainar-Ruiz, G., Russinovich, M.: VC3: trustworthy data analytics in the cloud using SGX. In: S&P (2015)
Schwarz, M., Weiser, S., Gruss, D., Maurice, C., Mangard, S.: Malware guard extension: using SGX to conceal cache attacks. In: Polychronakis, M., Meier, M. (eds.) DIMVA 2017. LNCS, vol. 10327, pp. 3–24. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-60876-1_1
Shacham, H.: The geometry of innocent flesh on the bone: return-into-libc without function calls (on the x86). In: CCS (2007)
Sharif, M.I., Lanzi, A., Giffin, J.T., Lee, W.: Impeding malware analysis using conditional code obfuscation. In: NDSS (2008)
Shinde, S., Le Tien, D., Tople, S., Saxena, P.: PANOPLY: Low-TCB Linux applications with SGX enclaves. In: NDSS (2017)
Snow, K.Z., Monrose, F., Davi, L., Dmitrienko, A., Liebchen, C., Sadeghi, A.R.: Just-in-time code reuse: on the effectiveness of fine-grained address space layout randomization. In: S&P (2013)
Stack shield: a stack smashing technique protection tool for Linux (2011)
Strackx, R., Younan, Y., Philippaerts, P., Piessens, F., Lachmund, S., Walter, T.: Breaking the memory secrecy assumption. In: EuroSys (2009)
Szekeres, L., Payer, M., Wei, T., Song, D.: SoK: eternal war in memory. In: S&P (2013)
Theodorides, M., Wagner, D.: Breaking active-set backward-edge CFI. In: Hardware Oriented Security and Trust (HOST) (2017)
Tsai, C.C., Porter, D.E., Vij, M.: Graphene-SGX: a practical library OS for unmodified applications on SGX. In: USENIX ATC (2017)
Vrancken, K., Piessens, F., Strackx, R.: Hardening Intel SGX applications: balancing concerns. In: Workshop on System Software for Trusted Execution (2017)
Weichbrodt, N., Kurmus, A., Pietzuch, P., Kapitza, R.: AsyncShock: exploiting synchronisation bugs in Intel SGX enclaves. In: ESORICS (2016)
Weisse, O., et al.: Foreshadow-NG: breaking the virtual memory abstraction with transient out-of-order execution (2018)
Yan, F., Huang, F., Zhao, L., Peng, H., Wang, Q.: Baseline is fragile: on the effectiveness of stack pivot defense. In: ICPADS (2016)
You, I., Yim, K.: Malware obfuscation techniques: a brief survey. In: Broadband, Wireless Computing, Communication and Applications (2010)
Acknowledgments
This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. 681402). This work was partially supported by the TU Graz LEAD project “Dependable Internet of Things in Adverse Environments”. This work has been supported by the Austrian Research Promotion Agency (FFG) via the K-project DeSSnet, which is funded in the context of COMET – Competence Centers for Excellent Technologies by BMVIT, BMWFW, Styria and Carinthia. Additional funding was provided by a generous gift from Intel. Any opinions, findings, and conclusions or recommendations expressed in this paper are those of the authors and do not necessarily reflect the views of the funding parties.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Schwarz, M., Weiser, S., Gruss, D. (2019). Practical Enclave Malware with Intel SGX. In: Perdisci, R., Maurice, C., Giacinto, G., Almgren, M. (eds) Detection of Intrusions and Malware, and Vulnerability Assessment. DIMVA 2019. Lecture Notes in Computer Science(), vol 11543. Springer, Cham. https://doi.org/10.1007/978-3-030-22038-9_9
Download citation
DOI: https://doi.org/10.1007/978-3-030-22038-9_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-22037-2
Online ISBN: 978-3-030-22038-9
eBook Packages: Computer ScienceComputer Science (R0)