Untagging Tor: A Formal Treatment of Onion Encryption Jean Paul Degabriele Martijn Stam 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 Overview Four components: K3 Onion Proxy K1 • Link protocol (TLS) K1 K2 K3 xyz.com K2 • Circuit Extend protocol • Relay protocol • Stream protocol Tor Network composed of Onion Routers 4
Relay Cell Format and Processing 4 1 509 • Cells are 514 bytes (v4+) CircID CMD Cell Payload 498 4 1 1 2 2 4 2 • CircID : Circuit Identifier CircID CMD rCMD Rec SID Digest Len Data • CMD : Cell type - RELAY (3) or AES-CTR (K3) RELAY_EARLY (9) • Rec : Recognised field (0x0000) AES-CTR (K1) • Digest : seeded running hash (truncated SHA-1) CircID CMD Encrypted Cell Payload 5
Tagging Attacks and Their Severity 6
Tagging Attacks • Assume the adversary OR3 controls some onion routers. OR1 Onion Proxy • OR1 flips a bit in a cell and forwards it over. OR2 xyz.com • 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. • Note the similarity with traffic correlation attacks , where roughly the same effect is achieved by matching traffic patterns between input and output edges. 7
The Perceived Severity of Tagging Attacks Over The Years • Tagging attacks were known to the Tor designers, but protecting 2004 against them was deemed pointless since traffic correlation attacks would be possible anyway. • The23rd Raccoon : How I Learned to Stop Ph34ring NSA and Love 2008 the Base Rate Fallacy. • Tagging attacks rediscovered by Fu and Ling and presented at 2009 Black Hat 2009 – Tor project’s response: Nothing new here! • The23rd Raccoon : Analysis of the Relative Severity of Tagging 2012 Attacks. • Tor project decides to revise the relay protocol and protect against tagging attacks, eventually leading to Tor proposal 261 . 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 7 7′ OE=(G,E,D,4 D) n6 n3 n5 n4 ! = [$6, $3, $5, $4] . 0 0 / / / / / / 0 G(!) E(. 3 , 5) (.′ 3 , $3, 7) 4 D(/, $6, 7) 4 D(0 /[4], $6, 7) (0 /′[4], $5, 7′) 11
The Security of Onion Encryption • It is natural to expect confidentiality , integrity , protection against replay and reordering of cells, etc. • The main goal of Tor is anonymity, but this is achieved through a combination of cryptographic mechanisms and other factors such as network size and traffic load . • Our goal is to identify what security can the cryptographic component contribute towards anonymity, assuming other factors 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 information about the circuits’ topology in the network beyond what is inevitably leaked through node corruptions . This should hold even when the adversary can choose the messages that get encrypted and is able to reorder , inject , and manipulate cells on the network. Note how tagging attacks fit in this broader class of attacks. • 13
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 determine which network it is. • This is the main idea, the actual definition is significantly more complex . 14
An Attack and State Shuffling • Assume Circuits are created in Net 0 Net 1 the following order: Orange, Black, Green, Blue . • Consider the states ! of the corrupted nodes, and the order in which entries appear. %6 %6 • Now compare what happens at the left bottom node during ' ' decryption – can distinguish. • Need a data structure that doesn’t leak the order in D(!, %6, ') D(!, %6, ') which entries are created. 15
Tor Proposal 261 and Security Analysis 16
Relay Cell Processing in Prop 261 498 498 4 4 1 1 1 1 2 2 2 2 4 4 2 2 • Digest: now set to 0x00000000. Digest Len Data CircID CircID CMD CMD rCMD rCMD Rec Rec SID SID Digest Len Data • AES-CTR replaced by TWBC. • Each layer maintains a separate Tweak 3 TWBC (K3) tweak, updated with each cell. • CMD is included in each tweak ( RELAY or RELAY_EARLY ). Tweak 1 TWBC (K1) • End-to-end integrity via encode-then-encipher . CircID CMD Encrypted Cell Payload • Verify zeros in Rec , Digest , and Len (7 msb) – total 55 bits. 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 tag cells by switching its value from RELAY to RELAY_EARLY. • A similar vulnerability was exploited in the 2014 CMU incident on Tor’s Onion Services which took down Silk Road. • Recall that CMD was authenticated by including it in the tweak but it does not prevent the attack. 18
The Security of Proposal 261 • In practice, however, there are a number of factors that limit the exploitability and efficacy of this attack. • The RELAY_EARLY cell type is needed in Tor’s mechanism for limiting the maximum circuit size. • It may make sense in practice to accept this issue and rely on the other mitigating factors rather than eliminate it completely. • We prove that a variant of Prop 261 , where CMD is fixed to RELAY, is circuit hiding , showing that the overall design is sound and effective against tagging attacks . 19
Concluding Remarks 20
Concluding Remarks • We put forth a formal treatment of Onion Encryption that reflects Tor’s use-case , identified circuit hiding as its anonymity goal, and used it to analyse Tor proposal 261 . • Our treatment shows that the routing mechanism has significant consequences on anonymity . • Our work and [RZ18] approach the same problem but at different levels of abstraction , settling on distinct tradeoffs between simplicity and relevance to real world protocols (Tor). 21
More recommend