+ All Categories
Home > Documents > Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam...

Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam...

Date post: 26-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
49
Notary: A Device for Secure Transaction Approval Anish Athalye Adam Belay Frans Kaashoek Robert Morris Nickolai Zeldovich MIT CSAIL 1
Transcript
Page 1: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Notary: A Device for Secure

Transaction Approval

Anish Athalye Adam Belay Frans Kaashoek Robert Morris Nickolai Zeldovich

MIT CSAIL

1

Page 2: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

How to securely approve transactions?

• Users perform sensitive transactional operations• Bank transfers

• Cryptocurrency transactions

• Deleting backups

• Modifying DNS records

2

Page 3: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Common solution: smartphone apps

• Suffers from isolation bugs

(e.g. jailbreaks)

Approval agent on smartphone

3

Page 4: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Hardware wallets for transaction approval

TX

Sign(TX)

Display

Bu�ons

Ledger wallet

4

Page 5: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Challenge: wallets need to isolate agents

Ledger app store: 50+ third-party agents

5

Page 6: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Challenge: wallets need to isolate agents

Ledger app store: 50+ third-party agents

5

Page 7: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Problemswith existing hardware wallets

• OS bugs• Over 10 found in Ledger and Trezor wallets

• Potential hardware bugs• Shared hardware state could leak secrets (e.g. Spectre)

6

Page 8: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Contribution: Notary

• Agent separation architecture• Reset-based switching

• Verified deterministic start

• Physical hardware wallet prototype

7

Page 9: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Threat model

• Some agents are malicious

• Physical attacks out of scope• Could be addressed by tamper-proof hardware

8

Page 10: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Separation architecture provides isolation

AgentSoC

KernelSoC

Runs third-party codeNo OS, full access to hardware

Manages storage,agent switching

User I/O Reset bu�on

Storage

uart

rstUSB

Notary separation architecture9

Page 11: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Separation architecture provides isolation

AgentSoC

KernelSoC

Runs third-party codeNo OS, full access to hardware

Manages storage,agent switching

User I/O Reset bu�on

Storage

uart

rstUSB

Kernel SoC9

Page 12: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Separation architecture provides isolation

AgentSoC

KernelSoC

Runs third-party codeNo OS, full access to hardware

Manages storage,agent switching

User I/O Reset bu�on

Storage

uart

rstUSB

Agent SoC9

Page 13: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Separation architecture provides isolation

AgentSoC

KernelSoC

Runs third-party codeNo OS, full access to hardware

Manages storage,agent switching

User I/O Reset bu�on

Storage

uart

rstUSB

Connected only by UART (and reset wire)9

Page 14: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Separation architecture provides isolation

AgentSoC

KernelSoC

Runs third-party codeNo OS, full access to hardware

Manages storage,agent switching

User I/O Reset bu�on

Storage

uart

rstUSB

Kernel resets Agent SoC9

Page 15: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Separation architecture provides isolation

AgentSoC

KernelSoC

Runs third-party codeNo OS, full access to hardware

Manages storage,agent switching

User I/O Reset bu�on

Storage

uart

rstUSB

launch(): load agent code + data9

Page 16: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Separation architecture provides isolation

AgentSoC

KernelSoC

Runs third-party codeNo OS, full access to hardware

Manages storage,agent switching

User I/O Reset bu�on

Storage

uart

rstUSB

Agent runs on Agent SoC, independently of Kernel SoC9

Page 17: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Separation architecture provides isolation

AgentSoC

KernelSoC

Runs third-party codeNo OS, full access to hardware

Manages storage,agent switching

User I/O Reset bu�on

Storage

uart

rstUSB

exit(state): save state and terminate9

Page 18: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Desired property: noninterference

Agent A runs switch Agent B runs

�me

10

Page 19: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Desired property: noninterference

steal A's secrets?

Agent A runs switch Agent B runs

�me

10

Page 20: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Desired property: noninterference

steal A's secrets?

Agent A runs switch Agent B runs

�me

10

Page 21: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Deterministic start ensures noninterference

• Run before starting any agent

• Clears state in SoC (puts chip in deterministic state)

11

Page 22: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Deterministic start ensures noninterference

World 0 (secret = 0)

World 1 (secret = 1)

11

Page 23: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Deterministic start ensures noninterference

World 0 (secret = 0)

World 1 (secret = 1)

Agent A runs

11

Page 24: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Deterministic start ensures noninterference

World 0 (secret = 0)

World 1 (secret = 1)

Agent A runs Determinis�c start

11

Page 25: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Deterministic start ensures noninterference

World 0 (secret = 0)

World 1 (secret = 1)

Agent A runs Determinis�c start Agent B runs

11

Page 26: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Deterministic start ensures noninterference

Determinis�c start

11

Page 27: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Challenge: completeness

• Lots of state• Registers

• Microarchitectural state: CPU caches, ...

• RAM

• SoC peripherals: UART, SPI, ...

• Must work for all states

12

Page 28: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Simple approaches fail

• Reset pin• Clears minimal state necessary to restart

• Power cycling• State takes minutes to decay (cold boot attacks)

13

Page 29: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Notary’s approach: use software

• Reset returns control

• Software in boot ROM can

clear internal state

• How to write this code?• Must clear every single bit

of internal state

CPU(PicoRV32)

ROM(1 KB)

RAM(128 KB)

UART UART GPIO SPI

clk rststart code

(clears state)

14

Page 30: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Gate-level description captures all internal state

RTL (e.g. Verilog): all digital state is explicit

=⇒ SMT-compatible format

(for symbolic circuit simulation)

15

Page 31: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

16

Page 32: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

/* no reset code */

16

Page 33: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

/* no reset code */ error, state not cleared:

soc.cpu.latched_rd

16

Page 34: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

16

Page 35: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

error, state not cleared:

soc.cpu.cpuregs[1]

16

Page 36: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

/* clear registers */li x1, 0 /* ... */li x31, 0

16

Page 37: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

/* clear registers */li x1, 0 /* ... */li x31, 0

error, state not cleared:

soc.cpu.mem_wdata

16

Page 38: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

/* clear registers */li x1, 0 /* ... */li x31, 0

/* clear buffer */sw zero, 0(zero)

16

Page 39: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

/* clear registers */li x1, 0 /* ... */li x31, 0

/* clear buffer */sw zero, 0(zero)

error, state not cleared:

soc.ram.data[0]

16

Page 40: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

/* clear registers */li x1, 0 /* ... */li x31, 0

/* clear buffer */sw zero, 0(zero)

/* clear ram */la t0, _sram_startla t1, _sram_end

loop:sw zero, 0(t0)addi t0, t0, 4bne t0, t1, loop

16

Page 41: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

/* clear registers */li x1, 0 /* ... */li x31, 0

/* clear buffer */sw zero, 0(zero)

/* clear ram */la t0, _sram_startla t1, _sram_end

loop:sw zero, 0(t0)addi t0, t0, 4bne t0, t1, loop

error, state not cleared:

soc.uart.cr0

16

Page 42: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

/* clear registers */li x1, 0 /* ... */li x31, 0

/* clear buffer */sw zero, 0(zero)

/* clear ram */la t0, _sram_startla t1, _sram_end

loop:sw zero, 0(t0)addi t0, t0, 4bne t0, t1, loop

/* clear uart control register */la t0, _uart0sw zero, 0(t0)

16

Page 43: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Verifying deterministic start for Notary’s SoC

nopnopnop

/* clear registers */li x1, 0 /* ... */li x31, 0

/* clear buffer */sw zero, 0(zero)

/* clear ram */la t0, _sram_startla t1, _sram_end

loop:sw zero, 0(t0)addi t0, t0, 4bne t0, t1, loop

/* clear uart control register */la t0, _uart0sw zero, 0(t0)

deterministic start verified!

n = 180342 cycles, < 10 ms(mostly spent clearing RAM)

16

Page 44: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Notary hardware and system software

• Additional hardware: $8

(extra chips)

• TCB: 4000 LOC

(mostly drivers)

Notary prototype

17

Page 45: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Notary agent: Bitcoin

Bitcoin app (left) and agent (right)

18

Page 46: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Notary agent: web-app approval

Web app (left) and agent (right)

19

Page 47: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Evaluation summary: Notary is practical

Notary’s design prevents bugs

while preserving developer and user experience.

(see paper)

20

Page 48: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Relatedwork

• Non-wallet security devices [iOS enclave, Yubikey]

• Verified kernels [SeL4, Hyperkernel, Nickel, CertiKOS]

• Verified hardware [Kami, Hyperflow]

(see paper)

21

Page 49: Notary: A Device for Secure Transaction Approval - anish.iososp19-slides.pdf · Anish Athalye, Adam Belay, Frans Kaashoek, Robert Morris, Nickolai Zeldovich Created Date: 10/28/2019

Conclusion

• Notary separation architecture• Reset-based switching: clearing state between switching agents

• Verified deterministic start: ensuring state clearing is correct

• Notary prototype• RISC-V-based prototype

• 2 agents: Bitcoin, web-app approval

anish.io/notary

22


Recommended