Copycat: Controlled Instruction-Level Attacks on Enclaves • Daniel Moghimi • Jo Van Bulck • Nadia Heninger • Frank Piessens • Berk Sunar

Copycat: Controlled Instruction-Level Attacks on Enclaves • Daniel Moghimi • Jo Van Bulck • Nadia Heninger • Frank Piessens • Berk Sunar

CopyCat: Controlled Instruction-Level Attacks on Enclaves • Daniel Moghimi • Jo Van Bulck • Nadia Heninger • Frank Piessens • Berk Sunar Intel Labs – Sept. 10 2020 OS/Hypervisor Security Model App App App OS Hypervisor Trusted Hardware Traditional Security Model 2 Trusted Execution Environment (TEE) – Intel SGX • Intel Software Guard eXtensions (SGX) App App App App App App OS OS Hypervisor Hypervisor Trusted Hardware Hardware Traditional Security Model Traditional Security Model 3 Trusted Execution Environment (TEE) – Intel SGX • Intel Software Guard eXtensions (SGX) • Enclave: Hardware protected user-level software module • Mapped by the Operating System • Loaded by the user program • Authenticated and Encrypted by CPU App App App OS Hypervisor Hardware Traditional Security Model 4 Trusted Execution Environment (TEE) – Intel SGX • Intel Software Guard eXtensions (SGX) • Enclave: Hardware protected user-level software module • Mapped by the Operating System • Loaded by the user program • Authenticated and Encrypted by CPU App App App • Protects against system level adversary OS blocked blocked Hypervisor New Attacker Model: Hardware Attacker gets full control over OS Traditional Security Model 5 Intel SGX Attack Taxonomy • Intel’s Responsibility SGX Attacks • Microcode Patches / Hardware mitigation • TCB Recovery • Old Keys are Revoked Intel’s • Remote attestation succeeds only with mitigation. Responsibility Hyperthreading is out • Foreshadow [1] • Remote Attestation Warning Plundervolt [2] [1] Van Bulck et al. "Foreshadow: Extracting the keys to the intel SGX kingdom with transient out-of-order execution." USENIX Security 2018. [2] Murdock et al. "Plundervolt: Software-based fault injection attacks against Intel SGX." IEEE S&P 2020. 6 Intel SGX Attack Taxonomy • Intel’s Responsibility SGX Attacks • Microcode Patches / Hardware mitigation • TCB Recovery • Old Keys are Revoked Intel’s Software Dev • Remote attestation succeeds only with mitigation. Responsibility Responsibility Hyperthreading is out • Foreshadow [1] • Remote Attestation Warning Plundervolt [2] [1] Van Bulck et al. "Foreshadow: Extracting the keys to the intel SGX kingdom with transient out-of-order execution." USENIX Security 2018. [2] Murdock et al. "Plundervolt: Software-based fault injection attacks against Intel SGX." IEEE S&P 2020. 7 Intel SGX Attack Taxonomy • Intel’s Responsibility SGX Attacks • Microcode Patches / Hardware mitigation • TCB Recovery • Old Keys are Revoked Intel’s Software Dev • Remote attestation succeeds only with mitigation. Responsibility Responsibility Hyperthreading is out • Foreshadow [1] • Remote Attestation Warning µarch Side Plundervolt [2] Channel • µarch Side Channel Cache [3][4][5] • Constant-time Coding Branch Predictors • Flushing and Isolating buffers [6][7] • Probabilistic Interrupt Latency [8] [1] Van Bulck et al. "Foreshadow: Extracting the keys to the intel SGX kingdom with transient out-of-order execution." USENIX Security 2018. [6] Evtyushkin, Dmitry, et al. "Branchscope: A new side-channel attack on directional branch predictor." ACM SIGPLAN 2018. [2] Murdock et al. "Plundervolt: Software-based fault injection attacks against Intel SGX." IEEE S&P 2020. [7] Lee, Sangho, et al. "Inferring fine-grained control flow inside {SGX} enclaves with branch shadowing." USENIX Security 2017. [3] Moghimi et al. "Cachezoom: How SGX amplifies the power of cache attacks." CHES 2017. [8] Van Bulck et al. "Nemesis: Studying microarchitectural timing leaks in rudimentary CPU interrupt logic." ACM CCS 2018. [4] Brasser et al. "Software grand exposure:{SGX} cache attacks are practical." USENIX WOOT 2017. [5] Schwarz et al. "Malware guard extension: Using SGX to conceal cache attacks." DIMVA 2017. 8 Intel SGX Attack Taxonomy • Intel’s Responsibility SGX Attacks • Microcode Patches / Hardware mitigation • TCB Recovery • Old Keys are Revoked Intel’s Software Dev • Remote attestation succeeds only with mitigation. Responsibility Responsibility Hyperthreading is out • Foreshadow [1] • Remote Attestation Warning µarch Side Deterministic Plundervolt [2] Channel – Ctrl Channel • µarch Side Channel Cache [3][4][5] Page Fault [9] • Constant-time Coding Branch Predictors A/D Bit [10] • Flushing and Isolating buffers [6][7] • Probabilistic Interrupt Latency [8] • Deterministic Attacks • Page Fault, A/D Bit, etc. (4kB Granularity) [1] Van Bulck et al. "Foreshadow: Extracting the keys to the intel SGX kingdom with transient out-of-order execution." USENIX Security 2018. [6] Evtyushkin, Dmitry, et al. "Branchscope: A new side-channel attack on directional branch predictor." ACM SIGPLAN 2018. [2] Murdock et al. "Plundervolt: Software-based fault injection attacks against Intel SGX." IEEE S&P 2020. [7] Lee, Sangho, et al. "Inferring fine-grained control flow inside {SGX} enclaves with branch shadowing." USENIX Security 2017. [3] Moghimi et al. "Cachezoom: How SGX amplifies the power of cache attacks." CHES 2017. [8] Van Bulck et al. "Nemesis: Studying microarchitectural timing leaks in rudimentary CPU interrupt logic." ACM CCS 2018. [4] Brasser et al. "Software grand exposure:{SGX} cache attacks are practical." USENIX WOOT 2017. [9] Xu et al. "Controlled-channel attacks: Deterministic side channels for untrusted operating systems." IEEE S&P 2015. [5] Schwarz et al. "Malware guard extension: Using SGX to conceal cache attacks." DIMVA 2017. [10] Wang, Wenhao, et al. "Leaky cauldron on the dark land: Understanding memory side-channel hazards in SGX." ACM CCS 2017. 9 CopyCat Attack 10 CopyCat Attack • Malicious OS controls the interrupt handler NOP ADD XOR MUL DIV ADD MUL NOP NOP Enclave Execution Time Thread Starts 11 CopyCat Attack • Malicious OS controls the interrupt handler IRQ Range NOP ADD XOR MUL DIV ADD MUL NOP NOP 푡1 푡2 Time 12 CopyCat Attack • Malicious OS controls the interrupt handler IRQ Range 3 4 NOP ADD XOR MUL DIV ADD MUL NOP NOP 푡1 푡2 Time 13 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions IRQ Range 0 1 NOP ADD XOR MUL DIV ADD MUL NOP NOP 푡1 푡2 Time 14 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions IRQ Range 0 NOP ADD XOR MUL DIV ADD MUL NOP NOP 푡1 푡2 Time 15 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions IRQ Range NOP ADD XOR MUL DIV ADD MUL NOP NOP 푡1 푡2 Time 16 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions IRQ Range 1 NOP ADD XOR MUL DIV ADD MUL NOP NOP 푡1 푡2 Time 17 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions IRQ Range 0 1 NOP ADD XOR MUL DIV ADD MUL NOP NOP 푡1 푡2 Time 18 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions IRQ Range 0 1 NOP ADD XOR MUL DIV ADD MUL NOP NOP 푡1 푡2 Time 19 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions IRQ Range 0 1 NOP ADD XOR MUL DIV ADD MUL NOP NOP 푡1 푡2 Time 20 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions I got 15 IRQs. How many zeros? 21 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions • Filtering Zeros out: Clear the A bit before, Check the A bit after I got 15 IRQs. How many Code Page Virtual Address zeros? 0x000401 Page PMH Walk DTLB R U Physical Page P … A … … W S Number R U Physical Page P … A … … W S Number R U Physical Page P … A … … W S Number The A Bit is only set when an instruction is retired 22 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions • Filtering Zeros out: Clear the A bit before, Check the A bit after • Deterministic Instruction Counting 23 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions • Filtering Zeros out: Clear the A bit before, Check the A bit after • Deterministic Instruction Counting • Counting from start to end is not useful. • A Secondary oracle • Page table attack as a deterministic secondary oracle Target Code Page CALL ADD XOR MUL PUSH ADD MUL MOV NOP Time 24 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions • Filtering Zeros out: Clear the A bit before, Check the A bit after • Deterministic Instruction Counting • Counting from start to end is not useful. • A Secondary oracle • Page table attack as a deterministic secondary oracle Stack Target 4 Steps Code Page Page CALL ADD XOR MUL PUSH ADD MUL MOV NOP Time 25 CopyCat Attack • Malicious OS controls the interrupt handler • A threshold to execute 1 or 0 instructions • Filtering Zeros out: Clear the A bit before, Check the A bit after • Deterministic Instruction Counting • Counting from start to end is not useful. • A Secondary oracle • Page table attack as a deterministic secondary oracle Stack Target 4 Steps 3 Steps Data Code Page Page Page CALL ADD XOR MUL PUSH ADD MUL MOV NOP Time 26 CopyCat Attack • Previous Controlled Channel attacks leak Page Access Patterns Page A Page D Page B Page C Traditional Page-table Attacks 27 CopyCat Attack • Previous Controlled Channel attacks leak Page Access Patterns • CopyCat additionally leaks number of instructions per page Page A Page A Page D 4 4 Page D Page B 6 Page B Additional Data Page C 8 Page C Traditional CopyCat Page-table Attack Attacks 28 CopyCat – Leaking Branches Stack

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    67 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us