obfuscuro: a commodity obfuscation engine for intel sgx · 2020-08-03 · obfuscuro: a commodity...

116
OBFUSCURO : A Commodity Obfuscation Engine for Intel SGX Adil Ahmad *, Byunggill Joe*, Yuan Xiao Yinqian Zhang, Insik Shin, Byoungyoung Lee (* denotes equal contribution)

Upload: others

Post on 14-Aug-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX

Adil Ahmad*, Byunggill Joe*, Yuan Xiao

Yinqian Zhang, Insik Shin, Byoungyoung Lee

(* denotes equal contribution)

Page 2: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

Page 3: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

𝑷𝒑𝒓𝒊𝒗

Trusted Untrusted (except the Black box)

Sender’s Goal Protect the internals of private program 𝑷𝒑𝒓𝒊𝒗

Page 4: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

𝑷𝒑𝒓𝒊𝒗

EncryptionEngine

Trusted Untrusted (except the Black box)

Sender’s Goal Protect the internals of private program 𝑷𝒑𝒓𝒊𝒗

Page 5: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

𝑷𝒑𝒓𝒊𝒗

EncryptionEngine

𝑷𝒑𝒓𝒊𝒗

Trusted Untrusted (except the Black box)

Sender’s Goal Protect the internals of private program 𝑷𝒑𝒓𝒊𝒗

Page 6: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

𝑷𝒑𝒓𝒊𝒗

EncryptionEngine

𝑷𝒑𝒓𝒊𝒗

Attacker chooses inputs𝐼0 𝐼1 𝐼𝑁…

Trusted Untrusted (except the Black box)

Sender’s Goal Protect the internals of private program 𝑷𝒑𝒓𝒊𝒗

Page 7: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

𝑷𝒑𝒓𝒊𝒗

EncryptionEngine

UntrustedSystem

𝑷𝒑𝒓𝒊𝒗

Attacker chooses inputs𝐼0 𝐼1 𝐼𝑁…

Trusted Untrusted (except the Black box)

Blackbox

Sender’s Goal Protect the internals of private program 𝑷𝒑𝒓𝒊𝒗

Page 8: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

𝑷𝒑𝒓𝒊𝒗

EncryptionEngine

UntrustedSystem

𝑷𝒑𝒓𝒊𝒗

Attacker chooses inputs𝐼0 𝐼1 𝐼𝑁…

Trusted Untrusted (except the Black box)

Blackbox

Sender’s Goal Protect the internals of private program 𝑷𝒑𝒓𝒊𝒗

Receiver’s Goal Disclose the internals

of program 𝑷𝒑𝒓𝒊𝒗

Page 9: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

𝑷𝒑𝒓𝒊𝒗

EncryptionEngine

UntrustedSystem

𝑷𝒑𝒓𝒊𝒗

Attacker chooses inputs𝐼0 𝐼1 𝐼𝑁…

Trusted Untrusted (except the Black box)

Blackbox

If the black box is “secure”?

Sender’s Goal Protect the internals of private program 𝑷𝒑𝒓𝒊𝒗

Receiver’s Goal Disclose the internals

of program 𝑷𝒑𝒓𝒊𝒗

Page 10: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

Output

𝑷𝒑𝒓𝒊𝒗

EncryptionEngine

UntrustedSystem

𝑷𝒑𝒓𝒊𝒗

Attacker chooses inputs𝐼0 𝐼1 𝐼𝑁…

After constant time 𝑻

Trusted Untrusted (except the Black box)

Blackbox

If the black box is “secure”?

Sender’s Goal Protect the internals of private program 𝑷𝒑𝒓𝒊𝒗

Receiver’s Goal Disclose the internals

of program 𝑷𝒑𝒓𝒊𝒗

Page 11: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Program Obfuscation

Output

𝑷𝒑𝒓𝒊𝒗

EncryptionEngine

UntrustedSystem

Observable execution traces𝑷𝒑𝒓𝒊𝒗

Attacker chooses inputs𝐼0 𝐼1 𝐼𝑁…

Φ0 Φ1 Φ𝑁…

After constant time 𝑻

Trusted Untrusted (except the Black box)

Blackbox

If the black box is “secure”?

Sender’s Goal Protect the internals of private program 𝑷𝒑𝒓𝒊𝒗

Receiver’s Goal Disclose the internals

of program 𝑷𝒑𝒓𝒊𝒗

Execution traces should not leak information about 𝑷𝒑𝒓𝒊𝒗

Page 12: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Wait, isn’t that what Intel SGX does?

3

Page 13: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Wait, isn’t that what Intel SGX does?Program

3

Page 14: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Wait, isn’t that what Intel SGX does?Program

Non-Enclave

Enclave

3

Page 15: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Wait, isn’t that what Intel SGX does?Program

Non-Enclave

Enclave

Confidentiality and integrityguarantees

Trusted executionregion

3

Page 16: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Wait, isn’t that what Intel SGX does?Program

Non-Enclave

Enclave

Operating System (and other untrusted software)

Restricted by the processor

Confidentiality and integrityguarantees

Trusted executionregion

3

Page 17: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

4

Intel SGX is not perfect!

Page 18: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

4

Enclave

Intel SGX is not perfect!

Page 19: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

4

Enclave

Memory accessedby the enclave

Intel SGX is not perfect!

Page 20: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

4

Enclave

Memory accessedby the enclave

Access Frame #0 0x1000

Page Tablecache-set 0

cache-set 3

CPU CacheTaken Address

0 0x1000

Branch Target Buffer

Intel SGX is not perfect!

Visible traces on untrusted/shared components!

Timing

Page 21: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

4

Enclave

Memory accessedby the enclave

Access Frame #0 0x1000

Page Tablecache-set 0

cache-set 3

CPU CacheTaken Address

0 0x1000

Branch Target Buffer

Intel SGX is not perfect!

Operating System

Visible traces on untrusted/shared components!

Granularity: 4KB (1 page)

Timing

Page 22: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

4

Enclave

Memory accessedby the enclave

Access Frame #0 0x1000

Page Tablecache-set 0

cache-set 3

CPU CacheTaken Address

0 0x1000

Branch Target Buffer

Intel SGX is not perfect!

Operating System

Visible traces on untrusted/shared components!

Granularity: 4KB (1 page)

Granularity: 64B (1 line)

Timing

Page 23: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

4

Enclave

Memory accessedby the enclave

Access Frame #0 0x1000

Page Tablecache-set 0

cache-set 3

CPU CacheTaken Address

0 0x1000

Branch Target Buffer

Intel SGX is not perfect!

Operating System

Visible traces on untrusted/shared components!

Granularity: 4KB (1 page)

Granularity: Jmp address

Granularity: 64B (1 line)

Timing

Page 24: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

4

Enclave

Memory accessedby the enclave

Access Frame #0 0x1000

Page Tablecache-set 0

cache-set 3

CPU CacheTaken Address

0 0x1000

Branch Target Buffer

Intel SGX is not perfect!

Operating System

Visible traces on untrusted/shared components!

Granularity: 4KB (1 page)

Granularity: Jmp address

Granularity: 64B (1 line)

Timing

Granularity: Execution Time

Page 25: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

4

Enclave

Memory accessedby the enclave

Access Frame #0 0x1000

Page Table

Paging, Branch-prediction and Cache attacks![S&P14, SEC17, ASPLOS18, DIMVA17, WOOT17]

cache-set 0

cache-set 3

CPU CacheTaken Address

0 0x1000

Branch Target Buffer

Intel SGX is not perfect!

Operating System

Visible traces on untrusted/shared components!

Granularity: 4KB (1 page)

Granularity: Jmp address

Granularity: 64B (1 line)

Timing

Granularity: Execution Time

Page 26: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Learning from existing solutions!

5

Page 27: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Learning from existing solutions!

5

Access patterns attacks!

Page 28: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Transactional Memory

[NDSS17, SEC17]

Learning from existing solutions!

5

Access patterns attacks!

Possible Soln.

Incomplete

Page 29: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Transactional Memory

[NDSS17, SEC17]

Learning from existing solutions!

5

Access patterns attacks!

Possible Soln.

Incomplete ring-0 required

Cache Partitioning

[SEC18]

Page 30: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Transactional Memory

[NDSS17, SEC17]

Learning from existing solutions!

5

Access patterns attacks!

Possible Soln.

Incomplete ring-0 required Insecure

Cache Partitioning

[SEC18]

Address Randomization

[NDSS17]

Page 31: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Transactional Memory

[NDSS17, SEC17]

Learning from existing solutions!

5

Lesson #1 Ring-3 enclaves cannot hide access

patterns through side-channels!

Access patterns attacks!

Possible Soln.

Incomplete ring-0 required Insecure

Cache Partitioning

[SEC18]

Address Randomization

[NDSS17]

Page 32: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Transactional Memory

[NDSS17, SEC17]

Learning from existing solutions!

5

Lesson #1 Ring-3 enclaves cannot hide access

patterns through side-channels!

Access patterns attacks! Timing attacks!

Possible Soln.

Incomplete ring-0 required Insecure

Cache Partitioning

[SEC18]

Address Randomization

[NDSS17]

Page 33: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Transactional Memory

[NDSS17, SEC17]RDTSC

Learning from existing solutions!

5

Lesson #1 Ring-3 enclaves cannot hide access

patterns through side-channels!

Access patterns attacks! Timing attacks!

OS-controllable

Possible Soln.Possible Soln.

Incomplete ring-0 required Insecure

Cache Partitioning

[SEC18]

Address Randomization

[NDSS17]

Page 34: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Transactional Memory

[NDSS17, SEC17]RDTSC

Networktimers

Learning from existing solutions!

5

Lesson #1 Ring-3 enclaves cannot hide access

patterns through side-channels!

Access patterns attacks! Timing attacks!

OS-controllable OS-controllable

Possible Soln.Possible Soln.

Incomplete ring-0 required Insecure

Cache Partitioning

[SEC18]

Address Randomization

[NDSS17]

Page 35: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Transactional Memory

[NDSS17, SEC17]RDTSC

Networktimers

Threadtimers

Learning from existing solutions!

5

Lesson #1 Ring-3 enclaves cannot hide access

patterns through side-channels!

Access patterns attacks! Timing attacks!

OS-controllable OS-controllable OS-controllable

Possible Soln.Possible Soln.

Incomplete ring-0 required Insecure

Cache Partitioning

[SEC18]

Address Randomization

[NDSS17]

Page 36: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Transactional Memory

[NDSS17, SEC17]RDTSC

Networktimers

Threadtimers

Learning from existing solutions!

5

Lesson #1 Ring-3 enclaves cannot hide access

patterns through side-channels!

Lesson #2Unreliable timers for SGX

enclaves!

Access patterns attacks! Timing attacks!

OS-controllable OS-controllable OS-controllable

Possible Soln.Possible Soln.

Incomplete ring-0 required Insecure

Cache Partitioning

[SEC18]

Address Randomization

[NDSS17]

Page 37: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

Page 38: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)

Page 39: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

Page 40: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

Page 41: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

C-Pad

64B

D-Pad

64B

# of executions: 0

Page 42: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

C-Pad

64B

D-Pad

64B

Single data access

# of executions: 0

Page 43: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

C-Pad

64B

D-Pad

64B

Branch to the start of C-Pad Single data

access

# of executions: 01

Page 44: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

C-Pad

64B

D-Pad

64B

Branch to the start of C-Pad Single data

access

# of executions: 01

Page 45: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

C-Pad

64B

D-Pad

64B

Branch to the start of C-Pad Single data

access

# of executions: 01N

Page 46: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

C-Pad

64B

D-Pad

64B

Branch to the start of C-Pad Single data

access

What do the attacks reveal?# of executions: 01N

Page 47: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

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: 01N

Page 48: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

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: 01N

Page 49: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

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: 01N

Page 50: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

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: 01N

Page 51: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Our approach

6

• Indistinguishable enclave program(s)• A code block executed N times on C-Pad, and data block accessed from D-Pad

• C-Pad and D-Pad are one cache-line (64B) in size!

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: 01N Instead of trying to hide traces, all enclaves should leak the same traces!

Page 52: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Let Hermione explain!

7

Page 53: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Let Hermione explain!

𝑬𝒏𝒄𝒍𝒂𝒗𝒆𝟏

𝑬𝒏𝒄𝒍𝒂𝒗𝒆𝟐

Operating System

7

Page 54: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Let Hermione explain!

𝑬𝒏𝒄𝒍𝒂𝒗𝒆𝟏

𝑬𝒏𝒄𝒍𝒂𝒗𝒆𝟐

Operating System

Pat

tern

Pat

tern

Before(Native)

7

Page 55: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Let Hermione explain!

𝑬𝒏𝒄𝒍𝒂𝒗𝒆𝟏

𝑬𝒏𝒄𝒍𝒂𝒗𝒆𝟐

Operating System

Pat

tern

Pat

tern

Before(Native)

Obfuscuro

7

Page 56: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Let Hermione explain!

𝑬𝒏𝒄𝒍𝒂𝒗𝒆𝟏

𝑬𝒏𝒄𝒍𝒂𝒗𝒆𝟐

Operating System

Pat

tern

Pat

tern

Before(Native)

After(Obfuscuro)

Obfuscuro

7

Page 57: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Cool, what’s the challenge?

8

Page 58: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Cool, what’s the challenge?

8

• Naïve solution• Use a software-translator to copy all code and data onto C/D-Pad

Page 59: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Cool, what’s the challenge?

8

C-Pad

64B

Enclave Storage

• Naïve solution• Use a software-translator to copy all code and data onto C/D-Pad

Foo

Bar

Main

Translator

D-Pad

64B

Page 60: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Cool, what’s the challenge?

8

C-Pad

64B

Enclave Storage

• Naïve solution• Use a software-translator to copy all code and data onto C/D-Pad

Foo

Bar

Main

56B

78B

67B

Translator

C1. Native code is not in 64B blocks!

D-Pad

64B

Page 61: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Cool, what’s the challenge?

8

C-Pad

64B

Enclave Storage

• Naïve solution• Use a software-translator to copy all code and data onto C/D-Pad

Foo

Bar

Main

56B

78B

67B

Translator

C1. Native code is not in 64B blocks!

C2. Access patterns leaked while copying!

D-Pad

64B

FooBar

Page 62: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Cool, what’s the challenge?

8

C-Pad

64B

Enclave Storage

• Naïve solution• Use a software-translator to copy all code and data onto C/D-Pad

Foo

Bar

Main

56B

78B

67B

Translator

C1. Native code is not in 64B blocks!

C2. Access patterns leaked while copying!

Foojmpjmp

Barjmp

C3. Code can havedifferent branches!

D-Pad

64B

FooBar

Page 63: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Cool, what’s the challenge?

8

C-Pad

64B

Enclave Storage

• Naïve solution• Use a software-translator to copy all code and data onto C/D-Pad

Foo

Bar

Main

56B

78B

67B

Translator

C1. Native code is not in 64B blocks!

C2. Access patterns leaked while copying!

Foojmpjmp

Barjmp

C3. Code can havedifferent branches!

C4. Timing issues not even discussed!

D-Pad

64B

FooBar

Page 64: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Obfuscuro

• Program obfuscation on Intel SGX• All programs should exhibit same patterns irrespective of logic/input.

• Adapted from Harry Potter spell “Obscuro” (translation :> Darkness)

9

Code Controller

Data Controller

stash

pos. map

D-Tree

C-Pad

64B

D-Pad

64B

stash

pos. map

ORAM BankC-Tree

Code execution model

Data access model

Page 65: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C1. Enforce code blocks of identical sizes

10

Page 66: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C1. Enforce code blocks of identical sizes

10

• Break code blocks into 64 bytes and pad using nop

Page 67: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C1. Enforce code blocks of identical sizes

10

• Break code blocks into 64 bytes and pad using nop

Foo()

Native

90B

Page 68: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C1. Enforce code blocks of identical sizes

10

• Break code blocks into 64 bytes and pad using nop

Foo()

Native

ObfuscuroCompiler90B

Page 69: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C1. Enforce code blocks of identical sizes

10

• Break code blocks into 64 bytes and pad using nop

Foo()

Native

ObfuscuroCompiler90B

Foo.1()

Instrumented

64B

NOPs 38 bytes

26 bytes64B

64 bytes

Foo.2()Split Foo()

Page 70: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C1. Enforce code blocks of identical sizes

10

• Break code blocks into 64 bytes and pad using nop

Foo()

Native

ObfuscuroCompiler90B

Foo.1()

Instrumented

64B

NOPs 38 bytes

26 bytes64B

64 bytes

Foo.2()Split Foo()

64B (single cache-line) code blocks can be loaded onto the C-Pad!

Page 71: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

Page 72: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

• Fetch code and data using Oblivious RAM (ORAM)• The code and data is fetched onto C-Pad and D-Pad resp.

Page 73: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

• Fetch code and data using Oblivious RAM (ORAM)• The code and data is fetched onto C-Pad and D-Pad resp.

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Page 74: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

• Fetch code and data using Oblivious RAM (ORAM)• The code and data is fetched onto C-Pad and D-Pad resp.

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

1

Execute old code block

Page 75: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

• Fetch code and data using Oblivious RAM (ORAM)• The code and data is fetched onto C-Pad and D-Pad resp.

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request new code block

2

1

Execute old code block

Page 76: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

• Fetch code and data using Oblivious RAM (ORAM)• The code and data is fetched onto C-Pad and D-Pad resp.

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request new code block

2

1

Execute old code block

Retrieve the blockusing ORAM

3

Page 77: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

• Fetch code and data using Oblivious RAM (ORAM)• The code and data is fetched onto C-Pad and D-Pad resp.

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request new code block

2

1

Execute old code block

Retrieve the blockusing ORAM

3

Instrumented code is located in C-Tree

Page 78: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

• Fetch code and data using Oblivious RAM (ORAM)• The code and data is fetched onto C-Pad and D-Pad resp.

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request new code block

2

1

Execute old code block

Update C-Pad withnew code block

4

Retrieve the blockusing ORAM

3

Instrumented code is located in C-Tree

Foo.1

Page 79: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

• Fetch code and data using Oblivious RAM (ORAM)• The code and data is fetched onto C-Pad and D-Pad resp.

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request new code block

2

1

Execute old code block

Update C-Pad withnew code block

4

Retrieve the blockusing ORAM

3

Execute new code block

5

Instrumented code is located in C-Tree

Foo.1

Page 80: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C2. Securely loading C/D-Pad

11

• Fetch code and data using Oblivious RAM (ORAM)• The code and data is fetched onto C-Pad and D-Pad resp.

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request new code block

2

1

Execute old code block

Update C-Pad withnew code block

4

Retrieve the blockusing ORAM

3

Execute new code block

5

Instrumented code is located in C-Tree

Foo.1

Side-channel-resistant ORAM scheme ensuresno leakage as C/D-Pad are loaded!

Page 81: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C3. Align branches to/from C-Pad

12

Page 82: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C3. Align branches to/from C-Pad

12

• Each instrumented code block has two branches to fixed locations• C-Pad Code-Controller

• C-Pad Data-Controller

Page 83: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C3. Align branches to/from C-Pad

12

• Each instrumented code block has two branches to fixed locations• C-Pad Code-Controller

• C-Pad Data-Controller Code execution model

Data access model

C-Pad

jmp

jmp

Data Controller

stash

pos. map

Code Controller

stash

pos. map

addsub imul

CPU-boundinstructions

Page 84: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C3. Align branches to/from C-Pad

12

• Each instrumented code block has two branches to fixed locations• C-Pad Code-Controller

• C-Pad Data-Controller Code execution model

Data access model

C-Pad

jmp

jmp

Data Controller

stash

pos. map

Code Controller

stash

pos. map

Src. A Dst. A

addsub imul

CPU-boundinstructions

Dst. BSrc. B

FixedDst. Addr.

Fixed Src. Addr.

Page 85: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C3. Align branches to/from C-Pad

12

• Each instrumented code block has two branches to fixed locations• C-Pad Code-Controller

• C-Pad Data-Controller Code execution model

Data access model

C-Pad

jmp

jmp

Data Controller

stash

pos. map

Code Controller

stash

pos. map

Src. A Dst. A

addsub imul

CPU-boundinstructions

Dst. BSrc. B

FixedDst. Addr.

Fixed Src. Addr.

C/D-Controller have no conditional

branches!

Page 86: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C3. Align branches to/from C-Pad

12

• Each instrumented code block has two branches to fixed locations• C-Pad Code-Controller

• C-Pad Data-Controller Code execution model

Data access model

C-Pad

jmp

jmp

Data Controller

stash

pos. map

Code Controller

stash

pos. map

Src. A Dst. A

addsub imul

CPU-boundinstructions

Dst. BSrc. B

FixedDst. Addr.

Fixed Src. Addr.

C/D-Controller have no conditional

branches!

All Obfuscuro programs execute the same sequence of branches!

Page 87: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C4. Ensuring execution time consistency

13

Page 88: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C4. Ensuring execution time consistency

13

• The program executes fixed number of code blocks

Page 89: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C4. Ensuring execution time consistency

13

• The program executes fixed number of code blocks

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Page 90: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

C4. Ensuring execution time consistency

13

• The program executes fixed number of code blocks

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request next code block

1

Page 91: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Contains dummy but indistinguishable code

blocks

C4. Ensuring execution time consistency

13

• The program executes fixed number of code blocks

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request next code block

1

2

Retrieve thenext block

Page 92: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Contains dummy but indistinguishable code

blocks

C4. Ensuring execution time consistency

13

• The program executes fixed number of code blocks

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request next code block

1

3

2

Return to C-Pad Retrieve thenext block

Page 93: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Contains dummy but indistinguishable code

blocks

C4. Ensuring execution time consistency

13

• The program executes fixed number of code blocks

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request next code block

1

3

2

Term

Return to C-Pad Retrieve thenext block

After N blocks

Page 94: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Contains dummy but indistinguishable code

blocks

C4. Ensuring execution time consistency

13

• The program executes fixed number of code blocks

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request next code block

1

3

2

Term 4

Return to C-Pad

Fetches output and exits enclave!

Retrieve thenext block

After N blocks

Page 95: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Contains dummy but indistinguishable code

blocks

C4. Ensuring execution time consistency

13

• The program executes fixed number of code blocks

ORAM Bank

C-TreeC-Pad

64B

Code Controller

stash

pos. map

Request next code block

1

3

2

Term 4

Return to C-Pad

Fetches output and exits enclave!

Retrieve thenext block

After N blocks

Execute N code blocks to ensure all programs terminate consistently!

Page 96: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Faster memory store for enclaves

14

Page 97: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Faster memory store for enclaves

14

• Use AVX registers as store instead of ”Oblivious” store

Page 98: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

DRAM

CPU

Faster memory store for enclaves

AVX registers

14

• Use AVX registers as store instead of ”Oblivious” store

C-Pad

64B

Code Controller

stash

pos. map

Page 99: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

DRAM

CPU

Faster memory store for enclaves

DRAM-based store

AVX registers

Have to sequentiallyaccess all memory indices

14

• Use AVX registers as store instead of ”Oblivious” store

C-Pad

64B

Code Controller

stash

pos. map

Page 100: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

DRAM

CPU

Faster memory store for enclaves

DRAM-based store

Register-based store

AVX registers

Have to sequentiallyaccess all memory indices

Can access individualregisters obliviously!

14

• Use AVX registers as store instead of ”Oblivious” store

C-Pad

64B

Code Controller

stash

pos. map

Page 101: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

DRAM

CPU

Faster memory store for enclaves

DRAM-based store

Register-based store

AVX registers

Have to sequentiallyaccess all memory indices

Can access individualregisters obliviously!

14

• Use AVX registers as store instead of ”Oblivious” store

C-Pad

64B

Code Controller

stash

pos. map

AVX registers can be used as a faster, oblivious storage for SGX enclaves!

Page 102: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Implementation

15

Page 103: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Implementation

15

• LLVM compiler suite (3117 LoC)• Breaks all code into similar blocks (C1)

• Instrument and align all control and data-flow instructions (C3)

Page 104: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Implementation

15

• LLVM compiler suite (3117 LoC)• Breaks all code into similar blocks (C1)

• Instrument and align all control and data-flow instructions (C3)

• Runtime library (2179 LoC)• Initializes ORAM trees and performs secure ORAM operations (C2)

• Terminate program and fetch output (C4)

Page 105: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Implementation

15

• LLVM compiler suite (3117 LoC)• Breaks all code into similar blocks (C1)

• Instrument and align all control and data-flow instructions (C3)

• Runtime library (2179 LoC)• Initializes ORAM trees and performs secure ORAM operations (C2)

• Terminate program and fetch output (C4)

• Intel SGX SDK (25 LoC)• Assign memory regions for C/D-Pad (support)

Page 106: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Performance Evaluation

16

0

100

200

300

16 2768 85 121

231O

verh

ead

(ti

me

s)

Programs

Page 107: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Performance Evaluation

16

0

100

200

300

16 2768 85 121

231O

verh

ead

(ti

me

s)

Programs

We ported ~10 simple applications to

Obfuscuro!

Page 108: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Performance Evaluation

16

0

100

200

300

16 2768 85 121

231O

verh

ead

(ti

me

s)

Programs

Average overhead observed is 81 times over

native programs!

We ported ~10 simple applications to

Obfuscuro!

Page 109: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Performance Evaluation

16

0

100

200

300

16 2768 85 121

231O

verh

ead

(ti

me

s)

Programs

Average overhead observed is 81 times over

native programs!

The overhead is highly dependent on input size

and program type!

We ported ~10 simple applications to

Obfuscuro!

Page 110: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Ending Remarks!

17

Page 111: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Ending Remarks!

17

1. Program obfuscation is a remarkable dream to achieve

Page 112: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Ending Remarks!

17

1. Program obfuscation is a remarkable dream to achieve

2. Various software/hardware limitations hinder the realization of program obfuscation on Intel SGX

Page 113: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Ending Remarks!

17

1. Program obfuscation is a remarkable dream to achieve

2. Various software/hardware limitations hinder the realization of program obfuscation on Intel SGX

3. Existing solutions have a limited approach towards side-channel mitigation in Intel SGX

Page 114: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Ending Remarks!

17

1. Program obfuscation is a remarkable dream to achieve

2. Various software/hardware limitations hinder the realization of program obfuscation on Intel SGX

3. Existing solutions have a limited approach towards side-channel mitigation in Intel SGX

4. Obfuscuro is compiler-based scheme which addresses this issue by ensuring all programs leak same access patterns

Adil AhmadContact: [email protected]

Page 115: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

18(Translation ~ Thanks!) ;)

Page 116: OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX · 2020-08-03 · OBFUSCURO: A Commodity Obfuscation Engine for Intel SGX Adil Ahmad*, Byunggill Joe*, Yuan Xiao Yinqian Zhang,

Execution Time Evaluation

19

cycl

es

Code block with instructionsof each type

General programs

ORAM access time dominates the time of code block execution!