untaggingtor - eurocrypt · tor network composed of onion routers xyz.com onion proxy four...
TRANSCRIPT
Untagging Tor:A Formal Treatment of Onion Encryption
Martijn StamJean Paul Degabriele
1
Outline of this talk
• Overview of Tor
• Tagging Attacks and Their Severity
• Modelling Onion Encryption
• Tor Proposal 261 and Security Analysis
2
Overview of Tor
3
Tor Networkcomposed of Onion Routers
xyz.com
Onion ProxyFour components:
• Link protocol (TLS)
• Circuit Extend protocol
• Relay protocol
• Stream protocol
K1
K1
K2 K2K3
K3
Tor Overview
4
Relay Cell Format and Processing
• Cells are 514 bytes (v4+)
• CircID: Circuit Identifier
• CMD: Cell type - RELAY (3) or
RELAY_EARLY (9)
• Rec: Recognised field (0x0000)
• Digest: seeded running hash
(truncated SHA-1)
CMDCircID Cell Payload
4 1 509
AES-CTR (K3)
CMDCircID Encrypted Cell Payload
AES-CTR (K1)
4 1 1 2 4 2 498
CMDCircID rCMD Rec SID Digest Len Data
2
5
Tagging Attacks and Their Severity
6
xyz.com
• Assume the adversary controls some onion routers.
• OR1 flips a bit in a cell and forwards it over.
• OR3 flips that bit back and tests if decryption succeeds.
• If yes, the adversary has confirmed that the two edges (CircIDs) belong to the same circuit.
Tagging Attacks
OR3
OR1
• Note the similarity with traffic correlation attacks, where roughly the same effect is achieved by matching traffic patterns between input and output edges.
OR2
Onion Proxy
7
The Perceived Severity of Tagging Attacks Over The Years• Tagging attacks were known to the Tor designers, but protecting
against them was deemed pointless since traffic correlation attacks would be possible anyway.
• The23rd Raccoon: How I Learned to Stop Ph34ring NSA and Love the Base Rate Fallacy.
• Tagging attacks rediscovered by Fu and Ling and presented at Black Hat 2009 – Tor project’s response: Nothing new here!
• The23rd Raccoon: Analysis of the Relative Severity of Tagging Attacks.
• Tor project decides to revise the relay protocol and protect against tagging attacks, eventually leading to Tor proposal 261.
2004
2008
2009
2012
8
Modelling Onion Encryption
9
Other Works on Onion Encryption
• [CL05] UC security definition tailored for the mix-net setting where: cells are routed individually (no circuits), onion routers are stateless, and the onion encryption is public-key. • [BGKM12] UC security definition intended for Tor’s use case but their security definitions have a number of shortcomings.• Most importantly, it does not protect against tagging attacks. On the contrary, this vulnerability was turned into a feature – referred therein as predictable malleability.• [RZ18] Concurrently introduced Onion-AE, which views onion encryption as an extension of AE, ignoring the routing aspect.
10
Modelling Onion Encryption
11
n6 n4n5n3
! = [$6, $3, $5, $4]
G(!)
. / 0// 0/ / 0/
OE=(G,E,D,4D)
E(. 3 ,5) (.′ 3 , $3, 7)D(/, $6, 7)
4D(0/[4], $6, 7) (0/′[4], $5, 7′)4
7 7′
The Security of Onion Encryption
• It is natural to expect confidentiality, integrity, protectionagainst replay and reordering of cells, etc.
• The main goal of Tor is anonymity, but this is achieved through acombination of cryptographic mechanisms and other factorssuch as network size and traffic load.
• Our goal is to identify what security can the cryptographiccomponent contribute towards anonymity, assuming otherfactors to be ideal.
• We contend that the answer is Circuit Hiding.12
Intuition Behind Circuit Hiding
An adversary should not be able to learn any new informationabout the circuits’ topology in the network beyond what isinevitably leaked through node corruptions.
This should hold even when the adversary can choose themessages that get encrypted and is able to reorder, inject,and manipulate cells on the network.
13
• Note how tagging attacks fit in this broader class of attacks.
Circuit Hiding (Simplified)
Net 0 Net 1• Adversary specifies a set of nodes and
indicates the subset that it controls.
• It specifies two networks (sets of circuits).
• The interface with the corrupted nodes must be the same in both networks.
• A network is chosen at random and the adversary gets to interact with it via the corrupted nodes and tries to determinewhich network it is.
• This is the main idea, the actual definitionis significantly more complex.
14
An Attack and State Shuffling
Net 0 Net 1• Assume Circuits are created in the following order:
Orange, Black, Green, Blue.
• Consider the states ! of the corrupted nodes, and the order in which entries appear.
• Now compare what happens at the left bottom node during decryption – can distinguish.
• Need a data structure that doesn’t leak the order in which entries are created.
15
D(!, %6, ')
'
%6
'
%6
D(!, %6, ')
Tor Proposal 261 and Security Analysis
16
Relay Cell Processing in Prop 261
• Digest: now set to 0x00000000.
• AES-CTR replaced by TWBC.
• Each layer maintains a separate tweak, updated with each cell.
• CMD is included in each tweak (RELAY or RELAY_EARLY).
• End-to-end integrity via encode-then-encipher.
• Verify zeros in Rec, Digest, and Len (7 msb) – total 55 bits.
TWBC (K3)
CMDCircID Encrypted Cell Payload
TWBC (K1)
4 1 1 2 4 2 498
CMDCircID rCMD Rec SID Digest Len Data
2
Tweak1
Tweak3
4 1 1 2 4 2 498
CMDCircID rCMD Rec SID Digest Len Data
2
17
The Security of Proposal 261
• It turns out that Proposal 261 is not circuit hiding!
• The reason is that the cell header’s CMD field can be used to tagcells by switching its value from RELAY to RELAY_EARLY.
• A similar vulnerability was exploited in the 2014 CMUincident on Tor’s Onion Services which took down Silk Road.
• Recall that CMD was authenticated by including it in the tweakbut it does not prevent the attack.
18
The Security of Proposal 261
• In practice, however, there are a number of factors that limit theexploitability and efficacy of this attack.
• The RELAY_EARLY cell type is needed in Tor’s mechanism forlimiting the maximum circuit size.
• It may make sense in practice to accept this issue and rely onthe other mitigating factors rather than eliminate it completely.
• We prove that a variant of Prop 261, where CMD is fixed toRELAY, is circuit hiding, showing that the overall design issound and effective against tagging attacks.
19
Concluding Remarks
20
Concluding Remarks
• We put forth a formal treatment of Onion Encryption thatreflects Tor’s use-case, identified circuit hiding as itsanonymity goal, and used it to analyse Tor proposal 261.
• Our treatment shows that the routing mechanism hassignificant consequences on anonymity.
• Our work and [RZ18] approach the same problem but atdifferent levels of abstraction, settling on distinct tradeoffsbetween simplicity and relevance to real world protocols (Tor).
21