OBFUSCURO: : A Commodity Obfuscation Engine for Intel SGX
Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang, Insik Shin, Byoungyoung Lee
(* denotes equal contribution)
OBFUSCURO : : A Commodity Obfuscation Engine for Intel SGX Adil - - PowerPoint PPT Presentation
OBFUSCURO : : A Commodity Obfuscation Engine for Intel SGX Adil Ahmad *, Byunggill Joe*, Yuan Xiao Yinqian Zhang, Insik Shin, Byoungyoung Lee (* denotes equal contribution) Program Obfuscation Program Obfuscation Trusted Untrusted (except
Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang, Insik Shin, Byoungyoung Lee
(* denotes equal contribution)
Trusted Untrusted (except the Black box) Senderβs Goal Protect the internals of private program πΈππππ
Encryption Engine Trusted Untrusted (except the Black box) Senderβs Goal Protect the internals of private program πΈππππ
Encryption Engine
Trusted Untrusted (except the Black box) Senderβs Goal Protect the internals of private program πΈππππ
Encryption Engine
Attacker chooses inputs π½0 π½1 π½π
β¦
Trusted Untrusted (except the Black box) Senderβs Goal Protect the internals of private program πΈππππ
Encryption Engine
Untrusted System
Attacker chooses inputs π½0 π½1 π½π
β¦
Trusted Untrusted (except the Black box)
Senderβs Goal Protect the internals of private program πΈππππ
Encryption Engine
Untrusted System
Attacker chooses inputs π½0 π½1 π½π
β¦
Trusted Untrusted (except the Black box)
Senderβs Goal Protect the internals of private program πΈππππ Receiverβs Goal Disclose the internals
Encryption Engine
Untrusted System
Attacker chooses inputs π½0 π½1 π½π
β¦
Trusted Untrusted (except the Black box)
If the black box is βsecureβ? Senderβs Goal Protect the internals of private program πΈππππ Receiverβs Goal Disclose the internals
Output
Encryption Engine
Untrusted System
Attacker chooses inputs π½0 π½1 π½π
β¦ After constant time πΌ
Trusted Untrusted (except the Black box)
If the black box is βsecureβ? Senderβs Goal Protect the internals of private program πΈππππ Receiverβs Goal Disclose the internals
Output
Encryption Engine
Untrusted System
Observable execution traces
Attacker chooses inputs π½0 π½1 π½π
β¦
Ξ¦0 Ξ¦1 Ξ¦π
β¦ After constant time πΌ
Trusted Untrusted (except the Black box)
If the black box is βsecureβ? Senderβs Goal Protect the internals of private program πΈππππ Receiverβs Goal Disclose the internals
Execution traces should not leak information about πΈππππ
3
Program
3
Program Non- Enclave Enclave
3
Program Non- Enclave Enclave Confidentiality and integrity guarantees Trusted execution region
3
Program Non- Enclave Enclave
(and other untrusted software)
Restricted by the processor Confidentiality and integrity guarantees Trusted execution region
3
4
4
Enclave
4
Enclave Memory accessed by the enclave
4
Enclave Memory accessed by the enclave
Access Frame #
0x1000
Page Table
cache-set 0 cache-set 3
CPU Cache
Taken Address
0x1000
Branch Target Buffer
Visible traces on untrusted/shared components! Timing
4
Enclave Memory accessed by the enclave
Access Frame #
0x1000
Page Table
cache-set 0 cache-set 3
CPU Cache
Taken Address
0x1000
Branch Target Buffer
Visible traces on untrusted/shared components!
Granularity: 4KB (1 page)
Timing
4
Enclave Memory accessed by the enclave
Access Frame #
0x1000
Page Table
cache-set 0 cache-set 3
CPU Cache
Taken Address
0x1000
Branch Target Buffer
Visible traces on untrusted/shared components!
Granularity: 4KB (1 page) Granularity: 64B (1 line)
Timing
4
Enclave Memory accessed by the enclave
Access Frame #
0x1000
Page Table
cache-set 0 cache-set 3
CPU Cache
Taken Address
0x1000
Branch Target Buffer
Visible traces on untrusted/shared components!
Granularity: 4KB (1 page) Granularity: Jmp address Granularity: 64B (1 line)
Timing
4
Enclave Memory accessed by the enclave
Access Frame #
0x1000
Page Table
cache-set 0 cache-set 3
CPU Cache
Taken Address
0x1000
Branch Target Buffer
Visible traces on untrusted/shared components!
Granularity: 4KB (1 page) Granularity: Jmp address Granularity: 64B (1 line)
Timing
Granularity: Execution Time
4
Enclave Memory accessed by the enclave
Access Frame #
0x1000
Page Table
[S&P14, SEC17, ASPLOS18, DIMVA17, WOOT17]
cache-set 0 cache-set 3
CPU Cache
Taken Address
0x1000
Branch Target Buffer
Visible traces on untrusted/shared components!
Granularity: 4KB (1 page) Granularity: Jmp address Granularity: 64B (1 line)
Timing
Granularity: Execution Time
5
5
Transactional Memory
[NDSS17, SEC17]
5
Possible Soln.
Incomplete
Transactional Memory
[NDSS17, SEC17]
5
Possible Soln.
Incomplete ring-0 required
Cache Partitioning
[SEC18]
Transactional Memory
[NDSS17, SEC17]
5
Possible Soln.
Incomplete ring-0 required Insecure
Cache Partitioning
[SEC18]
Address Randomization
[NDSS17]
Transactional Memory
[NDSS17, SEC17]
5
Lesson #1 Ring-3 enclaves cannot hide access patterns through side-channels!
Possible Soln.
Incomplete ring-0 required Insecure
Cache Partitioning
[SEC18]
Address Randomization
[NDSS17]
Transactional Memory
[NDSS17, SEC17]
5
Lesson #1 Ring-3 enclaves cannot hide access patterns through side-channels!
Possible Soln.
Incomplete ring-0 required Insecure
Cache Partitioning
[SEC18]
Address Randomization
[NDSS17]
Transactional Memory
[NDSS17, SEC17]
RDTSC
5
Lesson #1 Ring-3 enclaves cannot hide access patterns through side-channels!
OS-controllable
Possible Soln. Possible Soln.
Incomplete ring-0 required Insecure
Cache Partitioning
[SEC18]
Address Randomization
[NDSS17]
Transactional Memory
[NDSS17, SEC17]
RDTSC Network timers
5
Lesson #1 Ring-3 enclaves cannot hide access patterns through side-channels!
OS-controllable OS-controllable
Possible Soln. Possible Soln.
Incomplete ring-0 required Insecure
Cache Partitioning
[SEC18]
Address Randomization
[NDSS17]
Transactional Memory
[NDSS17, SEC17]
RDTSC Network timers Thread timers
5
Lesson #1 Ring-3 enclaves cannot hide access patterns through side-channels!
OS-controllable OS-controllable OS-controllable
Possible Soln. Possible Soln.
Incomplete ring-0 required Insecure
Cache Partitioning
[SEC18]
Address Randomization
[NDSS17]
Transactional Memory
[NDSS17, SEC17]
RDTSC Network timers Thread timers
5
Lesson #1 Ring-3 enclaves cannot hide access patterns through side-channels! Lesson #2 Unreliable timers for SGX enclaves!
OS-controllable OS-controllable OS-controllable
Possible Soln. Possible Soln.
Incomplete ring-0 required Insecure
Cache Partitioning
[SEC18]
Address Randomization
[NDSS17]
6
6
6
6
6
C-Pad
64B
D-Pad
64B
# of executions: 0
6
C-Pad
64B
D-Pad
64B
Single data access # of executions: 0
6
C-Pad
64B
D-Pad
64B
Branch to the start of C-Pad Single data access # of executions: 0 1
6
C-Pad
64B
D-Pad
64B
Branch to the start of C-Pad Single data access # of executions: 0 1
6
C-Pad
64B
D-Pad
64B
Branch to the start of C-Pad Single data access # of executions: 0 1 N
6
C-Pad
64B
D-Pad
64B
Branch to the start of C-Pad Single data access
What do the attacks reveal?
# of executions: 0 1 N
6
C-Pad
64B
D-Pad
64B
Branch to the start of C-Pad Single data access
What do the attacks reveal?
Paging Attack: Same page # of executions: 0 1 N
6
C-Pad
64B
D-Pad
64B
Branch to the start of C-Pad Single data access
What do the attacks reveal?
Cache Attack: Same cache-lines Paging Attack: Same page # of executions: 0 1 N
6
C-Pad
64B
D-Pad
64B
Branch to the start of C-Pad Single data access
What do the attacks reveal?
Cache Attack: Same cache-lines Branch Attack: Same branch Paging Attack: Same page # of executions: 0 1 N
6
C-Pad
64B
D-Pad
64B
Branch to the start of C-Pad Single data access
What do the attacks reveal?
Cache Attack: Same cache-lines Branch Attack: Same branch Paging Attack: Same page Timing Attack: Same time to execute N code blocks # of executions: 0 1 N
6
C-Pad
64B
D-Pad
64B
Branch to the start of C-Pad Single data access
What do the attacks reveal?
Cache Attack: Same cache-lines Branch Attack: Same branch Paging Attack: Same page Timing Attack: Same time to execute N code blocks # of executions: 0 1 N Instead of trying to hide traces,
7
7
Pattern Pattern
Before (Native)
7
Pattern Pattern
Before (Native)
7
Pattern Pattern
Before (Native) After (Obfuscuro)
7
8
8
8
C-Pad 64B
Enclave Storage
Foo Bar Main
Translator
D-Pad
64B
8
C-Pad 64B
Enclave Storage
Foo Bar Main 56B 78B 67B
Translator
not in 64B blocks!
D-Pad
64B
8
C-Pad 64B
Enclave Storage
Foo Bar Main 56B 78B 67B
Translator
not in 64B blocks!
leaked while copying!
D-Pad
64B
Foo Bar
8
C-Pad 64B
Enclave Storage
Foo Bar Main 56B 78B 67B
Translator
not in 64B blocks!
leaked while copying!
Foo jmp jmp Bar jmp
different branches!
D-Pad
64B
Foo Bar
8
C-Pad 64B
Enclave Storage
Foo Bar Main 56B 78B 67B
Translator
not in 64B blocks!
leaked while copying!
Foo jmp jmp Bar jmp
different branches!
not even discussed!
D-Pad
64B
Foo Bar
9
Code Controller Data Controller
stash
D-Tree
C-Pad
64B
D-Pad
64B
stash
ORAM Bank
C-Tree
Code execution model Data access model
10
10
10
Native
90B
10
Native
Obfuscuro Compiler 90B
10
Native
Obfuscuro Compiler 90B
Instrumented
NOPs 38 bytes
26 bytes 64B 64 bytes
Split Foo()
10
Native
Obfuscuro Compiler 90B
Instrumented
NOPs 38 bytes
26 bytes 64B 64 bytes
Split Foo()
11
11
11
ORAM Bank
C-Tree
C-Pad 64B Code Controller
stash
11
ORAM Bank
C-Tree
C-Pad 64B Code Controller
stash
1
Execute old code block
11
ORAM Bank
C-Tree
C-Pad 64B Code Controller
stash
Request new code block
2 1
Execute old code block
11
ORAM Bank
C-Tree
C-Pad 64B Code Controller
stash
Request new code block
2 1
Execute old code block Retrieve the block using ORAM
3
11
ORAM Bank
C-Tree
C-Pad 64B Code Controller
stash
Request new code block
2 1
Execute old code block Retrieve the block using ORAM
3
Instrumented code is located in C-Tree
11
ORAM Bank
C-Tree
C-Pad 64B Code Controller
stash
Request new code block
2 1
Execute old code block Update C-Pad with new code block
4
Retrieve the block using ORAM
3
Instrumented code is located in C-Tree
Foo.1
11
ORAM Bank
C-Tree
C-Pad 64B Code Controller
stash
Request new code block
2 1
Execute old code block Update C-Pad with new code block
4
Retrieve the block using ORAM
3
Execute new code block
5
Instrumented code is located in C-Tree
Foo.1
11
ORAM Bank
C-Tree
C-Pad 64B Code Controller
stash
Request new code block
2 1
Execute old code block Update C-Pad with new code block
4
Retrieve the block using ORAM
3
Execute new code block
5
Instrumented code is located in C-Tree
Foo.1
12
12
12
Code execution model Data access model
jmp jmp Data Controller
stash
Code Controller
stash
add sub imul
CPU-bound instructions
12
Code execution model Data access model
jmp jmp Data Controller
stash
Code Controller
stash
add sub imul
CPU-bound instructions
Fixed
Fixed
12
Code execution model Data access model
jmp jmp Data Controller
stash
Code Controller
stash
add sub imul
CPU-bound instructions
Fixed
Fixed
C/D-Controller have no conditional branches!
12
Code execution model Data access model
jmp jmp Data Controller
stash
Code Controller
stash
add sub imul
CPU-bound instructions
Fixed
Fixed
C/D-Controller have no conditional branches!
13
13
13
ORAM Bank C-Tree
C-Pad 64B Code Controller
stash
13
ORAM Bank C-Tree
C-Pad 64B Code Controller
stash
Request next code block
1
Contains dummy but indistinguishable code blocks
13
ORAM Bank C-Tree
C-Pad 64B Code Controller
stash
Request next code block
1 2
Retrieve the next block
Contains dummy but indistinguishable code blocks
13
ORAM Bank C-Tree
C-Pad 64B Code Controller
stash
Request next code block
1 3 2
Return to C-Pad Retrieve the next block
Contains dummy but indistinguishable code blocks
13
ORAM Bank C-Tree
C-Pad 64B Code Controller
stash
Request next code block
1 3 2 Term
Return to C-Pad Retrieve the next block
After N blocks
Contains dummy but indistinguishable code blocks
13
ORAM Bank C-Tree
C-Pad 64B Code Controller
stash
Request next code block
1 3 2 Term 4
Return to C-Pad Fetches output and exits enclave! Retrieve the next block
After N blocks
Contains dummy but indistinguishable code blocks
13
ORAM Bank C-Tree
C-Pad 64B Code Controller
stash
Request next code block
1 3 2 Term 4
Return to C-Pad Fetches output and exits enclave! Retrieve the next block
After N blocks
14
14
DRAM CPU
AVX registers
14
64B
Code Controller
stash
DRAM CPU
DRAM-based store
AVX registers
Have to sequentially access all memory indices
14
64B
Code Controller
stash
DRAM CPU
DRAM-based store Register-based store
AVX registers
Have to sequentially access all memory indices Can access individual registers obliviously!
14
64B
Code Controller
stash
DRAM CPU
DRAM-based store Register-based store
AVX registers
Have to sequentially access all memory indices Can access individual registers obliviously!
14
64B
Code Controller
stash
15
15
(C1)
(C3)
15
(C1)
(C3)
(C2)
(C4)
15
(C1)
(C3)
(C2)
(C4)
(support)
16
100 200 300
16 27 68 85 121 231 Overhead (times) Programs
16
100 200 300
16 27 68 85 121 231 Overhead (times) Programs We ported ~10 simple applications to Obfuscuro!
16
100 200 300
16 27 68 85 121 231 Overhead (times) Programs Average overhead
native programs! We ported ~10 simple applications to Obfuscuro!
16
100 200 300
16 27 68 85 121 231 Overhead (times) Programs Average overhead
native programs! The overhead is highly dependent on input size and program type! We ported ~10 simple applications to Obfuscuro!
17
17
17
17
17
18
19
cycles Code block with instructions
General programs