Software Guard Extensions Explained

Intel Software Guard Extensions (SGX) is a set of instruction codes implementing trusted execution environment that are built into some Intel central processing units (CPUs). They allow user-level and operating system code to define protected private regions of memory, called enclaves.[1] [2] SGX is designed to be useful for implementing secure remote computation, secure web browsing, and digital rights management (DRM).[3] Other applications include concealment of proprietary algorithms and of encryption keys.

SGX involves encryption by the CPU of a portion of memory (the enclave). Data and code originating in the enclave are decrypted on the fly within the CPU,[4] protecting them from being examined or read by other code,[4] including code running at higher privilege levels such as the operating system and any underlying hypervisors. While this can mitigate many kinds of attacks, it does not protect against side-channel attacks.[5]

A pivot by Intel in 2021 resulted in the deprecation of SGX from the 11th and 12th generation Intel Core Processors, but development continues on Intel Xeon for cloud and enterprise use.[6]

Details

SGX was first introduced in 2015 with the sixth generation Intel Core microprocessors based on the Skylake microarchitecture.

Support for SGX in the CPU is indicated in CPUID "Structured Extended feature Leaf", EBX bit 02,[7] but its availability to applications requires BIOS/UEFI support and opt-in enabling which is not reflected in CPUID bits. This complicates the feature detection logic for applications.[8]

Emulation of SGX was added to an experimental version of the QEMU system emulator in 2014.[9] In 2015, researchers at the Georgia Institute of Technology released an open-source simulator named "OpenSGX".[10]

One example of SGX used in security was a demo application from wolfSSL[11] using it for cryptography algorithms.

Intel Goldmont Plus (Gemini Lake) microarchitecture also contains support for Intel SGX.[12]

Both in the 11th and 12th generations of Intel Core processors, SGX is listed as "Deprecated" and thereby not supported on "client platform" processors.[13] [14] [15] This removed support of playing Ultra HD Blu-ray discs on officially licensed software, such as PowerDVD.[16] [17] [18]

List of SGX vulnerabilities

Prime+Probe attack

On 27 March 2017 researchers at Austria's Graz University of Technology developed a proof-of-concept that can grab RSA keys from SGX enclaves running on the same system within five minutes by using certain CPU instructions in lieu of a fine-grained timer to exploit cache DRAM side-channels.[19] [20] One countermeasure for this type of attack was presented and published by Daniel Gruss et al. at the USENIX Security Symposium in 2017.[21] Among other published countermeasures, one countermeasure to this type of attack was published on September 28, 2017, a compiler-based tool, DR.SGX,[22] that claims to have superior performance with the elimination of the implementation complexity of other proposed solutions.

Spectre-like attack

See main article: Spectre (security vulnerability). The LSDS group at Imperial College London showed a proof of concept that the Spectre speculative execution security vulnerability can be adapted to attack the secure enclave. The Foreshadow attack, disclosed in August 2018, combines speculative execution and buffer overflow to bypass the SGX.[23] A security advisory and mitigation for this attack, also called an L1 Terminal Fault, was originally issued on August 14, 2018 and updated May 11, 2021.[24]

Enclave attack

On 8 February 2019, researchers at Austria's Graz University of Technology published findings which showed that in some cases it is possible to run malicious code from within the enclave itself.[25] The exploit involves scanning through process memory in order to reconstruct a payload, which can then run code on the system. The paper claims that due to the confidential and protected nature of the enclave, it is impossible for antivirus software to detect and remove malware residing within it. Intel issued a statement, stating that this attack was outside the threat model of SGX, that they cannot guarantee that code run by the user comes from trusted sources, and urged consumers to only run trusted code.[26]

MicroScope replay attack

There is a proliferation of side-channel attacks plaguing modern computer architectures. Many of these attacks measure slight, nondeterministic variations in the execution of code, so the attacker needs many, possibly tens of thousands, of measurements to learn secrets. However, the MicroScope attack allows a malicious OS to replay code an arbitrary number of times regardless of the programs actual structure, enabling dozens of side-channel attacks.[27] In July 2022, Intel submitted a Linux patch called AEX-Notify to allow the SGX enclave programmer to write a handler for these types of events.[28]

Plundervolt

Security researchers were able to inject timing specific faults into execution within the enclave, resulting in leakage of information. The attack can be executed remotely, but requiresaccess to the privileged control of the processor's voltage and frequency.[29] A security advisory and mitigation for this attack was originally issued on August 14, 2018 and updated on March 20, 2020.[30]

LVI

See main article: Load value injection. Load Value Injection[31] [32] injects data into a program aiming to replace the value loaded from memory which is then used for a short time before the mistake is spotted and rolled back, during which LVI controls data and control flow. A security advisory and mitigation for this attack was originally issued on March 10, 2020 and updated on May 11, 2021.[33]

SGAxe

SGAxe,[34] an SGX vulnerability published in 2020, extends a speculative execution attack on cache,[35] leaking content of the enclave. This allows an attacker to access private CPU keys used for remote attestation.[36] In other words, a threat actor can bypass Intel's countermeasures to breach SGX enclaves' confidentiality. The SGAxe attack is carried out by extracting attestation keys from SGX's private quoting enclave that are signed by Intel. The attacker can then masquerade as legitimate Intel machines by signing arbitrary SGX attestation quotes.[37] A security advisory and mitigation for this attack, also called a Processor Data Leakage or Cache Eviction, was originally issued January 27, 2020 and updated May 11, 2021.[38]

ÆPIC leak

In 2022, security researchers discovered a vulnerability in the Advanced Programmable Interrupt Controller (APIC) that allows for an attacker with root/admin privileges to gain access to encryption keys via the APIC by inspecting data transfers from L1 and L2 cache.[39] This vulnerability is the first architectural attack discovered on x86 CPUs. This differs from Spectre and Meltdown which use a noisy side channel. This exploit currently affects Intel Core 10th, 11th and 12th generations, and Xeon Ice Lake microprocessors.[40] [41]

SGX malware arguments

There has been a long debate on whether SGX enables creation of superior malware. Oxford University researchers published an article in October 2022[42] considering attackers' potential advantages and disadvantages by abusing SGX for malware development. Researchers conclude that while there might be temporary zero-day vulnerabilities to abuse in SGX ecosystem, the core principles and design features of Trusted Execution Environments (TEEs) make malware weaker than a malware-in-the-wild, TEEs make no major contributions to malware otherwise.

See also

External links

Notes and References

  1. Web site: Intel SGX for Dummies (Intel SGX Design Objectives) . intel.com . 2013-09-26.
  2. Web site: Properly Detecting Intel® Software Guard Extensions (Intel® SGX) in Your Applications. johnm. 2017-08-08. software.intel.com. en. 2019-02-15.
  3. Web site: Intel SGX Details . intel.com . 2017-07-05.
  4. Web site: Researchers Use Intel SGX To Put Malware Beyond the Reach of Antivirus Software - Slashdot. it.slashdot.org. 12 February 2019 .
  5. Web site: Intel SGX and Side-Channels. intel.com . 2020-02-28.
  6. Web site: Rising to the Challenge — Data Security with Intel Confidential Computing. anrilr. 2022-01-20. community.intel.com. en. 2022-04-20.
  7. https://software.intel.com/sites/default/files/managed/07/b7/319433-023.pdf#page=36 Intel Architecture Instruction Set Extensions Programming Reference
  8. Web site: Properly Detecting Intel Software Guard Extensions in Your Applications . intel.com . 2016-05-13.
  9. Web site: Intel SGX Emulation using QEMU . tc.gtisc.gatech.edu . 2018-11-02 .
  10. Web site: sslab-gatech/opensgx . . 2016-08-15.
  11. Web site: wolfSSL At IDF . wolfssl . 2016-08-11.
  12. Web site: Intel® Pentium® Silver J5005 Processor. 2020-07-10.
  13. Web site: New Intel chips won't play Blu-ray disks due to SGX deprecation. 2022-01-17.
  14. Web site: 11th Generation Intel Core Processor Datasheet . 2022-01-15.
  15. Web site: 12th Generation Intel Core Processors Datasheet . 2022-01-15.
  16. Web site: Intel discontinues support for UHD Blu-ray discs in its newest PC chips. Mary Stone. January 21, 2022. whathifi.
  17. Web site: CyberLink Support Center .
  18. https://www.cyberlink.com/stat/help/powerdvd/22/pc-mode/enu/98_01_14_how_to_play_uhdbd.html
  19. News: Chirgwin . Richard . Boffins show Intel's SGX can leak crypto keys . 1 May 2017 . The Register . March 7, 2017.
  20. 1702.08719. Schwarz. Michael. Malware Guard Extension: Using SGX to Conceal Cache Attacks. Weiser. Samuel. Gruss. Daniel. Maurice. Clémentine. Mangard. Stefan. cs.CR. 2017.
  21. Web site: Strong and Efficient Cache Side-Channel Protection using Hardware Transactional Memory . 2017-08-16 . USENIX .
  22. DR.SGX: Hardening SGX Enclaves against Cache Attacks with Data Location Randomization . 2017-09-28 . 1709.09917. Brasser. Ferdinand. Capkun. Srdjan. Dmitrienko. Alexandra. Frassetto. Tommaso. Kostiainen. Kari. Müller. Urs. Sadeghi. Ahmad-Reza. 10.1145/3359789.3359809 . 19364841 . ACSAC '19: Proceedings of the 35th Annual Computer Security Applications Conference December 2019 . 788–800 .
  23. Web site: Peter Bright - Jul 10, 2018 9:00 pm UTC . New Spectre-like attack uses speculative execution to overflow buffers . Ars Technica . 2018-07-10 . 2018-11-02.
  24. Web site: CVE - CVE-2018-3615 . 2022-10-17 . cve.mitre.org.
  25. Schwarz. Michael. Weiser. Samuel. Gruss. Daniel. 2019-02-08. Practical Enclave Malware with Intel SGX. 1902.03256. cs.CR.
  26. Web site: Researchers use Intel SGX to put malware beyond the reach of antivirus software. Bright. Peter. 2019-02-12. Ars Technica. en-us. 2019-02-15.
  27. Book: Skarlatos. Dimitrios. Yan. Mengjia. Gopireddy. Bhargava. Sprabery. Read. Torrellas. Josep. Fletcher. Christopher W.. Proceedings of the 46th International Symposium on Computer Architecture . MicroScope . 2019. Isca '19. en. Phoenix, Arizona. ACM Press. 318–331. 10.1145/3307650.3322228. 978-1-4503-6669-4. free.
  28. Web site: [PATCH] x86/sgx: Allow enclaves to use Asynchrounous Exit Notification ]. 2022-10-17 . lore.kernel.org.
  29. Web site: Plundervolt steals keys from cryptographic algorithms. 2019-12-11. Rambus Blog. en-us. 2020-03-20.
  30. Web site: CVE - CVE-2019-11157 . 2022-10-17 . cve.mitre.org.
  31. Web site: LVI: Hijacking Transient Execution with Load Value Injection. lviattack.eu. 2020-03-12.
  32. Web site: Load Value Injection. software.intel.com. 2020-03-12.
  33. Web site: CVE - CVE-2020-0551 . 2022-10-17 . cve.mitre.org.
  34. Web site: SGAxe. sgaxe.com.
  35. Web site: CacheOut. cacheoutattack.com.
  36. Web site: Towards Formalization of Enhanced Privacy ID (EPID)-based Remote Attestation in Intel SGX.
  37. Web site: 2020-06-12. SGAxe & CrossTalk Attacks: New Intel SGX Vulnerability Leaks Data. 2020-06-12. Hack Reports. en.
  38. Web site: CVE - CVE-2020-0549 . 2022-10-17 . cve.mitre.org.
  39. Web site: 2022-08-16 . Intel SGX: Not So Safe After All, ÆPIC Leak . 2022-08-29 . The New Stack . en-US.
  40. Web site: Wilson . Jason R. . 2022-08-11 . ÆPIC Leak is an Architectural CPU Bug Affecting 10th, 11th, and 12th Gen Intel Core CPUs . 2022-08-29 . Wccftech . en-US.
  41. Web site: ÆPIC Leak . 2022-08-29 . aepicleak.com.
  42. Web site: SoK: How 'Not' to Architect Your Next-Generation TEE Malware . Küçük. Kubilay Ahmet. et. al.. Hardware and Architectural Support for Security and Privacy (HASP) 2022. 2023-04-17. October 2022.