ROTE: Rollback Protection for Trusted Execution

45
ROTE: Rollback Protection for Trusted Execution Sinisa Matetic, Mansoor Ahmed, Kari Kostiainen, Aritra Dhar, David Sommer, Arthur Gervais, Ari Juels, Srdjan Capkun Siniša Matetić ETH Zurich Institute of Information Security August 18 th , 2017

Transcript of ROTE: Rollback Protection for Trusted Execution

Page 1: ROTE: Rollback Protection for Trusted Execution

ROTE: Rollback Protection for Trusted ExecutionSinisa Matetic, Mansoor Ahmed, Kari Kostiainen, Aritra Dhar, David Sommer, Arthur Gervais, Ari Juels, Srdjan Capkun

Siniša Matetić

ETH ZurichInstitute of Information Security

August 18th, 2017

Page 2: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 2

• Intel Software Guard Extensions (SGX) - Intel’s new architecture containing new instructions and protective mechanism in the processor

• Regular systems are vulnerable to various attacks

Intel SGX

HW

OS

APP APP

HW

OS

APP APP

Introduction

Page 3: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 3Images taken from software.intel.com

• Enables trusted execution of security-critical application code - SGX enclaves

•Isolation from the untrusted system software, other enclaves and peripherals •Security perimeter is the processor itself

IntroductionIntel SGX

Page 4: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 4

•Sealing - storing data for persistent storage across executions which gives confidentiality and authentication - but what about integrity?

•Processors are equipped with certified cryptographic keys - enables remotely verifiable attestation statements

IntroductionIntel SGX

Page 5: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 5

Intel SGX

+ and -+ Isolates execution, can handle untrusted OS + Can run many enclaves in parallel + Supports attestation + Supports sealing + Unlike with TPM, security boundary is the processor

- It is not system-wide (unlike TrustZone) - No direct access to peripherals - Side Channels [many recent works]- No Rollback Protection

Page 6: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 6

Please store message1

Target Adversary

Rollback attack

I have stored message1

Target AdversaryEnclave OS

Example

Page 7: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 7

I have stored message1

Target Adversary

Rollback attack

Enclave OS

Example

Page 8: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 8

Please store message2

Target Adversary

Rollback attack

Enclave OS

Example

Page 9: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 9

I have stored message2

Target Adversary

Rollback attack

Enclave OS

Example

Page 10: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 10

Target Adversary

Rollback attack

Enclave OS

Example

Page 11: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 11

Could you give me the latest message?

Target Adversary

Rollback attack

Enclave OS

Example

Page 12: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 12

Sure. Here’s Message1

Target Adversary

Rollback attack

Enclave OS

Example

Page 13: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 13

Intel SGX - Protecting the Local State?Rollback attack

•In a rollback attack a malicious OS replaces the latest sealed data with an older encrypted and authenticated version

•Another way to violate state integrity is to create two instances of the same enclave and route update requests to one instance and read requests to the other (restart, terminate, …).

•Enclaves cannot detect replay, because the processor does not hold persistent state across enclave executions (and platform reboots)

Page 14: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 14

Attacker

Example scenarioRollback attack

SGX

•Imagine a financial application where account balance is enforced by SGX

State 1: Initial bank account balance: 300

Page 15: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 15

Attacker User 11. Send 100

•Imagine a financial application where account balance is enforced by SGX

State 1: Initial bank account balance: 300

SGX

Rollback attack

Example scenario

Page 16: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 16

Attacker User 11. Send 100

•Imagine a financial application where account balance is enforced by SGX

State 2: Initial bank account balance: 200

SGX

Rollback attack

Example scenario

Page 17: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 17

Attacker User 1

User 2

1. Send 100

2. Send 200

•Imagine a financial application where account balance is enforced by SGX

State 2: Initial bank account balance: 200

SGX

Rollback attack

Example scenario

Page 18: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 18

Attacker User 1

User 2

1. Send 100

2. Send 200

•Imagine a financial application where account balance is enforced by SGX

State 3: Initial bank account balance: 0

SGX

Rollback attack

Example scenario

Page 19: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 19

Attacker User 1

User 2

1. Send 100

2. Send 200

3. Restart and replay old state

•Imagine a financial application where account balance is enforced by SGX

State 3: Initial bank account balance: 0

SGX

Rollback attack

Example scenario

Page 20: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 20

Attacker User 1

User 2

1. Send 100

2. Send 200

3. Restart and replay old state

•Imagine a financial application where account balance is enforced by SGX

State 1: Initial bank account balance: 300

SGX

Rollback attack

Example scenario

Page 21: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 21

Attacker User 1

User 2

1. Send 100

2. Send 200

3. Restart and replay old state

User 3

4. Send 100

•Imagine a financial application where account balance is enforced by SGX

State 1: Initial bank account balance: 300

SGX

Rollback attack

Example scenario

Page 22: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 22

Attacker User 1

User 2

1. Send 100

2. Send 200

3. Restart and replay old state

User 3

4. Send 100

•Imagine a financial application where account balance is enforced by SGX

State 2: Initial bank account balance: 200

SGX

Rollback attack

Example scenario

Page 23: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 23

•New security model for reasoning about the integrity and freshness of SGX applications - identified security weaknesses in existing SGX systems.

•SGX counter experiments showing limitation of the service

•Novel approach of realising rollback protection by storing enclave-specific counters in a distributed system

•Implemented ROTE system that ensures integrity and freshness of application data in a powerful adversarial model.

•Experimental evaluation showing only a small performance overhead for our system - in a low-latency network state update overhead is only 1-2 ms

Main contributions of this workROTE

Page 24: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 24

Adversary

Store << Messagen , n >>

Target

Increment MC

Protected Space

Example solutionRollback attack

Enclave OS

Page 25: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 25

Target Adversary

Rollback attack

Example solution

Enclave OS

Page 26: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 26

Here is << Messagex , x >>

Target Adversary

Protected SpaceMC = n

Rollback attack

Example solution

Enclave OS

Page 27: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 27

Here is << Messagex , x >>

Target Adversary

Protected SpaceMC = n

Is x = n?

Enclave OS

Rollback attack

Example solution

Page 28: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 28

Existing solutions•To address rollback attacks, two basic approaches are known: - use non-volatile memory element to store the state - maintain integrity information in a separate trusted server

•SGX supports Monotonic Counter service - limited security guarantees - poor performance (limits high-throughput transactions)

•Leveraging Trusted Platform Modules (TPMs) - similar limitations

Page 29: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 29

Solution provided by Intel SGX• SGX supports Monotonic Counter service

•Stored in an off-CPU memory •Security concern: counters stored in a flash memory that is also used by the BIOS, connected via an SPI bus.This is a passive component.

•Performance concerns: how practical is this?

Page 30: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 30

Experiments - SGX counter service•Counter increment operation took 80 - 250 ms (model dependent). Counter read operations took 60-140 ms

•1.05 M writes render the NV counter (memory) unusable (wear) •Reinstalling the SGX Platform Software (PSW) or removing the BIOS battery deletes all counters

•After reinstalling the PSW the platform software connects to Intel server. If connection not available, the counter service is unavailable

•Updates of an enclave every 250 ms => counters become unusable in few days. - with one increment per minute, the counters are exhausted in two years

Page 31: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 31

ROTE

SGX: System / Attacker Model•Attacker: - enclave scheduling, - platform reboots, - control of the full software stack, - control over the complete communication channel, and - compromising the SGX hardware

•One can achieve all-or-nothing rollback - the only way to violate data integrity is to reset the entire group to its initial state

Page 32: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 32

ROTE

Our Approach•Intuition: A single platform cannot efficiently prevent rollback, but in many practical scenarios, multiple processors can be enrolled to assist each other

SGX

SGX

SGX

SGX

SGX

SGX

Page 33: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 33

ROTE

Our Approach•We try to build a distributed system where each participating nodes provides state protection for all other nodes

SGX SGX

SGX

SGX

SGX

SGX

Page 34: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 34

ROTE

Our Approach•When an enclave updates its state, it stores a counter to a set of enclaves running on assisting processors

SGX SGX

SGX

SGX

SGX

SGXState update

0->1

111

1

1

Page 35: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 35

ROTE

Our Approach•When the enclave needs to recover its state, it obtains counter values from assisting enclaves to verify that the recovered state data is of the latest version

SGX SGX

SGX

SGX

SGX

SGX

RestartRetrieve state

1

1

1

1

1

Check counterState 1

Page 36: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 36

ROTE

1. Protection against the strong adversary model 2. Network partitioning 3. Coordinated enclave restarts 4. Multiple enclave instances 5. Group establishment

Challenges

Page 37: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 37

System architecture•Multiple user applications with matching Application-Specific Enclave (ASE) •System service, Rollback Enclave (RE), implements ROTE library that ASEs use •The design choice of introducing a dedicated system service (RE) hides the distributed counter maintenance from the applications

ROTE

OS

Platform A

ASEA1ROTE lib ROTE lib

ASEAi REA Platform B

ROTE System (TCB)3rd Party Development

Page 38: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 38

ASE start/read protocolRE restart protocol ASE State update protocol

ASEA1ASEA1Rollback EnclaveB

Rollback EnclaveB

EchoB

Rollback Enclavei

Rollback Enclavei

signed (MCA)

...

updateGroupCounterTable()

Echoi

RESPONSE

4

1

3

Rollback EnclaveA

Rollback EnclaveA

incrementASEA1Counter();updateLocalASECounterTable();

increaseMC();2

signed (MCA)

5

verify final ACKs();acceptNewState();

store&seal();

8ACK

acceptNewState();store&seal();

REQUEST LOCAL ENTITY EXTERNAL ENTITY

verify Echoesreturned EchoB

check returned Echoi forvalididity

returned Echoi

final ACKB

final ACKi

6

7

9

ASEA1ASEA1Rollback EnclaveA

Rollback EnclaveA

getASEA1Counter()

CounterASEA1

Operating system

Operating system

requestLocalState()

unsealState(); retrieveASEcounter()

compare counter from the unsealed statewith counter received from REA

REQUESTRESPONSE

1 2

3

5

6

Rollback Enclavei

Rollback Enclavei

...

LOCAL ENTITY EXTERNAL ENTITY

OfferSeal(ASEA1,seal) checkLocalASECounterTable()

RE restart protocolSTEPS 4-64

Rollback EnclaveA

Rollback EnclaveA

Rollback EnclaveB

Rollback EnclaveB

getMC()

signed MC(REA), signed MC(all)

Operating system

Operating system

requestLocalState()

OfferSeal(REA,seal) unsealState(); extract MC

Rollback Enclavei

Rollback Enclavei

...

getMC()

...

checkGroupCounterTable()

signed MC(REA), signed MC(all)

compare MC from sealed statewith max(MC)

REQUESTRESPONSE

7

23

4

5

LOCAL ENTITYEXTERNAL ENTITY

verify final ACKs(); acceptNewState();store&seal(); continueOperation();

6

Session key(s) establishment 1

ROTE

System protocols

Page 39: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 39

unseal

12 Start()7

value

ask seal

fail

halt

4

OfferSeal(latest)

5

6

OfferSeal(arbitrary)

OfferSeal(previous)

8

9

10

increment

Write-Counter()

failok

Seal()

ok

3

ready to update state

normaloperation

fail

counter match

unseal

unseal

check counter

counter matchempty

ReadCounter()

fail

• Basic intuition: Given a secure storage functionality (abstraction), the RE can verify that its state its the latest and rollback is prevented - First start - Sealing & Unsealing - Forking - Restart

Security AnalysisROTE

Page 40: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 40

Security Analysis• Realization of the secure storage functionality as a distributed system - Quorum size - Platform restarts - Forking attacks

• Dependency between the parameters is n=f+2u+1

ROTE

ul f 1 ur

state=1state=2

state update: 1state update: 2

state retrieval

1target RE

n

q

Page 41: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 41

2 4 6 8 10 12 14 16 18 20Number of nodes in the group

0.60.81.01.21.41.61.82.02.22.42.62.83.03.2

Tim

e(m

s)

Response Time UpdateResponse Time Read

2 3 4 5 6Number of nodes in the group

200

400

600

800

1000

1200

1400

Tim

e(m

s)Response Time UpdateResponse Time Read

ROTE

Performance evaluation

2 3 4Number of nodes in the group

1.0

1.2

1.4

1.6

1.8

2.0

2.2

2.4

2.6

Tim

e(m

s)

Response Time UpdateResponse Time Read

• Experimental results - state update/read delay.

1. ROTE performance for a group within a local network, 2. Geographically distributed protection groups, 3. Simulated performance for a larger group within a local network.

1 2 3

Page 42: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 42

ROTE

Performance evaluation

Page 43: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution

• The current SGX design and architecture clearly have some shortcoming that could be addressed in the future to strengthen its position

• Designing a distributed system that is both efficient and satisfies the required security properties proved to be quite a challenge - http://scholar.harvard.edu/files/mickens/files/thesaddestmoment.pdf

• During the whole project we stumbled upon numerous new attack vectors and thus had to change the core work to adapt

• Developing enclaves for Intel SGX is still buggy and cumbersome

43

Lessons learnt…

Page 44: ROTE: Rollback Protection for Trusted Execution

/ 46Sinisa Matetic - ROTE: Rollback Protection for Trusted Execution 44

•New security model for reasoning about the integrity and freshness of SGX applications - identified security weaknesses in existing SGX systems.

•SGX counter experiments showing limitation of the service

•Novel approach of realising rollback protection by storing enclave-specific counters in a distributed system

•Implemented ROTE system that ensures integrity and freshness of application data in a powerful adversarial model.

•Experimental evaluation showing only a small performance overhead for our system - in a low-latency network state update overhead is only 1-2 ms

ConclusionROTE

Page 45: ROTE: Rollback Protection for Trusted Execution

Thank you for your attention! Any Questions?

[email protected]