journal article·2022-07-29Open access

SGXDump: A Repeatable Code-Reuse Attack for Extracting SGX Enclave Memory

HanJae Yoon, ManHee Lee

Applied Sciences· Volume 12· Issue 15

Abstract

Intel SGX (Software Guard Extensions) is a hardware-based security solution that provides a trusted computing environment. SGX creates an isolated memory area called enclave and prevents any illegal access from outside of the enclave. SGX only allows executables already linked statically to the enclave when compiling executables to access its memory, so code injection attacks to SGX are not effective. However, as a previous study has demonstrated, Return-Oriented Programming (ROP) attacks can overcome this defense mechanism by injecting a series of addresses of executable codes inside the enclave. In this study, we propose a novel ROP attack, called SGXDump, which can repeat the attack payload. SGXDump consists only of gadgets in the enclave and unlike previous ROP attacks, the SGXDump attack can repeat the attack payload, communicate with other channels, and implement conditional statements. We successfully attacked two well-known SGX projects, mbedTLS-SGX and Graphene-SGX. Based on our attack experiences, it seems highly probable that an SGXDump attack can leak the entire enclave memory if there is an exploitable memory corruption vulnerability in the target SGX application.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Security and Verification in Computing · Diamond and Carbon-based Materials Research · Advanced Memory and Neural Computing

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Laboratory of High Performance and Secure Computing, Department of Computer Engineering, Hannam University, Daejeon 34430, Korea

Funding

National Research Foundation of Korea

References (45)

Show source-provided references
1. Pearson, S., and Balacheff, B. (2003). Trusted Computing Platforms: TCPA Technology in Context, Prentice Hall Professional.
2. Mitchell, C. (2005). Trusted Computing, LET.10.1049/PBPC006E ↗
3. Holdings, A. (2009). ARM Security Technology: Building a Secure System Using TrustZone Technology, ARM Ltd.
4. Innovative instructions and software model for isolated execution
5. Costan, V., and Devadas, S. (2022, July 12). Intel SGX Explained. Available online: https://eprint.iacr.org/2016/086.
6. (2022, July 12). Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux OS. Available online: https://github.com/intel/linux-sgx.
7. Brasser, F., Müller, U., Dmitrienko, A., Kostiainen, K., Capkun, S., and Sadeghi, A.R. (2017, January 14–15). Software grand exposure: SGX cache attacks are practical. Proceedings of the 11th USENIX Workshop on Offensive Technologies (WOOT 17), Vancouver, BC, Canada.
8. Götzfried, J., Eckert, M., Schinzel, S., and Müller, T. (2017, January 23). Cache attacks on Intel SGX. Proceedings of the 10th European Workshop on Systems Security, Belgrade, Serbia.10.1145/3065913.3065915 ↗
9. Moghimi, D., Van Bulck, J., Heninger, N., Piessens, F., and Sunar, B. (2020, January 12–14). CopyCat: Controlled Instruction-Level Attacks on Enclaves. Proceedings of the 29th USENIX Security Symposium (USENIX Security 20), Washington, DC, USA.
10. Van Bulck, J., Minkin, M., Weisse, O., Genkin, D., Kasikci, B., Piessens, F., Silberstein, M., Wenisch, T.F., Yarom, Y., and Strackx, R. (2018, January 15–17). Foreshadow: Extracting the keys to the intel SGX kingdom with transient out-of-order execution. Proceedings of the 27th USENIX Security Symposium (USENIX Security 18), Baltimore, MD, USA.
11. When one vulnerable primitive turns viral: Novel single-trace attacks on ECDSA and RSA10.46586/tches.v2020.i2.196-221 ↗
12. Weiser, S., Spreitzer, R., and Bodner, L. (2018, January 4–8). Single trace attack against RSA key generation in Intel SGX SSL. Proceedings of the 2018 on Asia Conference on Computer and Communications Security, Incheon, Korea.10.1145/3196494.3196524 ↗
13. Van Bulck, J., Piessens, F., and Strackx, R. (2017, January 28). SGX-Step: A practical attack framework for precise enclave execution control. Proceedings of the 2nd Workshop on System Software for Trusted Execution, Shanghai, China.10.1145/3152701.3152706 ↗
14. Lee, J., Jang, J., Jang, Y., Kwak, N., Choi, Y., Choi, C., Kim, T., Peinado, M., and Kang, B.B. (2017, January 16–18). Hacking in darkness: Return-oriented programming against secure enclaves. Proceedings of the 26th USENIX Security Symposium (USENIX Security 17), Vancouver, BC, Canada.
15. Return-oriented programming: Systems, languages, and applications10.1145/2133375.2133377 ↗
16. Checkoway, S., Davi, L., Dmitrienko, A., Sadeghi, A.R., Shacham, H., and Winandy, M. (2010, January 4–8). Return-oriented programming without returns. Proceedings of the 17th ACM Conference On Computer and Communications Security, Chicago, IL, USA.10.1145/1866307.1866370 ↗
17. Bletsch, T., Jiang, X., Freeh, V.W., and Liang, Z. (2011, January 22–24). Jump-oriented programming: A new class of code-reuse attack. Proceedings of the 6th ACM Symposium on Information, Computer and Communications Security, Hong Kong.10.1145/1966913.1966919 ↗
18. Mabon, R. (2016). Sigreturn oriented programming is a real threat. Informatik 2016, Gesellschaft fr Informatik. Lecture Notes in Informatics (LNI).
19. Bittau, A., Belay, A., Mashtizadeh, A., Mazières, D., and Boneh, D. (2014, January 18–21). Hacking blind. Proceedings of the 2014 IEEE Symposium on Security and Privacy, Washington, DC, USA.10.1109/SP.2014.22 ↗
20. Schwarz, M., Weiser, S., and Gruss, D. (2019). Practical enclave malware with Intel SGX. International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment, Springer.10.1007/978-3-030-22038-9_9 ↗
21. Biondo, A., Conti, M., Davi, L., Frassetto, T., and Sadeghi, A.R. (2018, January 15–17). The Guard’s Dilemma: Efficient {Code-Reuse} Attacks Against Intel {SGX}. Proceedings of the 27th USENIX Security Symposium (USENIX Security 18), Baltimore, MD, USA.
22. Toffalini, F., Graziano, M., Conti, M., and Zhou, J. (2021). SnakeGX: A sneaky attack against SGX Enclaves. International Conference on Applied Cryptography and Network Security, Springer.10.1007/978-3-030-78372-3_13 ↗
23. Cui, J., Yu, J.Z., Shinde, S., Saxena, P., and Cai, Z. (2021, January 15–19). SmashEx: Smashing SGX Enclaves Using Exceptions. Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security, Virtual Event.10.1145/3460120.3484821 ↗
24. Aublin, P.L., Kelbert, F., O’keeffe, D., Muthukumaran, D., Priebe, C., Lind, J., Krahn, R., Fetzer, C., Eyers, D., and Pietzuch, P. (2022, July 12). TaLoS: Secure and Transparent TLS Termination inside SGX Enclaves. Available online: https://www.researchgate.net/publication/315715902_TaLoS_Secure_and_Transparent_TLS_Termination_inside_SGX_Enclaves.
25. Tsai, C.C., Porter, D.E., and Vij, M. (2017, January 4). Graphene-sgx: A practical library OS for unmodified applications on SGX. Proceedings of the 2017 USENIX Annual Technical Conference (USENIX ATC 17), Santa Clara, CA, USA.
26. Team, P. (2022, July 12). PaX Address Space Layout Randomization. Available online: http://pax.grsecurity.net/docs/aslr.txt.
27. Seo, J., Lee, B., Kim, S.M., Shih, M.W., Shin, I., Han, D., and Kim, T. (2017). SGX-Shield: Enabling Address Space Layout Randomization for SGX Programs, NDSS.10.14722/ndss.2017.23037 ↗
28. Talluri, M., Hill, M.D., and Khalidi, Y.A. (1995, January 3–6). A new page table for 64-bit address spaces. Proceedings of the Fifteenth ACM Symposium on Operating Systems Principles, Copper Mountain, CO, USA.10.1145/224056.224071 ↗
29. Arpaci-Dusseau, R.H., and Arpaci-Dusseau, A.C. (2018). Operating Systems: Three Easy Pieces, Arpaci-Dusseau Books LLC.
30. A survey of Intel SGX and its applications10.1007/s11704-019-9096-y ↗
31. (2022, July 12). JonathanSalwan. ROPgadget. Available online: https://github.com/JonathanSalwan/ROPgadget.
32. Google (2022, July 12). Asylo: An Open and Flexible Framework for Enclave Applications. Available online: https://asylo.dev/.
33. (2022, July 12). deislabs. Mystikos. Available online: https://github.com/deislabs/mystikos.
34. Bowden, T., Bauer, B., Nerin, J., Feng, S., and Seibold, S. The/proc filesystem. Linux Kernel Documentation, 2000.
35. Schwarz, M. (2022, July 12). PTEditor. Available online: https://github.com/misc0110/PTEditor.
36. MemJam: A False Dependency Attack Against Constant-Time Crypto Implementations10.1007/s10766-018-0611-9 ↗
37. Gyselinck, J., Bulck, J.V., Piessens, F., and Strackx, R. (2018). Off-Limits: Abusing Legacy X86 Memory Segmentation to Spy on Enclaved Execution, Springer.10.1007/978-3-319-94496-8_4 ↗
38. Branchscope: A new side-channel attack on directional branch predictor10.1145/3296957.3173204 ↗
39. Bluethunder: A 2-level Directional Predictor Based Side-Channel Attack against SGX10.46586/tches.v2020.i1.321-347 ↗
40. Lee, S., Shih, M.W., Gera, P., Kim, T., Kim, H., and Peinado, M. (2017, January 16–18). Inferring fine-grained control flow inside SGX enclaves with branch shadowing. Proceedings of the 26th USENIX Security Symposium (USENIX Security 17), Vancouver, BC, Canada.
41. Skarlatos, D., Yan, M., Gopireddy, B., Sprabery, R., Torrellas, J., and Fletcher, C.W. (2019, January 22–26). MicroScope: Enabling Microarchitectural Replay Attacks. Proceedings of the 46th International Symposium on Computer Architecture, Phoenix, AZ, USA.10.1145/3307650.3322228 ↗
42. Xiao, Y., Li, M., Chen, S., and Zhang, Y. (November, January 30). STACCO: Differentially Analyzing Side-Channel Traces for Detecting SSL/TLS Vulnerabilities in Secure Enclaves. Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, Dallas, TX, USA.10.1145/3133956.3134016 ↗
43. Bulck, J.V., Piessens, F., and Strackx, R. (2018, January 15–19). Nemesis: Studying Microarchitectural Timing Leaks in Rudimentary CPU Interrupt Logic. Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, Toronto, ON, Canada.
44. Intel (2022, July 12). Intel Analysis of Speculative Execution Side Channels. Available online: https://newsroom.intel.com/wp-content/uploads/sites/11/2018/01/Intel-Analysis-of-Speculative-Execution-Side-Channels.pdf.
45. Askoxylakis, I., Ioannidis, S., Katsikas, S., and Meadows, C. (2016, January 26–30). AsyncShock: Exploiting Synchronisation Bugs in Intel SGX Enclaves. Proceedings of the Computer Security—ESORICS 2016, Heraklion, Greece.10.1007/978-3-319-45744-4 ↗