Transient Execution Attacks - 19

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/17

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:23 PM on 5/1/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

18 Terms

1
New cards

What is the concept behind Transient Execution Attacks?

  • Using speculative execution to execute unprivileged code on a target. Allows the attackers to create side channels.

    • A key technique to leak secrets across privilege domains

2
New cards

What are Privilege domains?

  • Modern computers have plenty security domains

  • TAEs allow to attack victims either:

    • Within the same privilege domain (e.g., process A→process B)

    • Across privilege domains (e.g., process→kernel)

<ul><li><p>Modern computers have plenty security domains </p></li><li><p>TAEs allow to attack victims either: </p><ul><li><p>Within the same privilege domain (e.g., process A→process B) </p></li><li><p>Across privilege domains (e.g., process→kernel)</p></li></ul></li></ul><p></p>
3
New cards

What are Caches?

  • Caches store recently accessed memory

    • Different types of caches (I-Cache vs. D-Cache)

    • Arranged in a cache hierarchy

    • Tackles a key performance bottleneck: memory in DRAM

  • We can build timing side-channels via caches!

    • If a value is in cache, subsequent access will be fast

    • Otherwise, it will be slow

<ul><li><p> Caches store recently accessed memory </p><ul><li><p>Different types of caches (I-Cache vs. D-Cache) </p></li><li><p>Arranged in a cache hierarchy </p></li><li><p>Tackles a key performance bottleneck: memory in DRAM </p></li></ul></li><li><p>We can build timing side-channels via caches! </p><ul><li><p>If a value is in cache, subsequent access will be fast </p></li><li><p>Otherwise, it will be slow</p></li></ul></li></ul><p></p>
4
New cards

What are Branch Predictors?

  • Branch predictors predict potential branch targets

    • Key performance optimizations in modern CPUs

    • Different approaches for direct and indirect branches

  • CPU executes predicted branch targets speculatively

    • Results are architecturally committed when target turns out correct

    • Otherwise discarded

  • Regardless of result, speculative execution leaves traces in the microarchitecture

    • This includes the cache(!)

<ul><li><p>Branch predictors predict potential branch targets </p><ul><li><p>Key performance optimizations in modern CPUs </p></li><li><p>Different approaches for direct and indirect branches </p></li></ul></li><li><p>CPU executes predicted branch targets speculatively </p><ul><li><p>Results are architecturally committed when target turns out correct </p></li><li><p>Otherwise discarded </p></li></ul></li><li><p>Regardless of result, speculative execution leaves traces in the microarchitecture </p><ul><li><p>This includes the cache(!)</p></li></ul></li></ul><p></p>
5
New cards

What is Out of Order Execution?

  • Another key performance optimization, next to speculative execution

    • Hides/minimizes latency (e.g, cache misses, FPU operations, etc)

    • Keeps elements in execution pipeline busy

  • Exploits the fact that in architecture, instructions can be reordered

    • Usually no issue when there are no data dependencies

    • Results are only committed (architecturally) once all operations completed

  • As with speculative execution, leaves data in cache(!)

<ul><li><p>Another key performance optimization, next to speculative execution</p><ul><li><p>Hides/minimizes latency (e.g, cache misses, FPU operations, etc)</p></li><li><p>Keeps elements in execution pipeline busy</p></li></ul></li><li><p>Exploits the fact that in architecture, instructions can be reordered</p><ul><li><p>Usually no issue when there are no data dependencies</p></li><li><p>Results are only committed (architecturally) once all operations completed</p></li></ul></li><li><p>As with speculative execution, leaves data in cache(!)</p></li></ul><p></p>
6
New cards

What is Meltdown?

In essence, we just saw Meltdown. Now what if:

  • 1. We can (transiently) dereference an interesting value inaccessible to us?

  • 2. We can suppress the architectural failure?

  • 3. Exfiltrate the value?

All of this turns out possible on (older) Intel CPUs:

  • 1. Example: Kernel addresses from user space

  • 2. Use custom SIGSEGV handler (or other methods)

  • 3. Flush+Reload

<p>In essence, we just saw Meltdown. Now what if: </p><ul><li><p>1. We can (transiently) dereference an interesting value inaccessible to us? </p></li><li><p>2. We can suppress the architectural failure? </p></li><li><p>3. Exfiltrate the value? </p></li></ul><p>All of this turns out possible on (older) Intel CPUs: </p><ul><li><p>1. Example: Kernel addresses from user space </p></li><li><p>2. Use custom SIGSEGV handler (or other methods) </p></li><li><p>3. Flush+Reload</p></li></ul><p></p>
7
New cards

What are some Common Techniques for Suppressing faults?

  • Custom segfault handlers

    • What we just saw

  • Intel’s Transactional Synchronization Extensions (TSX)

8
New cards

What is TSX?

Intel’s Transactional Synchronization Extensions

  • ISA extension for hardware transactional memory

  • Key idea: allow parallelism via lock elision

  • Data accesses are bundled in transactions

  • If transaction fails:

    • Re-roll and try again (HLE)

    • Jmp to custom handler (RTM)

  • Now disabled for desktop CPUs, still available on (some) Xeon CPUs

9
New cards

What is Spectre?

  • Abuses branch (mis)prediction & speculative execution

    • Access sensitive data transiently

    • Cache Side-Channel to exfiltrate data

  • Full class of attacks

    • New variants are stilled discovered

    • Previously thought mitigated issues turn out to be still exploitable

    • Still an active research topic

10
New cards

What are the steps in the Spectre-v1 (Spectre-PHT) attack?

Attack steps:

1) Train direct branch predictor to take branch

2) Execute target with x out of bounds

  • This will transiently access the value at array1[x]

  • And encode it into array[2]

3) Exfiltrate secret via cache-side channel by probing array2

  • E.g., via FLUSH+RELOAD (not shown in code snippet)

11
New cards

What are some Spectre Variants?

  • V1: Bounds Check Bypass (BCB)

    • aka Spectre-PHT

  • V2: Branch Target Injection (BTI)

    • aka Spectre-BTI

  • V3: Rogue Data Cache Load (RDCL)

    • aka Meltdown

  • V4: Speculative Store Bypass (SSB)

    • aka Spectre-NG

  • ???: Return Mispredict

    • aka Spectre-RSB

12
New cards

What can spectre attacks do?

  • Derandomize KASLR

  • Read data from other processes

  • Read data from the kernel

  • Bypass hardware security features (e.g., arm PAC)

  • Read data from virtual machines on the same physical host

More generally: Transient execution attacks break isolation

13
New cards

What was the impact of spectre and meltdown?

  • Almost every CPU before 2018 vulnerable against Spectre Attacks

    • Software & Microcode mitigations

    • Partially high performance impact

  • Newer CPU have hardware mitigations against some variants

    • Fixing Spectre & Meltdown variants took time

    • Meltdown now fully mitigated in hardware

    • Fixing Spectre completely turned out rather difficult

14
New cards

What are some defences against microarchitectural attacks?

  • Hotfixes and Workarounds

  • Hardware Defenses

  • Systematic Defenses

15
New cards

What is the Hotfixes and Workarounds defence?

  • Intermediate solution after found vulnerabilities

  • Either implemented by:

    • Removing particular gadgets used during attacks

    • Changes to software (e.g., adding speculation barriers via FENCE instructions)

    • Microcode updates (e.g., to disable features or change instruction behavior)

  • Advantage: Fast mitigation of specific attack vector

  • Disadvantages: Performance overhead & may not fully mitigate attacks

16
New cards

What is are Hardware Defenses?

  • Take time to develop

    • CPU design-release cycle takes multiple years

    • As user/typical defender, we have no influence over this

  • Sometimes allow to fully remove vulnerability

    • E.g., in-hardware mitigation Meltdown: Checking of privilege before transient memory loads

  • May not be complete (for performance reasons)

    • E.g., eIBRS against Spectre-BTB, later bypassed via Spectre-BHI*

17
New cards

What are Systematic Defenses?

Less used in practice:

  • Often high performance overhead

  • Major changes to software needed

But some examples:

  • Secret Free Hypervisor*

    • Rendering leaking from the hypervisor inefficient

  • Quarantine**

    • Isolating security domains on different cores

  • Undocumented defenses by cloud vendors

    • E.g., aws

18
New cards

What is Transient Execution and how can attackers abuse this?

Transient Execution changes the microarchitectural state. Even if results are not used architecturally, transient execution leaves traces in the microarchitecture.

Attackers can abuse this to leak information across privilege domains via side-channels.