An adversary exploits a hardware design flaw in a CPU implementation of transient instruction execution in which a faulting or assisted load instruction transiently forwards adversary-controlled data from microarchitectural buffers. By inducing a page fault or microcode assist during victim execution, an adversary can force legitimate victim execution to operate on the adversary-controlled data which is stored in the microarchitectural buffers. The adversary can then use existing code gadgets and side channel analysis to discover victim secrets that have not yet been flushed from microarchitectural state or hijack the system control flow.
Description
Attack Execution Flow
Step 1
Explore[Survey target application and relevant OS shared code libraries] Adversary identifies vulnerable transient instruction sets and the code/function calls to trigger them as well as instruction sets or code fragments (gadgets) to perform attack. The adversary looks for code gadgets which will allow them to load an adversary-controlled value into trusted memory. They also look for code gadgets which might operate on this controlled value.
Utilize Disassembler and Debugger tools to examine and trace instruction set execution of source code and shared code libraries on a system.
[Indaga sull'applicazione target e sulle librerie di codice condiviso OS rilevanti] L'avversario identifica set di istruzioni transitori vulnerabili e le chiamate di codice/funzione per attivarli, così come set di istruzioni o frammenti di codice (gadgets) per eseguire l'attacco. L'avversario cerca gadget di codice che consentano di caricare un valore controllato dall'avversario nella memoria affidabile. Cerca anche gadget di codice che potrebbero operare su questo valore controllato.
Utilizza strumenti di Disassembler e Debugger per esaminare e tracciare l'esecuzione del set di istruzioni del codice sorgente e delle librerie di codice condiviso su un sistema.
Attack Techniques
-
Utilize Disassembler and Debugger tools to examine and trace instruction set execution of source code and shared code libraries on a system.
Step 2
Experiment[Fill microarchitectural buffer with controlled value] The adversary will utilize the found code gadget from the previous step to load a value into a microarchitectural buffer.
The adversary may choose the controlled value to be memory address of sensitive information that they want the system to access
The adversary may choose the controlled value to be the memory address of other code gadgets that they wish to execute by hijacking the control flow of the system
[Riempire il buffer microarchitetturale con un valore controllato] L'attaccante utilizzerà il gadget di codice trovato nel passaggio precedente per caricare un valore in un buffer microarchitetturale.
L'attaccante può scegliere che il valore controllato sia l'indirizzo di memoria di informazioni sensibili a cui desidera che il sistema acceda
L'attaccante può scegliere che il valore controllato sia l'indirizzo di memoria di altri gadget di codice che desidera eseguire dirottando il flusso di controllo del sistema
Attack Techniques
-
The adversary may choose the controlled value to be the memory address of other code gadgets that they wish to execute by hijacking the control flow of the system
-
The adversary may choose the controlled value to be memory address of sensitive information that they want the system to accessIT: L'avversario può scegliere il valore controllato come indirizzo di memoria di altri gadget di codice che desidera eseguire, dirottando il flusso di controllo del sistema.
Step 3
Experiment[Set up instruction to page fault or microcode assist] The adversary must manipulate the system such that a page fault or microcode assist occurs when a valid instruction is run. If the instruction that fails is near where the adversary-controlled value was loaded, the system may forward this value from the microarchitectural buffer incorrectly.
When targeting Intel SGX enclaves, adversaries that have privileges can manipulate PTEs to provoke page-fault exceptions or microcode assists.
When targeting Intel SGX enclaves, adversaries can indirectly revoke permissions for enclave code through the âmprotectâ system call
An adversary can evict selected virtual memory pages using legacy interfaces or by increasing physical memory utilization
When attacking a Windows machine, wait until the OS clears the PTE accessed bit. When the page is next accessed, the CPU will always issue a microcode assist for re-setting this bit
Sperimentazione
[Istruzioni di configurazione per page fault o microcode assist] L'avversario deve manipolare il sistema in modo che si verifichi un page fault o un microcode assist quando viene eseguita un'istruzione valida. Se l'istruzione che fallisce si trova vicino al valore controllato dall'avversario, il sistema potrebbe inoltrare erroneamente questo valore dal buffer microarchitetturale.
Quando si targeting gli enclave Intel SGX, gli avversari che possiedono privilegi possono manipolare i PTE per provocare eccezioni di page-fault o microcode assist.
Quando si targeting gli enclave Intel SGX, gli avversari possono revocare indirettamente i permessi per il codice enclave attraverso la system call “mprotect”
Un avversario può evacuare pagine di memoria virtuale selezionate utilizzando interfacce legacy o aumentando l'utilizzo della memoria fisica
Quando si attacca una macchina Windows, attendere che il sistema operativo azzeri il bit accessed dei PTE. Quando la pagina viene successivamente accessata, la CPU emetterà sempre un microcode assist per reimpostare questo bit
Attack Techniques
-
When targeting Intel SGX enclaves, adversaries that have privileges can manipulate PTEs to provoke page-fault exceptions or microcode assists.
-
An adversary can evict selected virtual memory pages using legacy interfaces or by increasing physical memory utilizationIT: Quando si targeting gli enclavi Intel SGX, gli avversari con privilegi possono manipolare i PTEs per provocare eccezioni di page-fault o assist microcodice.
-
When targeting Intel SGX enclaves, adversaries can indirectly revoke permissions for enclave code through the âmprotectâ system callIT: Quando si targeting gli enclavi Intel SGX, gli avversari con privilegi possono manipolare i PTEs per provocare eccezioni di page-fault o assist microcodice.
-
When attacking a Windows machine, wait until the OS clears the PTE accessed bit. When the page is next accessed, the CPU will always issue a microcode assist for re-setting this bitIT: Quando si targeting gli enclavi Intel SGX, gli avversari con privilegi possono manipolare i PTEs per provocare eccezioni di page-fault o assist microcodice.
Step 4
Exploit[Operate on adversary-controlled data] Once the attack has been set up and the page fault or microcode assist occurs, the system operates on the adversary-controlled data.
Influence the system to load sensitive information into microarchitectural state which can be read by the adversary using a code gadget.
Hijack execution by jumping to second stage gadgets found in the address space. By utilizing return-oriented programming, this can chain gadgets together and allow the adversary to execute a sequence of gadgets.
[Operare sui dati controllati dall'avversario] Una volta configurato l'attacco e verificatasi la page fault o l'assist del microcodice, il sistema opera sui dati controllati dall'avversario.
Influenzare il sistema per caricare informazioni sensibili nello stato microarchitetturale che può essere letto dall'avversario utilizzando un gadget di codice.
Dirottare l'esecuzione saltando ai gadget di secondo livello trovati nello spazio di indirizzamento. Utilizzando la return-oriented programming, è possibile concatenare i gadget e consentire all'avversario di eseguire una sequenza di gadget.
Attack Techniques
-
Influence the system to load sensitive information into microarchitectural state which can be read by the adversary using a code gadget.
-
Hijack execution by jumping to second stage gadgets found in the address space. By utilizing return-oriented programming, this can chain gadgets together and allow the adversary to execute a sequence of gadgets.IT: Influenzare il sistema per caricare informazioni sensibili nello stato microarchitetturale che può essere letto dall'attaccante utilizzando un gadget di codice.