Skip to main content

Practical Enclave Malware with Intel SGX

  • Conference paper
  • First Online:
Detection of Intrusions and Malware, and Vulnerability Assessment (DIMVA 2019)

Part of the book series: Lecture Notes in Computer Science ((LNSC,volume 11543))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    The implementation can be found at https://github.com/IAIK/sgxrop.

  2. 2.

    https://github.com/oscarlab/graphene.

References

  1. Adamski, A.: Overview of Intel SGX - Part 2, SGX Externals, August 2018

    Google Scholar 

  2. 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

    Chapter  Google Scholar 

  3. Arnautov, S., et al.: SCONE: secure Linux containers with Intel SGX. In: OSDI (2016)

    Google Scholar 

  4. Aumasson, J.P., Merino, L.: SGX secure enclaves in practice: security and crypto review. In: Black Hat Briefings (2016)

    Google Scholar 

  5. Bauman, E., Lin, Z.: A case for protecting computer games with SGX. In: Workshop on System Software for Trusted Execution (2016)

    Google Scholar 

  6. Bittau, A., Belay, A., Mashtizadeh, A., Mazières, D., Boneh, D.: Hacking blind. In: S&P (2014)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. Gesetz zur effektiveren und praxistauglicheren Ausgestaltung des Strafverfahrens (2017)

    Google Scholar 

  11. 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)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. Chiueh, T.c., Hsu, F.H.: RAD: a compile-time solution to buffer overflow attacks. In: Conference on Distributed Computing Systems (2001)

    Google Scholar 

  14. Costan, V., Devadas, S.: Intel SGX explained (2016)

    Google Scholar 

  15. Cowan, C., et al.: StackGuard: automatic adaptive detection and prevention of buffer-overflow attacks. In: USENIX Security (1998)

    Google Scholar 

  16. 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)

    Article  Google Scholar 

  17. 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

  18. Dunn, A.M., Hofmann, O.S., Waters, B., Witchel, E.: Cloaking malware with the trusted platform module. In: USENIX Security Symposium (2011)

    Google Scholar 

  19. Egelman, S., Herley, C., Van Oorschot, P.C.: Markets for zero-day exploits: ethics and implications. In: New Security Paradigms Workshop (2013)

    Google Scholar 

  20. Electronic Frontier Foundation: New FBI documents provide details on government’s surveillance spyware (2011)

    Google Scholar 

  21. 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)

    Google Scholar 

  22. Hall, C.G.: Time sensitivity in cyberweapon reusability. Ph.D. thesis, Monterey. Naval Postgraduate School, California (2017)

    Google Scholar 

  23. Intel: Intel\(\textregistered \) 64 and IA-32 Architectures Software Developer’s Manual, Volume 3 (3A, 3B & 3C): System Programming Guide (325384) (2016)

    Google Scholar 

  24. Intel Corporation: Software Guard Extensions Programming Reference, Rev. 2 (2014)

    Google Scholar 

  25. Intel Corporation: Intel SGX: Debug, Production, Pre-release what’s the difference? January 2016

    Google Scholar 

  26. Intel Corporation: Enclave Signing Key Management, May 2018

    Google Scholar 

  27. Jang, Y., Lee, S., Kim, T.: Breaking kernel address space layout randomization with Intel TSX. In: CCS (2016)

    Google Scholar 

  28. Jiang, X., Wang, X., Xu, D.: Stealthy malware detection through VMM-based out-of-the-box semantic view reconstruction. In: CCS (2007)

    Google Scholar 

  29. King, S., Chen, P.: SubVirt: implementing malware with virtual machines. In: S&P (2006)

    Google Scholar 

  30. Kuvaiskii, D., Faqeh, R., Bhatotia, P., Felber, P., Fetzer, C.: Haft: Hardware-assisted fault tolerance. In: EuroSys (2016)

    Google Scholar 

  31. Lee, J., et al.: Hacking in darkness: Return-oriented programming against secure enclaves. In: USENIX Security (2017)

    Google Scholar 

  32. Leitch, J.: Process hollowing (2013)

    Google Scholar 

  33. 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)

    Google Scholar 

  34. Marschalek, M.: The Wolf in SGX Clothing. Bluehat IL, January 2018

    Google Scholar 

  35. Miller, M.: Safely searching process virtual address space (2004)

    Google Scholar 

  36. Marlinspike, M.: technology preview: private contact discovery for signal (2017)

    Google Scholar 

  37. Myers, M., Youndt, S.: An introduction to hardware-assisted virtual machine (HVM) rootkits. Mega Security (2007)

    Google Scholar 

  38. Németh, Z.L., Erdődi, L.: When every byte counts - writing minimal length shellcodes. In: Intelligent Systems and Informatics (SISY) (2015)

    Google Scholar 

  39. Bacca, N.: Soft launching ledger SGX enclave (2017)

    Google Scholar 

  40. Noubir, G., Sanatinia, A.: Trusted code execution on untrusted platforms using Intel SGX. Virus Bulletin (2016)

    Google Scholar 

  41. PaX Team: Address space layout randomization (ASLR) (2003)

    Google Scholar 

  42. PaX Team: RAP: RIP ROP (2015)

    Google Scholar 

  43. Polychronakis, M., Anagnostakis, K.G., Markatos, E.P.: Comprehensive shellcode detection using runtime heuristics. In: ACSAC (2010)

    Google Scholar 

  44. Prakash, A., Yin, H.: Defeating ROP through denial of stack pivot. In: ACSAC (2015)

    Google Scholar 

  45. Russinovich, M.: Sony, rootkits and digital rights management gone too far, October 2005

    Google Scholar 

  46. Rutkowska, J.: Thoughts on Intel’s upcoming Software Guard Extensions (Part 2) (2013)

    Google Scholar 

  47. 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)

    Google Scholar 

  48. 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

    Chapter  Google Scholar 

  49. Shacham, H.: The geometry of innocent flesh on the bone: return-into-libc without function calls (on the x86). In: CCS (2007)

    Google Scholar 

  50. Sharif, M.I., Lanzi, A., Giffin, J.T., Lee, W.: Impeding malware analysis using conditional code obfuscation. In: NDSS (2008)

    Google Scholar 

  51. Shinde, S., Le Tien, D., Tople, S., Saxena, P.: PANOPLY: Low-TCB Linux applications with SGX enclaves. In: NDSS (2017)

    Google Scholar 

  52. 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)

    Google Scholar 

  53. Stack shield: a stack smashing technique protection tool for Linux (2011)

    Google Scholar 

  54. Strackx, R., Younan, Y., Philippaerts, P., Piessens, F., Lachmund, S., Walter, T.: Breaking the memory secrecy assumption. In: EuroSys (2009)

    Google Scholar 

  55. Szekeres, L., Payer, M., Wei, T., Song, D.: SoK: eternal war in memory. In: S&P (2013)

    Google Scholar 

  56. Theodorides, M., Wagner, D.: Breaking active-set backward-edge CFI. In: Hardware Oriented Security and Trust (HOST) (2017)

    Google Scholar 

  57. Tsai, C.C., Porter, D.E., Vij, M.: Graphene-SGX: a practical library OS for unmodified applications on SGX. In: USENIX ATC (2017)

    Google Scholar 

  58. Vrancken, K., Piessens, F., Strackx, R.: Hardening Intel SGX applications: balancing concerns. In: Workshop on System Software for Trusted Execution (2017)

    Google Scholar 

  59. Weichbrodt, N., Kurmus, A., Pietzuch, P., Kapitza, R.: AsyncShock: exploiting synchronisation bugs in Intel SGX enclaves. In: ESORICS (2016)

    Chapter  Google Scholar 

  60. Weisse, O., et al.: Foreshadow-NG: breaking the virtual memory abstraction with transient out-of-order execution (2018)

    Google Scholar 

  61. Yan, F., Huang, F., Zhao, L., Peng, H., Wang, Q.: Baseline is fragile: on the effectiveness of stack pivot defense. In: ICPADS (2016)

    Google Scholar 

  62. You, I., Yim, K.: Malware obfuscation techniques: a brief survey. In: Broadband, Wireless Computing, Communication and Applications (2010)

    Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Michael Schwarz .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics