tor-design.tex 96 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865
  1. \documentclass[times,10pt,twocolumn]{article}
  2. \usepackage{latex8}
  3. \usepackage{times}
  4. \usepackage{url}
  5. \usepackage{graphics}
  6. \usepackage{amsmath}
  7. \pagestyle{empty}
  8. \renewcommand\url{\begingroup \def\UrlLeft{<}\def\UrlRight{>}\urlstyle{tt}\Url}
  9. \newcommand\emailaddr{\begingroup \def\UrlLeft{<}\def\UrlRight{>}\urlstyle{tt}\Url}
  10. % If an URL ends up with '%'s in it, that's because the line *in the .bib/.tex
  11. % file* is too long, so break it there (it doesn't matter if the next line is
  12. % indented with spaces). -DH
  13. %\newif\ifpdf
  14. %\ifx\pdfoutput\undefined
  15. % \pdffalse
  16. %\else
  17. % \pdfoutput=1
  18. % \pdftrue
  19. %\fi
  20. \newenvironment{tightlist}{\begin{list}{$\bullet$}{
  21. \setlength{\itemsep}{0mm}
  22. \setlength{\parsep}{0mm}
  23. % \setlength{\labelsep}{0mm}
  24. % \setlength{\labelwidth}{0mm}
  25. % \setlength{\topsep}{0mm}
  26. }}{\end{list}}
  27. \begin{document}
  28. %% Use dvipdfm instead. --DH
  29. %\ifpdf
  30. % \pdfcompresslevel=9
  31. % \pdfpagewidth=\the\paperwidth
  32. % \pdfpageheight=\the\paperheight
  33. %\fi
  34. \title{Tor: The Second-Generation Onion Router}
  35. % Putting the 'Private' back in 'Virtual Private Network'
  36. %\author{Roger Dingledine \\ The Free Haven Project \\ arma@freehaven.net \and
  37. %Nick Mathewson \\ The Free Haven Project \\ nickm@freehaven.net \and
  38. %Paul Syverson \\ Naval Research Lab \\ syverson@itd.nrl.navy.mil}
  39. \maketitle
  40. \thispagestyle{empty}
  41. \begin{abstract}
  42. We present Tor, a circuit-based low-latency anonymous communication
  43. service. This second-generation Onion Routing system addresses limitations
  44. in the original design. Tor adds perfect forward secrecy, congestion
  45. control, directory servers, integrity checking, variable exit policies,
  46. and a practical design for rendezvous points. Tor works on the real-world
  47. Internet, requires no special privileges or kernel modifications, requires
  48. little synchronization or coordination between nodes, and provides a
  49. reasonable trade-off between anonymity, usability, and efficiency. We
  50. close with a list of open problems in anonymous communication.
  51. \end{abstract}
  52. %\begin{center}
  53. %\textbf{Keywords:} anonymity, peer-to-peer, remailer, nymserver, reply block
  54. %\end{center}
  55. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  56. \Section{Overview}
  57. \label{sec:intro}
  58. Onion Routing is a distributed overlay network designed to anonymize
  59. low-latency TCP-based applications such as web browsing, secure shell,
  60. and instant messaging. Clients choose a path through the network and
  61. build a \emph{circuit}, in which each node (or ``onion router'')
  62. in the path knows its predecessor and successor, but no other nodes in
  63. the circuit. Traffic flowing down the circuit is sent in fixed-size
  64. \emph{cells}, which are unwrapped by a symmetric key at each node
  65. (like the layers of an onion) and relayed downstream. The original
  66. Onion Routing project published several design and analysis papers
  67. \cite{or-ih96,or-jsac98,or-discex00,or-pet00}. While a wide area Onion
  68. Routing network was deployed for some weeks, the only long-running and
  69. publicly accessible implementation was a fragile
  70. proof-of-concept that ran on a single machine. Even this simple deployment
  71. processed connections from over sixty thousand distinct IP addresses from
  72. all over the world at a rate of about fifty thousand per day.
  73. But many critical design and deployment issues were never
  74. resolved, and the design has not been updated in several years. Here
  75. we describe Tor, a protocol for asynchronous, loosely federated onion
  76. routers that provides the following improvements over the old Onion
  77. Routing design:
  78. \begin{tightlist}
  79. \item \textbf{Perfect forward secrecy:} The original Onion Routing
  80. design was vulnerable to a single hostile node recording traffic and
  81. later compromising successive nodes in the circuit and forcing them
  82. to decrypt it. Rather than using a single multiply encrypted data
  83. structure (an \emph{onion}) to lay each circuit,
  84. Tor now uses an incremental or \emph{telescoping} path-building design,
  85. where the initiator negotiates session keys with each successive hop in
  86. the circuit. Once these keys are deleted, subsequently compromised nodes
  87. cannot decrypt old traffic. As a side benefit, onion replay detection
  88. is no longer necessary, and the process of building circuits is more
  89. reliable, since the initiator knows when a hop fails and can then try
  90. extending to a new node.
  91. \item \textbf{Separation of ``protocol cleaning'' from anonymity:}
  92. The original Onion Routing design required a separate ``application
  93. proxy'' for each supported application protocol---most of which were
  94. never written, so many applications were never supported. Tor uses the
  95. standard and near-ubiquitous SOCKS \cite{socks4} proxy interface, allowing
  96. us to support most TCP-based programs without modification. Tor now
  97. relies on the filtering features of privacy-enhancing
  98. application-level proxies such as Privoxy \cite{privoxy}, without trying
  99. to duplicate those features itself.
  100. \item \textbf{No mixing, padding, or traffic shaping yet:} The original
  101. Onion
  102. Routing design called for batching and reordering cells arriving from
  103. each source. It also included padding between onion routers and, in a
  104. later design, between onion proxies (users) and onion routers
  105. \cite{or-ih96,or-jsac98}. The trade-off between padding protection
  106. and cost was discussed, but no general padding scheme was suggested. In
  107. \cite{or-pet00} it was theorized \emph{traffic shaping} would generally
  108. be used, but details were not provided. Recent research \cite{econymics}
  109. and deployment experience \cite{freedom21-security} suggest that this
  110. level of resource use is not practical or economical; and even full link
  111. padding is still vulnerable \cite{defensive-dropping}. Thus, until we
  112. have a proven and convenient design for traffic shaping or low-latency
  113. mixing that will improve anonymity against a realistic adversary, we
  114. leave these strategies out.
  115. \item \textbf{Many TCP streams can share one circuit:} The
  116. original Onion Routing design built a separate circuit for each
  117. application-level request. This hurt performance by requiring
  118. multiple public key operations for every request, and also presented
  119. a threat to anonymity from building so many different circuits; see
  120. Section~\ref{sec:maintaining-anonymity}. Tor multiplexes multiple TCP
  121. streams along each circuit to improve efficiency and anonymity.
  122. \item \textbf{Leaky-pipe circuit topology:} Through in-band signaling
  123. within the circuit, Tor initiators can direct traffic to nodes partway
  124. down the circuit. This novel approach allows for long-range padding if
  125. future research indicates that it can frustrate traffic shape and volume
  126. attacks at the initiator \cite{defensive-dropping}, and
  127. also allows traffic to exit the circuit from the middle---again possibly
  128. frustrating traffic shape and volume attacks based on observing the end
  129. of the circuit.
  130. \item \textbf{Congestion control:} Earlier anonymity designs do not
  131. address traffic bottlenecks. Unfortunately, typical approaches to
  132. load balancing and flow control in overlay networks involve inter-node
  133. control communication and global views of traffic. Tor's decentralized
  134. congestion control uses end-to-end acks to maintain anonymity
  135. while allowing nodes at the edges of the network to detect congestion
  136. or flooding and send less data until the congestion subsides.
  137. \item \textbf{Directory servers:} The original Onion Routing design
  138. planned to flood link-state information through the network---an approach
  139. that can be unreliable and open to partitioning attacks or
  140. deception. Tor takes a simplified view toward distributing link-state
  141. information. Certain more trusted onion routers act as \emph{directory
  142. servers}: they provide signed directories that describe known
  143. routers and their availability. Users periodically download these
  144. directories via HTTP.
  145. \item \textbf{Variable exit policies:} Tor provides a consistent mechanism
  146. for each node to advertise a policy describing the hosts
  147. and ports to which it will connect. These exit policies are critical
  148. in a volunteer-based distributed infrastructure, because each operator
  149. is comfortable with allowing different types of traffic to exit the Tor
  150. network from his node.
  151. \item \textbf{End-to-end integrity checking:} The original Onion Routing
  152. design did no integrity checking on data. Any onion router on the
  153. circuit could change the contents of data cells as they passed by---for
  154. example, to alter a connection request on the fly so it would connect
  155. to a different webserver, or to `tag' encrypted traffic and look for
  156. corresponding corrupted traffic at the network edges \cite{minion-design}.
  157. Tor hampers these attacks by checking data integrity before it leaves
  158. the network.
  159. \item \textbf{Improved robustness to failed nodes:} A failed node
  160. in the old design meant that circuit building failed, but thanks to
  161. Tor's step-by-step circuit building, users notice failed nodes
  162. while building circuits and route around them. Additionally, liveness
  163. information from directories allows users to avoid unreliable nodes in
  164. the first place.
  165. \item \textbf{Rendezvous points and location-protected servers:}
  166. Tor provides an integrated mechanism for responder anonymity via
  167. location-protected servers. Previous Onion Routing designs included
  168. long-lived ``reply onions'' that could be used to build circuits
  169. to a hidden server, but these reply onions did not provide forward
  170. security, and became useless if any node in the path went down
  171. or rotated its keys. In Tor, clients negotiate {\it rendezvous points}
  172. to connect with hidden servers; reply onions are no longer required.
  173. \end{tightlist}
  174. Unlike Freedom \cite{freedom2-arch}, Tor only
  175. attempts to anonymize TCP streams. Because it does not require patches
  176. (or built-in support) in an operating system's network stack, this
  177. approach has proven valuable to Tor's portability and deployability.
  178. We have implemented most of the above features. Our source code is
  179. available under a free license, and, as far as we know, is unencumbered by
  180. patents. We have recently begun deploying a wide-area alpha network
  181. to test the design in practice, to get more experience with usability
  182. and users, and to provide a research platform for experimentation.
  183. We review previous work in Section~\ref{sec:related-work}, describe
  184. our goals and assumptions in Section~\ref{sec:assumptions},
  185. and then address the above list of improvements in
  186. Sections~\ref{sec:design}-\ref{sec:rendezvous}. We summarize
  187. in Section~\ref{sec:attacks} how our design stands up to
  188. known attacks, and conclude with a list of open problems in
  189. Section~\ref{sec:maintaining-anonymity} and future work for the Onion
  190. Routing project in Section~\ref{sec:conclusion}.
  191. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  192. \Section{Related work}
  193. \label{sec:related-work}
  194. Modern anonymity systems date to Chaum's {\bf Mix-Net} design
  195. \cite{chaum-mix}. Chaum
  196. proposed hiding the correspondence between sender and recipient by
  197. wrapping messages in layers of public key cryptography, and relaying them
  198. through a path composed of ``Mixes.'' Each of these mixes in turn
  199. decrypts, delays, and re-orders messages, before relaying them toward
  200. their destinations.
  201. Subsequent relay-based anonymity designs have diverged in two
  202. principal directions. Some have attempted to maximize anonymity at
  203. the cost of introducing comparatively large and variable latencies,
  204. including {\bf Babel} \cite{babel}, {\bf Mixmaster}
  205. \cite{mixmaster-spec}, and
  206. {\bf Mixminion} \cite{minion-design}. Because of this
  207. decision, these \emph{high-latency} networks resist strong global
  208. adversaries,
  209. but introduce too much lag for interactive tasks like web browsing,
  210. internet chat, or SSH connections.
  211. Tor belongs to the second category: \emph{low-latency} designs that
  212. attempt to anonymize interactive network traffic. These systems handle
  213. a variety of bidirectional protocols.
  214. % They also provide more convenient
  215. %mail delivery than the high-latency fire-and-forget anonymous email
  216. %networks, because the remote mail server provides explicit delivery
  217. %confirmation.
  218. But because these designs typically
  219. involve many packets that must be delivered quickly, it is
  220. difficult for them to prevent an attacker who can eavesdrop both ends of the
  221. communication from correlating the timing and volume
  222. of traffic entering the anonymity network with traffic leaving it. These
  223. protocols are also vulnerable against active attacks in which an
  224. adversary introduces timing patterns into traffic entering the network and
  225. looks
  226. for correlated patterns among exiting traffic.
  227. Although some work has been done to frustrate
  228. these attacks,\footnote{
  229. The most common approach is to pad and limit communication to a constant
  230. rate, or to limit
  231. the variation in traffic shape. Doing so can have prohibitive bandwidth
  232. costs and/or performance limitations.
  233. } most designs protect primarily against traffic analysis rather than traffic
  234. confirmation \cite{or-jsac98}---that is, they assume that the attacker is
  235. attempting to learn who is talking to whom, not to confirm a prior suspicion
  236. about who is talking to whom.
  237. The simplest low-latency designs are single-hop proxies such as the
  238. {\bf Anonymizer} \cite{anonymizer}, wherein a single trusted server strips the
  239. data's origin before relaying it. These designs are easy to
  240. analyze, but users must trust the anonymizing proxy.
  241. Concentrating the traffic to a single point increases the anonymity set
  242. (the people a given user is hiding among), but it is vulnerable if the
  243. adversary can observe all traffic going into and out of the proxy.
  244. More complex are distributed-trust, circuit-based anonymizing systems.
  245. In these designs, a user establishes one or more medium-term bidirectional
  246. end-to-end circuits, and tunnels data in fixed-size cells.
  247. Establishing circuits is computationally expensive and typically
  248. requires public-key
  249. cryptography, whereas relaying cells is comparatively inexpensive and
  250. typically requires only symmetric encryption.
  251. Because a circuit crosses several servers, and each server only knows
  252. the adjacent servers in the circuit, no single server can link a
  253. user to her communication partners.
  254. The {\bf Java Anon Proxy} (also known as JAP or Web MIXes) uses fixed shared
  255. routes known as \emph{cascades}. As with a single-hop proxy, this
  256. approach aggregates users into larger anonymity sets, but again an
  257. attacker only needs to observe both ends of the cascade to bridge all
  258. the system's traffic. The Java Anon Proxy's design
  259. calls for padding between end users and the head of the cascade
  260. \cite{web-mix}. However, it is not demonstrated whether the current
  261. implementation's padding policy improves anonymity.
  262. {\bf PipeNet} \cite{back01, pipenet}, another low-latency design proposed at
  263. about the same time as the original Onion Routing design, provided
  264. stronger anonymity at the cost of allowing a single user to shut
  265. down the network simply by not sending. Low-latency anonymous
  266. communication has also been designed for other environments such as
  267. ISDN \cite{isdn-mixes}.
  268. In P2P designs like {\bf Tarzan} \cite{tarzan:ccs02} and {\bf MorphMix}
  269. \cite{morphmix:fc04}, all participants both generate traffic and relay
  270. traffic for others. These systems aim to conceal
  271. whether a given peer originated a request
  272. or just relayed it from another peer. While Tarzan and MorphMix use
  273. layered encryption as above, {\bf Crowds} \cite{crowds-tissec} simply assumes
  274. an adversary who cannot observe the initiator: it uses no public-key
  275. encryption, so any node on a circuit can read that circuit's traffic.
  276. {\bf Hordes} \cite{hordes-jcs} is based on Crowds but also uses multicast
  277. responses to hide the initiator. {\bf Herbivore} \cite{herbivore} and
  278. {\bf P5} \cite{p5} go even further, requiring broadcast.
  279. % XXX This should be $P^5$ in bold. How to do it? -RD
  280. These systems are designed primarily for communication between peers,
  281. although Herbivore users can make external connections by
  282. requesting a peer to serve as a proxy.
  283. Systems like {\bf Freedom} and the original Onion Routing build the circuit
  284. all at once, using a layered ``onion'' of public-key encrypted messages,
  285. each layer of which provides a set of session keys and the address of the
  286. next server in the circuit. Tor as described herein, Tarzan, MorphMix,
  287. {\bf Cebolla} \cite{cebolla}, and Rennhard's {\bf Anonymity Network} \cite{anonnet}
  288. build the circuit
  289. in stages, extending it one hop at a time.
  290. Section~\ref{subsubsec:constructing-a-circuit} describes how this
  291. approach makes perfect forward secrecy feasible.
  292. Circuit-based anonymity designs must choose which protocol layer
  293. to anonymize. They may choose to intercept IP packets directly, and
  294. relay them whole (stripping the source address) along the circuit
  295. \cite{freedom2-arch,tarzan:ccs02}. Alternatively, like
  296. Tor, they may accept TCP streams and relay the data in those streams
  297. along the circuit, ignoring the breakdown of that data into TCP segments
  298. \cite{morphmix:fc04,anonnet}. Finally, they may accept application-level
  299. protocols (such as HTTP) and relay the application requests themselves
  300. along the circuit.
  301. Making this protocol-layer decision requires a compromise between flexibility
  302. and anonymity. For example, a system that understands HTTP, such as Crowds,
  303. can strip
  304. identifying information from those requests, can take advantage of caching
  305. to limit the number of requests that leave the network, and can batch
  306. or encode those requests in order to minimize the number of connections.
  307. On the other hand, an IP-level anonymizer can handle nearly any protocol,
  308. even ones unforeseen by its designers (though these systems require
  309. kernel-level modifications to some operating systems, and so are more
  310. complex and less portable). TCP-level anonymity networks like Tor present
  311. a middle approach: they are fairly application neutral (so long as the
  312. application supports, or can be tunneled across, TCP), but by treating
  313. application connections as data streams rather than raw TCP packets,
  314. they avoid the well-known inefficiencies of tunneling TCP over TCP
  315. \cite{tcp-over-tcp-is-bad}.
  316. Distributed-trust anonymizing systems need to prevent attackers from
  317. adding too many servers and thus compromising user paths.
  318. Tor relies on a small set of well-known directory servers, run by
  319. independent parties, to decide which nodes can
  320. join. Tarzan and MorphMix allow unknown users to run servers, and use
  321. a limited resource (like IP addresses) to prevent an attacker from
  322. controlling too much of the network. Crowds suggests requiring
  323. written, notarized requests from potential crowd members.
  324. Anonymous communication is essential for censorship-resistant
  325. systems like Eternity \cite{eternity}, Free~Haven \cite{freehaven-berk},
  326. Publius \cite{publius}, and Tangler \cite{tangler}. Tor's rendezvous
  327. points enable connections between mutually anonymous entities; they
  328. are a building block for location-hidden servers, which are needed by
  329. Eternity and Free~Haven.
  330. % didn't include rewebbers. No clear place to put them, so I'll leave
  331. % them out for now. -RD
  332. \Section{Design goals and assumptions}
  333. \label{sec:assumptions}
  334. \SubSection{Goals}
  335. Like other low-latency anonymity designs, Tor seeks to frustrate
  336. attackers from linking communication partners, or from linking
  337. multiple communications to or from a single user. Within this
  338. main goal, however, several considerations have directed
  339. Tor's evolution.
  340. \textbf{Deployability:} The design must be implemented,
  341. deployed, and used in the real world. This requirement precludes designs
  342. that are expensive to run (for example, by requiring more bandwidth
  343. than volunteers are willing to provide); designs that place a heavy
  344. liability burden on operators (for example, by allowing attackers to
  345. implicate onion routers in illegal activities); and designs that are
  346. difficult or expensive to implement (for example, by requiring kernel
  347. patches, or separate proxies for every protocol). This requirement also
  348. precludes systems in which non-anonymous parties (such as websites)
  349. must run our software. (Our rendezvous point design does not meet
  350. this goal for non-anonymous users talking to hidden servers,
  351. however; see Section~\ref{sec:rendezvous}.)
  352. \textbf{Usability:} A hard-to-use system has fewer users---and because
  353. anonymity systems hide users among users, a system with fewer users
  354. provides less anonymity. Usability is thus not only a convenience:
  355. it is a security requirement \cite{econymics,back01}. Tor should
  356. therefore not
  357. require modifying applications; should not introduce prohibitive delays;
  358. and should require users to make as few configuration decisions
  359. as possible. Finally, Tor should be easily implemented on all common
  360. platforms; we cannot require users to change their operating system in order
  361. to be anonymous. (The current Tor implementation runs on Windows and
  362. assorted Unix clones including Linux, FreeBSD, and MacOS X.)
  363. \textbf{Flexibility:} The protocol must be flexible and well-specified,
  364. so that it can serve as a test-bed for future research in low-latency
  365. anonymity systems. Many of the open problems in low-latency anonymity
  366. networks, such as generating dummy traffic or preventing Sybil attacks
  367. \cite{sybil}, may be solvable independently from the issues solved by
  368. Tor. Hopefully future systems will not need to reinvent Tor's design.
  369. (But note that while a flexible design benefits researchers,
  370. there is a danger that differing choices of extensions will make users
  371. distinguishable. Experiments should be run on a separate network.)
  372. \textbf{Simple design:} The protocol's design and security
  373. parameters must be well-understood. Additional features impose implementation
  374. and complexity costs; adding unproven techniques to the design threatens
  375. deployability, readability, and ease of security analysis. Tor aims to
  376. deploy a simple and stable system that integrates the best well-understood
  377. approaches to protecting anonymity.
  378. \SubSection{Non-goals}
  379. \label{subsec:non-goals}
  380. In favoring simple, deployable designs, we have explicitly deferred
  381. several possible goals, either because they are solved elsewhere, or because
  382. their solution is an open research problem.
  383. \textbf{Not peer-to-peer:} Tarzan and MorphMix aim to scale to completely
  384. decentralized peer-to-peer environments with thousands of short-lived
  385. servers, many of which may be controlled by an adversary. This approach
  386. is appealing, but still has many open problems
  387. \cite{tarzan:ccs02,morphmix:fc04}.
  388. \textbf{Not secure against end-to-end attacks:} Tor does not claim
  389. to provide a definitive solution to end-to-end timing or intersection
  390. attacks. Some approaches, such as running an onion router, may help;
  391. see Section~\ref{sec:attacks} for more discussion.
  392. % XXX P2P issues here. -NM
  393. \textbf{No protocol normalization:} Tor does not provide \emph{protocol
  394. normalization} like Privoxy or the Anonymizer. If anonymization from
  395. the responder is desired for complex and variable
  396. protocols like HTTP, Tor must be layered with a filtering proxy such
  397. as Privoxy to hide differences between clients, and expunge protocol
  398. features that leak identity.
  399. Note that by this separation Tor can also provide services that
  400. are anonymous to the network yet authenticated to the responder, like
  401. SSH.
  402. Similarly, Tor does not currently integrate
  403. tunneling for non-stream-based protocols like UDP; this too must be
  404. provided by an external service.
  405. \textbf{Does not provide untraceability:} Tor does not try to conceal
  406. which users are
  407. sending or receiving communications; it only tries to conceal with whom
  408. they communicate.
  409. \SubSection{Threat Model}
  410. \label{subsec:threat-model}
  411. A global passive adversary is the most commonly assumed threat when
  412. analyzing theoretical anonymity designs. But like all practical
  413. low-latency systems, Tor does not protect against such a strong
  414. adversary. Instead, we assume an adversary who can observe some fraction
  415. of network traffic; who can generate, modify, delete, or delay traffic
  416. on the network; who can operate onion routers of its own; and who can
  417. compromise some fraction of the onion routers on the network.
  418. In low-latency anonymity systems that use layered encryption, the
  419. adversary's typical goal is to observe both the initiator and the
  420. responder. By observing both ends, passive attackers can confirm a
  421. suspicion that Alice is
  422. talking to Bob if the timing and volume patterns of the traffic on the
  423. connection are distinct enough; active attackers can induce timing
  424. signatures on the traffic to force distinct patterns. Rather
  425. than focusing on these \emph{traffic confirmation} attacks,
  426. we aim to prevent \emph{traffic
  427. analysis} attacks, where the adversary uses traffic patterns to learn
  428. which points in the network he should attack.
  429. Our adversary might try to link an initiator Alice with any of her
  430. communication partners, or he might try to build a profile of Alice's
  431. behavior. He might mount passive attacks by observing the edges of the
  432. network and correlating traffic entering and leaving the network---either
  433. by relationships in packet timing; relationships in the volume
  434. of data sent; or relationships in any externally visible user-selected
  435. options. The adversary can also mount active attacks by compromising
  436. routers or keys; by replaying traffic; by selectively denying service
  437. to trustworthy routers to encourage users to send their traffic through
  438. compromised routers, or denying service to users to see if the traffic
  439. elsewhere in the
  440. network stops; or by introducing patterns into traffic that can later be
  441. detected. The adversary might subvert the directory servers to give users
  442. differing views of network state. Additionally, he can try to decrease
  443. the network's reliability by attacking nodes or by performing antisocial
  444. activities from reliable servers and trying to get them taken down;
  445. making the network unreliable flushes users to other less anonymous
  446. systems, where they may be easier to attack.
  447. We consider each of these attacks in more detail below, and summarize
  448. in Section~\ref{sec:attacks} how well the Tor design defends against
  449. each of them.
  450. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  451. \Section{The Tor Design}
  452. \label{sec:design}
  453. The Tor network is an overlay network; onion routers run as normal
  454. user-level processes without needing any special privileges.
  455. Each onion router maintains a long-term TLS \cite{TLS}
  456. connection to every other onion router.
  457. %(We further discuss this clique-topology assumption in
  458. %Section~\ref{sec:maintaining-anonymity}.)
  459. % A subset of the ORs also act as
  460. %directory servers, tracking which routers are in the network;
  461. %see Section~\ref{subsec:dirservers} for directory server details.
  462. Each user
  463. runs local software called an onion proxy (OP) to fetch directories,
  464. establish circuits across the network,
  465. and handle connections from user applications. These onion proxies accept
  466. TCP streams and multiplex them across the circuit. The onion
  467. router on the other side
  468. of the circuit connects to the destinations of
  469. the TCP streams and relays data.
  470. Each onion router uses three public keys: a long-term identity key, a
  471. short-term onion key, and a short-term link key. The identity
  472. (signing) key is used to sign TLS certificates, to sign its router
  473. descriptor (a summary of its keys, address, bandwidth, exit policy,
  474. etc), and to sign directories if it is a directory server. Changing
  475. the identity key of a router is considered equivalent to creating a
  476. new router. The onion (decryption) key is used for decrypting requests
  477. from users to set up a circuit and negotiate ephemeral keys. Finally,
  478. link keys are used by the TLS protocol when communicating between
  479. onion routers. Each short-term key is rotated periodically and
  480. independently, to limit the impact of key compromise.
  481. Section~\ref{subsec:cells} discusses the structure of the fixed-size
  482. \emph{cells} that are the unit of communication in Tor. We describe
  483. in Section~\ref{subsec:circuits} how circuits are
  484. built, extended, truncated, and destroyed. Section~\ref{subsec:tcp}
  485. describes how TCP streams are routed through the network, and finally
  486. Section~\ref{subsec:congestion} talks about congestion control and
  487. fairness issues.
  488. % NICK
  489. % XXX \ref{subsec:integrity-checking} is missing
  490. % XXX \ref{xubsec:rate-limit is missing.
  491. \SubSection{Cells}
  492. \label{subsec:cells}
  493. Onion routers communicate with one another, and with users' OPs, via TLS
  494. connections with ephemeral keys. This prevents an attacker from
  495. impersonating an OR, conceals the contents of the connection with
  496. perfect forward secrecy, and prevents an attacker from modifying data
  497. on the wire.
  498. Traffic passes along these connections in fixed-size cells. Each cell
  499. is 256 bytes (but see Section~\ref{sec:conclusion} for a discussion of
  500. allowing large cells and small cells on the same network), and
  501. consists of a header and a payload. The header includes a circuit
  502. identifier (circID) that specifies which circuit the cell refers to
  503. (many circuits can be multiplexed over the single TLS connection), and
  504. a command to describe what to do with the cell's payload. (Circuit
  505. identifiers are connection-specific: each single circuit has a different
  506. circID on each OP/OR or OR/OR connection it traverses.)
  507. Based on their command, cells are either \emph{control} cells, which are
  508. always interpreted by the node that receives them, or \emph{relay} cells,
  509. which carry end-to-end stream data. The control cell commands are:
  510. \emph{padding} (currently used for keepalive, but also usable for link
  511. padding); \emph{create} or \emph{created} (used to set up a new circuit);
  512. and \emph{destroy} (to tear down a circuit).
  513. Relay cells have an additional header (the relay header) after the
  514. cell header, containing the stream identifier (many streams can
  515. be multiplexed over a circuit); an end-to-end checksum for integrity
  516. checking; the length of the relay payload; and a relay command.
  517. The entire contents of the relay header and the relay cell payload
  518. are encrypted or decrypted together as the relay cell moves along the
  519. circuit, using the 128-bit AES cipher in counter mode to generate a
  520. cipher stream.
  521. The
  522. relay commands are: \emph{relay
  523. data} (for data flowing down the stream), \emph{relay begin} (to open a
  524. stream), \emph{relay end} (to close a stream cleanly), \emph{relay
  525. teardown} (to close a broken stream), \emph{relay connected}
  526. (to notify the OP that a relay begin has succeeded), \emph{relay
  527. extend} and \emph{relay extended} (to extend the circuit by a hop,
  528. and to acknowledge), \emph{relay truncate} and \emph{relay truncated}
  529. (to tear down only part of the circuit, and to acknowledge), \emph{relay
  530. sendme} (used for congestion control), and \emph{relay drop} (used to
  531. implement long-range dummies).
  532. We describe each of these cell types and commands in more detail below.
  533. \SubSection{Circuits and streams}
  534. \label{subsec:circuits}
  535. The original Onion Routing design built one circuit for each
  536. TCP stream. Because building a circuit can take several tenths of a
  537. second (due to public-key cryptography delays and network latency),
  538. this design imposed high costs on applications like web browsing that
  539. open many TCP streams.
  540. In Tor, each circuit can be shared by many TCP streams. To avoid
  541. delays, users construct circuits preemptively. To limit linkability
  542. among their streams, users' OPs build a new circuit
  543. periodically if the previous one has been used,
  544. and expire old used circuits that no longer have any open streams.
  545. OPs consider making a new circuit once a minute: thus
  546. even heavy users spend a negligible amount of time and CPU in
  547. building circuits, but only a limited number of requests can be linked
  548. to each other through a given exit node. Also, because circuits are built
  549. in the background, OPs can recover from failed circuit creation
  550. without delaying streams and thereby harming user experience.
  551. \subsubsection{Constructing a circuit}
  552. \label{subsubsec:constructing-a-circuit}
  553. A user's OP constructs a circuit incrementally, negotiating a
  554. symmetric key with each OR on the circuit, one hop at a time. To begin
  555. creating a new circuit, the OP (call her Alice) sends a
  556. \emph{create} cell to the first node in her chosen path (call him Bob).
  557. (She chooses a new
  558. circID $C_{AB}$ not currently used on the connection from her to Bob.)
  559. This cell's
  560. payload contains the first half of the Diffie-Hellman handshake
  561. ($g^x$), encrypted to the onion key of the OR (call him Bob). Bob
  562. responds with a \emph{created} cell containing the second half of the
  563. DH handshake, along with a hash of the negotiated key $K=g^{xy}$.
  564. Once the circuit has been established, Alice and Bob can send one
  565. another relay cells encrypted with the negotiated
  566. key.\footnote{Actually, the negotiated key is used to derive two
  567. symmetric keys: one for each direction.} More detail is given in
  568. the next section.
  569. To extend the circuit further, Alice sends a \emph{relay extend} cell
  570. to Bob, specifying the address of the next OR (call her Carol), and
  571. an encrypted $g^{x_2}$ for her. Bob copies the half-handshake into a
  572. \emph{create} cell, and passes it to Carol to extend the circuit.
  573. (Bob chooses a new circID $C_{BC}$ not currently used on the connection
  574. between him and Carol. Alice never needs to know this circID; only Bob
  575. associates $C_{AB}$ on his connection with Alice to $C_{BC}$ on
  576. his connection with Carol.)
  577. When Carol responds with a \emph{created} cell, Bob wraps the payload
  578. into a \emph{relay extended} cell and passes it back to Alice. Now
  579. the circuit is extended to Carol, and Alice and Carol share a common key
  580. $K_2 = g^{x_2 y_2}$.
  581. To extend the circuit to a third node or beyond, Alice
  582. proceeds as above, always telling the last node in the circuit to
  583. extend one hop further.
  584. This circuit-level handshake protocol achieves unilateral entity
  585. authentication (Alice knows she's handshaking with the OR, but
  586. the OR doesn't care who is opening the circuit---Alice has no key
  587. and is trying to remain anonymous) and unilateral key authentication
  588. (Alice and the OR agree on a key, and Alice knows the OR is the
  589. only other entity who should know it). It also achieves forward
  590. secrecy and key freshness. More formally, the protocol is as follows
  591. (where $E_{PK_{Bob}}(\cdot)$ is encryption with Bob's public key,
  592. $H$ is a secure hash function, and $|$ is concatenation):
  593. \begin{equation}
  594. \begin{aligned}
  595. \mathrm{Alice} \rightarrow \mathrm{Bob}&: E_{PK_{Bob}}(g^x) \\
  596. \mathrm{Bob} \rightarrow \mathrm{Alice}&: g^y, H(K | \mathrm{``handshake"}) \\
  597. \end{aligned}
  598. \end{equation}
  599. In the second step, Bob proves that it was he who who received $g^x$,
  600. and who came up with $y$. We use PK encryption in the first step
  601. (rather than, say, using the first two steps of STS, which has a
  602. signature in the second step) because a single cell is too small to
  603. hold both a public key and a signature. Preliminary analysis with the
  604. NRL protocol analyzer \cite{meadows96} shows the above protocol to be
  605. secure (including providing perfect forward secrecy) under the
  606. traditional Dolev-Yao model.
  607. \subsubsection{Relay cells}
  608. Once Alice has established the circuit (so she shares keys with each
  609. OR on the circuit), she can send relay cells. Recall that every relay
  610. cell has a streamID in the relay header that indicates to which
  611. stream the cell belongs. This streamID allows a relay cell to be
  612. addressed to any of the ORs on the circuit. Upon receiving a relay
  613. cell, an OR looks up the corresponding circuit, and decrypts the relay
  614. header and payload with the appropriate session key for that circuit.
  615. If the cell is headed downstream (away from Alice) it then checks
  616. whether the decrypted streamID is recognized---either because it
  617. corresponds to an open stream at this OR for the circuit, or because
  618. it is equal to the control streamID (zero). If the OR recognizes the
  619. streamID, it accepts the relay cell and processes it as described
  620. below. Otherwise,
  621. the OR looks up the circID and OR for the
  622. next step in the circuit, replaces the circID as appropriate, and
  623. sends the decrypted relay cell to the next OR. (If the OR at the end
  624. of the circuit receives an unrecognized relay cell, an error has
  625. occurred, and the cell is discarded.)
  626. OPs treat incoming relay cells similarly: they iteratively unwrap the
  627. relay header and payload with the session key shared with each
  628. OR on the circuit, from the closest to farthest. (Because we use a
  629. stream cipher, encryption operations may be inverted in any order.)
  630. If at any stage the OP recognizes the streamID, the cell must have
  631. originated at the OR whose encryption has just been removed.
  632. To construct a relay cell addressed to a given OR, Alice iteratively
  633. encrypts the cell payload (that is, the relay header and payload) with
  634. the symmetric key of each hop up to that OR. Because the streamID is
  635. encrypted to a different value at each step, only at the targeted OR
  636. will it have a meaningful value.\footnote{
  637. % Should we just say that 2^56 is itself negligible?
  638. % Assuming 4-hop circuits with 10 streams per hop, there are 33
  639. % possible bad streamIDs before the last circuit. This still
  640. % gives an error only once every 2 million terabytes (approx).
  641. With 56 bits of streamID per cell, the probability of an accidental
  642. collision is far lower than the chance of hardware failure.}
  643. This \emph{leaky pipe} circuit topology
  644. allows Alice's streams to exit at different ORs on a single circuit.
  645. Alice may choose different exit points because of their exit policies,
  646. or to keep the ORs from knowing that two streams
  647. originate at the same person.
  648. When an OR later replies to Alice with a relay cell, it only needs to
  649. encrypt the cell's relay header and payload with the single key it
  650. shares with Alice, and send the cell back toward Alice along the
  651. circuit. Subsequent ORs add further layers of encryption as they
  652. relay the cell back to Alice.
  653. To tear down a whole circuit, Alice sends a \emph{destroy} control
  654. cell. Each OR in the circuit receives the \emph{destroy} cell, closes
  655. all open streams on that circuit, and passes a new \emph{destroy} cell
  656. forward. But just as circuits are built incrementally, they can also
  657. be torn down incrementally: Alice can instead send a \emph{relay
  658. truncate} cell to a single OR on the circuit. That node then sends a
  659. \emph{destroy} cell forward, and acknowledges with a
  660. \emph{relay truncated} cell. Alice can then extend the circuit to
  661. different nodes, all without signaling to the intermediate nodes (or
  662. somebody observing them) that she has changed her circuit.
  663. Similarly, if a node on the circuit goes down, the adjacent
  664. node can send a \emph{relay truncated} cell back to Alice. Thus the
  665. ``break a node and see which circuits go down'' attack
  666. \cite{freedom21-security} is weakened.
  667. \SubSection{Opening and closing streams}
  668. \label{subsec:tcp}
  669. When Alice's application wants to open a TCP connection to a given
  670. address and port, it asks the OP (via SOCKS) to make the
  671. connection. The OP chooses the newest open circuit (or creates one if
  672. none is available), chooses a suitable OR on that circuit to be the
  673. exit node (usually the last node, but maybe others due to exit policy
  674. conflicts; see Section~\ref{subsec:exitpolicies}), chooses a new
  675. random streamID for the stream, and sends a \emph{relay begin} cell
  676. to that exit node. The OP uses a streamID of zero for this cell
  677. (so the OR will recognize it), and uses the new streamID, destination
  678. address, and port as the contents of the cell's relay payload. Once the
  679. exit node completes the connection to the remote host, it responds
  680. with a \emph{relay connected} cell. Upon receipt, the OP sends a
  681. SOCKS reply to the application notifying it of success. The OP
  682. now accepts data from the application's TCP stream, packaging it into
  683. \emph{relay data} cells and sending those cells along the circuit to
  684. the chosen OR.
  685. There's a catch to using SOCKS, however---some applications pass the
  686. alphanumeric hostname to the proxy, while others resolve it into an IP
  687. address first and then pass the IP address to the proxy. If the
  688. application does the DNS resolution first, Alice will thereby
  689. broadcast her destination to the DNS server. Common applications
  690. like Mozilla and SSH have this flaw.
  691. In the case of Mozilla, the flaw is easy to address: the filtering web
  692. proxy called Privoxy does the SOCKS call safely, and Mozilla talks to
  693. Privoxy safely. But a portable general solution, such as is needed for
  694. SSH, is
  695. an open problem. Modifying or replacing the local nameserver
  696. can be invasive, brittle, and not portable. Forcing the resolver
  697. library to do resolution via TCP rather than UDP is
  698. hard, and also has portability problems. We could provide a
  699. tool similar to \emph{dig} to perform a private lookup through the
  700. Tor network. Our current answer is to encourage the use of
  701. privacy-aware proxies like Privoxy wherever possible.
  702. Closing a Tor stream is analogous to closing a TCP stream: it uses a
  703. two-step handshake for normal operation, or a one-step handshake for
  704. errors. If the stream closes abnormally, the adjacent node simply sends a
  705. \emph{relay teardown} cell. If the stream closes normally, the node sends
  706. a \emph{relay end} cell down the circuit. When the other side has sent
  707. back its own \emph{relay end}, the stream can be torn down. Because
  708. all relay cells use layered encryption, only the destination OR knows
  709. that a given relay cell is a request to close a stream. This two-step
  710. handshake allows for TCP-based applications that use half-closed
  711. connections, such as broken HTTP clients that close their side of the
  712. stream after writing but are still willing to read.
  713. \SubSection{Integrity checking on streams}
  714. \label{subsec:integrity-checking}
  715. Because the old Onion Routing design used a stream cipher, traffic was
  716. vulnerable to a malleability attack: even though the attacker could not
  717. decrypt cells, he could make changes to an encrypted
  718. cell to create corresponding changes to the data leaving the network.
  719. (Even an external adversary could do this, despite link encryption, by
  720. inverting bits on the wire.)
  721. This weakness allowed an adversary to change a padding cell to a destroy
  722. cell; change the destination address in a relay begin cell to the
  723. adversary's webserver; or change a user on an ftp connection from
  724. typing ``dir'' to typing ``delete~*''. Any node or external adversary
  725. along the circuit could introduce such corruption in a stream---if it
  726. knew or could guess the encrypted content.
  727. Tor prevents external adversaries from mounting this attack by
  728. using TLS on its links, which provides integrity checking.
  729. Addressing the insider malleability attack, however, is
  730. more complex.
  731. We could do integrity checking of the relay cells at each hop, either
  732. by including hashes or by using an authenticating cipher mode like
  733. EAX \cite{eax}, but there are some problems. First, these approaches
  734. impose a message-expansion overhead at each hop, and so we would have to
  735. either leak the path length or waste bytes by padding to a maximum
  736. path length. Second, these solutions can only verify traffic coming
  737. from Alice: ORs would not be able to include suitable hashes for
  738. the intermediate hops, since the ORs on a circuit do not know the
  739. other ORs' session keys. Third, we have already accepted that our design
  740. is vulnerable to end-to-end timing attacks; tagging attacks performed
  741. within the circuit provide no additional information to the attacker.
  742. Thus, we check integrity only at the edges of each stream. When Alice
  743. negotiates a key with a new hop, they both initialize a pair of SHA-1
  744. digests with a derivative of that key,
  745. thus beginning with randomness that only the two of them know. From
  746. then on they each incrementally add to the SHA-1 digests the contents of
  747. all relay cells they create or accept (one digest is for cells
  748. created; one is for cells accepted), and include with each relay cell
  749. the first 4 bytes of the current value of the hash of cells created.
  750. To be sure of removing or modifying a cell, the attacker must be able
  751. to either deduce the current digest state (which depends on all
  752. traffic between Alice and Bob, starting with their negotiated key).
  753. Attacks on SHA-1 where the adversary can incrementally add to a hash
  754. to produce a new valid hash don't work, because all hashes are
  755. end-to-end encrypted across the circuit. The computational overhead
  756. of computing the digests is minimal compared to doing the AES
  757. encryption performed at each hop of the circuit. We use only four
  758. bytes per cell to minimize overhead; the chance that an adversary will
  759. correctly guess a valid hash, plus the payload the current cell, is
  760. acceptably low, given that Alice or Bob tear down the circuit if they
  761. receive a bad hash.
  762. \SubSection{Rate limiting and fairness}
  763. \label{subsec:rate-limit}
  764. Volunteers are generally more willing to run services that can limit
  765. their bandwidth usage. To accommodate them, Tor servers use a
  766. token bucket approach \cite{tannenbaum96} to
  767. enforce a long-term average rate of incoming bytes, while still
  768. permitting short-term bursts above the allowed bandwidth. Current bucket
  769. sizes are set to ten seconds' worth of traffic.
  770. %Further, we want to avoid starving any Tor streams. Entire circuits
  771. %could starve if we read greedily from connections and one connection
  772. %uses all the remaining bandwidth. We solve this by dividing the number
  773. %of tokens in the bucket by the number of connections that want to read,
  774. %and reading at most that number of bytes from each connection. We iterate
  775. %this procedure until the number of tokens in the bucket is under some
  776. %threshold (currently 10KB), at which point we greedily read from connections.
  777. Because the Tor protocol generates roughly the same number of outgoing
  778. bytes as incoming bytes, it is sufficient in practice to limit only
  779. incoming bytes.
  780. With TCP streams, however, the correspondence is not one-to-one:
  781. relaying a single incoming byte can require an entire 256-byte cell.
  782. (We can't just wait for more bytes, because the local application may
  783. be waiting for a reply.) Therefore, we treat this case as if the entire
  784. cell size had been read, regardless of the fullness of the cell.
  785. Further, inspired by Rennhard et al's design in \cite{anonnet}, a
  786. circuit's edges heuristically distinguish interactive streams from bulk
  787. streams by comparing the frequency with which they supply cells. We can
  788. provide good latency for interactive streams by giving them preferential
  789. service, while still getting good overall throughput to the bulk
  790. streams. Such preferential treatment presents a possible end-to-end
  791. attack, but an adversary who can observe both
  792. ends of the stream can already learn this information through timing
  793. attacks.
  794. \SubSection{Congestion control}
  795. \label{subsec:congestion}
  796. Even with bandwidth rate limiting, we still need to worry about
  797. congestion, either accidental or intentional. If enough users choose the
  798. same OR-to-OR connection for their circuits, that connection can become
  799. saturated. For example, an adversary could make a large HTTP PUT request
  800. through the onion routing network to a webserver he runs, and then
  801. refuse to read any of the bytes at the webserver end of the
  802. circuit. Without some congestion control mechanism, these bottlenecks
  803. can propagate back through the entire network. We don't need to
  804. reimplement full TCP windows (with sequence numbers,
  805. the ability to drop cells when we're full and retransmit later, etc),
  806. because TCP already guarantees in-order delivery of each
  807. cell.
  808. %But we need to investigate further the effects of the current
  809. %parameters on throughput and latency, while also keeping privacy in mind;
  810. %see Section~\ref{sec:maintaining-anonymity} for more discussion.
  811. We describe our response below.
  812. \subsubsection{Circuit-level throttling}
  813. To control a circuit's bandwidth usage, each OR keeps track of two
  814. windows. The \emph{packaging window} tracks how many relay data cells the OR is
  815. allowed to package (from outside TCP streams) for transmission back to the OP,
  816. and the \emph{delivery window} tracks how many relay data cells it is willing
  817. to deliver to TCP streams outside the network. Each window is initialized
  818. (say, to 1000 data cells). When a data cell is packaged or delivered,
  819. the appropriate window is decremented. When an OR has received enough
  820. data cells (currently 100), it sends a \emph{relay sendme} cell towards the OP,
  821. with streamID zero. When an OR receives a \emph{relay sendme} cell with
  822. streamID zero, it increments its packaging window. Either of these cells
  823. increments the corresponding window by 100. If the packaging window
  824. reaches 0, the OR stops reading from TCP connections for all streams
  825. on the corresponding circuit, and sends no more relay data cells until
  826. receiving a \emph{relay sendme} cell.
  827. The OP behaves identically, except that it must track a packaging window
  828. and a delivery window for every OR in the circuit. If a packaging window
  829. reaches 0, it stops reading from streams destined for that OR.
  830. \subsubsection{Stream-level throttling}
  831. The stream-level congestion control mechanism is similar to the
  832. circuit-level mechanism above. ORs and OPs use \emph{relay sendme} cells
  833. to implement end-to-end flow control for individual streams across
  834. circuits. Each stream begins with a packaging window (currently 500 cells),
  835. and increments the window by a fixed value (50) upon receiving a \emph{relay
  836. sendme} cell. Rather than always returning a \emph{relay sendme} cell as soon
  837. as enough cells have arrived, the stream-level congestion control also
  838. has to check whether data has been successfully flushed onto the TCP
  839. stream; it sends the \emph{relay sendme} cell only when the number of bytes pending
  840. to be flushed is under some threshold (currently 10 cells' worth).
  841. Currently, non-data relay cells do not affect the windows. Thus we
  842. avoid potential deadlock issues, for example, arising because a stream
  843. can't send a \emph{relay sendme} cell when its packaging window is empty.
  844. \Section{Other design decisions}
  845. \SubSection{Resource management and denial-of-service}
  846. \label{subsec:dos}
  847. Providing Tor as a public service provides many opportunities for an
  848. attacker to mount denial-of-service attacks against the network. While
  849. flow control and rate limiting (discussed in
  850. Section~\ref{subsec:congestion}) prevent users from consuming more
  851. bandwidth than routers are willing to provide, opportunities remain for
  852. users to
  853. consume more network resources than their fair share, or to render the
  854. network unusable for other users.
  855. First of all, there are several CPU-consuming denial-of-service
  856. attacks wherein an attacker can force an OR to perform expensive
  857. cryptographic operations. For example, an attacker who sends a
  858. \emph{create} cell full of junk bytes can force an OR to perform an RSA
  859. decrypt. Similarly, an attacker can
  860. fake the start of a TLS handshake, forcing the OR to carry out its
  861. (comparatively expensive) half of the handshake at no real computational
  862. cost to the attacker.
  863. Several approaches exist to address these attacks. First, ORs may
  864. require clients to solve a puzzle \cite{puzzles-tls} while beginning new
  865. TLS handshakes or accepting \emph{create} cells. So long as these
  866. tokens are easy to verify and computationally expensive to produce, this
  867. approach limits the attack multiplier. Additionally, ORs may limit
  868. the rate at which they accept create cells and TLS connections, so that
  869. the computational work of processing them does not drown out the (comparatively
  870. inexpensive) work of symmetric cryptography needed to keep cells
  871. flowing. This rate limiting could, however, allow an attacker
  872. to slow down other users when they build new circuits.
  873. % What about link-to-link rate limiting?
  874. Attackers also have an opportunity to attack the Tor network by mounting
  875. attacks on its hosts and network links. Disrupting a single circuit or
  876. link breaks all currently open streams passing along that part of the
  877. circuit. Indeed, this same loss of service occurs when a router crashes
  878. or its operator restarts it. The current Tor design treats such attacks
  879. as intermittent network failures, and depends on users and applications
  880. to respond or recover as appropriate. A future design could use an
  881. end-to-end TCP-like acknowledgment protocol, so that no streams are
  882. lost unless the entry or exit point itself is disrupted. This solution
  883. would require more buffering at the network edges, however, and the
  884. performance and anonymity implications from this extra complexity still
  885. require investigation.
  886. \SubSection{Exit policies and abuse}
  887. \label{subsec:exitpolicies}
  888. %XXX originally, we planned to put the "users only know the hostname,
  889. % not the IP, but exit policies are by IP" problem here too. Worth
  890. % while still? -RD
  891. Exit abuse is a serious barrier to wide-scale Tor deployment. Anonymity
  892. presents would-be vandals and abusers with an opportunity to hide
  893. the origins of their activities. Attackers can harm the Tor network by
  894. implicating exit servers for their abuse. Also, applications that commonly
  895. use IP-based authentication (such as institutional mail or web servers)
  896. can be fooled by the fact that anonymous connections appear to originate
  897. at the exit OR.
  898. We stress that Tor does not enable any new class of abuse. Spammers
  899. and other attackers already have access to thousands of misconfigured
  900. systems worldwide, and the Tor network is far from the easiest way
  901. to launch these antisocial or illegal attacks.
  902. %Indeed, because of its limited
  903. %anonymity, Tor is probably not a good way to commit crimes.
  904. But because the
  905. onion routers can easily be mistaken for the originators of the abuse,
  906. and the volunteers who run them may not want to deal with the hassle of
  907. repeatedly explaining anonymity networks, we must block or limit attacks
  908. and other abuse that travel through the Tor network.
  909. To mitigate abuse issues, in Tor, each onion router's \emph{exit policy}
  910. describes to which external addresses and ports the router will permit
  911. stream connections. On one end of the spectrum are \emph{open exit}
  912. nodes that will connect anywhere. On the other end are \emph{middleman}
  913. nodes that only relay traffic to other Tor nodes, and \emph{private exit}
  914. nodes that only connect to a local host or network. Using a private
  915. exit (if one exists) is a more secure way for a client to connect to a
  916. given host or network---an external adversary cannot eavesdrop traffic
  917. between the private exit and the final destination, and so is less sure of
  918. Alice's destination and activities. Most onion routers will function as
  919. \emph{restricted exits} that permit connections to the world at large,
  920. but prevent access to certain abuse-prone addresses and services. In
  921. general, nodes can require a variety of forms of traffic authentication
  922. \cite{or-discex00}.
  923. %The abuse issues on closed (e.g. military) networks are different
  924. %from the abuse on open networks like the Internet. While these IP-based
  925. %access controls are still commonplace on the Internet, on closed networks,
  926. %nearly all participants will be honest, and end-to-end authentication
  927. %can be assumed for important traffic.
  928. Many administrators will use port restrictions to support only a
  929. limited set of well-known services, such as HTTP, SSH, or AIM.
  930. This is not a complete solution, of course, since abuse opportunities for these
  931. protocols are still well known.
  932. A further solution may be to use proxies to clean traffic for certain
  933. protocols as it leaves the network. For example, much abusive HTTP
  934. behavior (such as exploiting buffer overflows or well-known script
  935. vulnerabilities) can be detected in a straightforward manner.
  936. Similarly, one could run automatic spam filtering software (such as
  937. SpamAssassin) on email exiting the OR network.
  938. ORs may also choose to rewrite exiting traffic in order to append
  939. headers or other information to indicate that the traffic has passed
  940. through an anonymity service. This approach is commonly used
  941. by email-only anonymity systems. When possible, ORs can also
  942. run on servers with hostnames such as {\it anonymous}, to further
  943. alert abuse targets to the nature of the anonymous traffic.
  944. A mixture of open and restricted exit nodes will allow the most
  945. flexibility for volunteers running servers. But while many
  946. middleman nodes help provide a large and robust network,
  947. having only a few exit nodes reduces the number of points
  948. an adversary needs to monitor for traffic analysis, and places a
  949. greater burden on the exit nodes. This tension can be seen in the
  950. Java Anon Proxy
  951. cascade model, wherein only one node in each cascade needs to handle
  952. abuse complaints---but an adversary only needs to observe the entry
  953. and exit of a cascade to perform traffic analysis on all that
  954. cascade's users. The hydra model (many entries, few exits) presents a
  955. different compromise: only a few exit nodes are needed, but an
  956. adversary needs to work harder to watch all the clients; see
  957. Section~\ref{sec:conclusion}.
  958. Finally, we note that exit abuse must not be dismissed as a peripheral
  959. issue: when a system's public image suffers, it can reduce the number
  960. and diversity of that system's users, and thereby reduce the anonymity
  961. of the system itself. Like usability, public perception is also a
  962. security parameter. Sadly, preventing abuse of open exit nodes is an
  963. unsolved problem, and will probably remain an arms race for the
  964. forseeable future. The abuse problems faced by Princeton's CoDeeN
  965. project \cite{darkside} give us a glimpse of likely issues.
  966. \SubSection{Directory Servers}
  967. \label{subsec:dirservers}
  968. First-generation Onion Routing designs \cite{freedom2-arch,or-jsac98} used
  969. in-band network status updates: each router flooded a signed statement
  970. to its neighbors, which propagated it onward. But anonymizing networks
  971. have different security goals than typical link-state routing protocols.
  972. For example, delays (accidental or intentional)
  973. that can cause different parts of the network to have different pictures
  974. of link-state and topology are not only inconvenient---they give
  975. attackers an opportunity to exploit differences in client knowledge.
  976. We also worry about attacks to deceive a
  977. client about the router membership list, topology, or current network
  978. state. Such \emph{partitioning attacks} on client knowledge help an
  979. adversary to efficiently deploy resources
  980. when attacking a target \cite{minion-design}.
  981. Tor uses a small group of redundant, well-known onion routers to
  982. track changes in network topology and node state, including keys and
  983. exit policies. Each such \emph{directory server} also acts as an HTTP
  984. server, so participants can fetch current network state and router
  985. lists (a \emph{directory}), and so other onion routers can upload
  986. their router descriptors. Onion routers periodically publish signed
  987. statements of their state to each directory server, which combines this
  988. state information with its own view of network liveness, and generates
  989. a signed description of the entire network state. Client software is
  990. pre-loaded with a list of the directory servers and their keys; it uses
  991. this information to bootstrap each client's view of the network.
  992. When a directory server receives a signed statement from an onion
  993. router, it recognizes the onion router by its identity key. Directory
  994. servers do not automatically advertise unrecognized ORs. (If they did,
  995. an adversary could take over the network by creating many servers
  996. \cite{sybil}.) Instead, new nodes must be approved by the directory
  997. server administrator before they are included. Mechanisms for automated
  998. node approval are an area of active research, and are discussed more
  999. in Section~\ref{sec:maintaining-anonymity}.
  1000. Of course, a variety of attacks remain. An adversary who controls
  1001. a directory server can track certain clients by providing different
  1002. information---perhaps by listing only nodes under its control, or by
  1003. informing only certain clients about a given node. Even an external
  1004. adversary can exploit differences in client knowledge: clients who use
  1005. a node listed on one directory server but not the others are vulnerable.
  1006. Thus these directory servers must be synchronized and redundant.
  1007. Directories are valid if they are signed by a threshold of the directory
  1008. servers.
  1009. The directory servers in Tor are modeled after those in Mixminion
  1010. \cite{minion-design}, but our situation is easier. First, we make the
  1011. simplifying assumption that all participants agree on the set of
  1012. directory servers. Second, while Mixminion needs to predict node
  1013. behavior, Tor only needs a threshold consensus of the current
  1014. state of the network.
  1015. Tor directory servers build a consensus directory through a simple
  1016. four-round broadcast protocol. In round one, each server dates and
  1017. signs its current opinion, and broadcasts it to the other directory
  1018. servers; then in round two, each server rebroadcasts all the signed
  1019. opinions it has received. At this point all directory servers check
  1020. to see whether any server has signed multiple opinions in the same
  1021. period. Such a server is either broken or cheating, so the protocol
  1022. stops and notifies the administrators, who either remove the cheater
  1023. or wait for the broken server to be fixed. If there are no
  1024. discrepancies, each directory server then locally computes an algorithm
  1025. (described below)
  1026. on the set of opinions, resulting in a uniform shared directory. In
  1027. round three servers sign this directory and broadcast it; and finally
  1028. in round four the servers rebroadcast the directory and all the
  1029. signatures. If any directory server drops out of the network, its
  1030. signature is not included on the final directory.
  1031. The rebroadcast steps ensure that a directory server is heard by
  1032. either all of the other servers or none of them, even when some links
  1033. are down (assuming that any two directory servers can talk directly or
  1034. via a third). Broadcasts are feasible because there are relatively few
  1035. directory servers (currently 3, but we expect as many as 9 as the network
  1036. scales). Computing the shared directory locally is a straightforward
  1037. threshold voting process: we include an OR if a majority of directory
  1038. servers believe it to be good.
  1039. To avoid attacks where a router connects to all the directory servers
  1040. but refuses to relay traffic from other routers, the directory servers
  1041. must build circuits and use them to anonymously test router reliability
  1042. \cite{mix-acc}.
  1043. Using directory servers is simpler and more flexible than flooding.
  1044. For example, flooding complicates the analysis when we
  1045. start experimenting with non-clique network topologies. And because
  1046. the directories are signed, they can be cached by other onion routers.
  1047. Thus directory servers are not a performance
  1048. bottleneck when we have many users, and do not aid traffic analysis by
  1049. forcing clients to periodically announce their existence to any
  1050. central point.
  1051. \Section{Rendezvous points and hidden services}
  1052. \label{sec:rendezvous}
  1053. Rendezvous points are a building block for \emph{location-hidden
  1054. services} (also known as \emph{responder anonymity}) in the Tor
  1055. network. Location-hidden services allow Bob to offer a TCP
  1056. service, such as a webserver, without revealing its IP address.
  1057. This type of anonymity protects against distributed DoS attacks:
  1058. attackers are forced to attack the onion routing network as a whole
  1059. rather than just Bob's IP address.
  1060. Our design for location-hidden servers has the following goals.
  1061. \textbf{Access-controlled:} Bob needs a way to filter incoming requests,
  1062. so an attacker cannot flood Bob simply by making many connections to him.
  1063. \textbf{Robust:} Bob should be able to maintain a long-term pseudonymous
  1064. identity even in the presence of router failure. Bob's service must
  1065. not be tied to a single OR, and Bob must be able to tie his service
  1066. to new ORs. \textbf{Smear-resistant:}
  1067. A social attacker who offers an illegal or disreputable location-hidden
  1068. service should not be able to ``frame'' a rendezvous router---that is,
  1069. make observers believe that the router created that service.
  1070. %slander-resistant? defamation-resistant?
  1071. \textbf{Application-transparent:} Although we require users
  1072. to run special software to access location-hidden servers, we must not
  1073. require them to modify their applications.
  1074. We provide location-hiding for Bob by allowing him to advertise
  1075. several onion routers (his \emph{introduction points}) as contact
  1076. points. He may do this on any robust efficient
  1077. key-value lookup system with authenticated updates, such as a
  1078. distributed hash table (DHT) like CFS \cite{cfs:sosp01}\footnote{
  1079. Rather than rely on an external infrastructure, the Onion Routing network
  1080. can run the DHT; to begin, we can run a simple lookup system on the
  1081. directory servers.} Alice, the client, chooses an OR as her
  1082. \emph{rendezvous point}. She connects to one of Bob's introduction
  1083. points, informs him about her rendezvous point, and then waits for him
  1084. to connect to the rendezvous point. This extra level of indirection
  1085. helps Bob's introduction points avoid problems associated with serving
  1086. unpopular files directly (for example, if Bob chooses
  1087. an introduction point in Texas to serve anti-ranching propaganda,
  1088. or if Bob's service tends to get attacked by network vandals).
  1089. The extra level of indirection also allows Bob to respond to some requests
  1090. and ignore others.
  1091. We give an overview of the steps of a rendezvous. These steps are
  1092. performed on behalf of Alice and Bob by their local onion proxies;
  1093. application integration is described more fully below.
  1094. \begin{tightlist}
  1095. \item Bob chooses some introduction points, and advertises them on
  1096. the DHT. He can add more later.
  1097. \item Bob establishes a Tor circuit to each of his introduction points,
  1098. and waits. No data is transmitted until a request is received.
  1099. \item Alice learns about Bob's service out of band (perhaps Bob told her,
  1100. or she found it on a website). She retrieves the details of Bob's
  1101. service from the DHT.
  1102. \item Alice chooses an OR to serve as the rendezvous point (RP) for this
  1103. transaction. She establishes a circuit to RP, and gives it a
  1104. rendezvous cookie, which it will use to recognize Bob.
  1105. \item Alice opens an anonymous stream to one of Bob's introduction
  1106. points, and gives it a message (encrypted to Bob's public key) which tells him
  1107. about herself, her chosen RP and the rendezvous cookie, and the
  1108. first half of an ephemeral
  1109. key handshake. The introduction point sends the message to Bob.
  1110. \item If Bob wants to talk to Alice, he builds a new circuit to Alice's
  1111. RP and provides the rendezvous cookie and the second half of the DH
  1112. handshake (along with a hash of the session
  1113. key they now share---by the same argument as in
  1114. Section~\ref{subsubsec:constructing-a-circuit}, Alice knows she
  1115. shares the key only with the intended Bob).
  1116. \item The RP connects Alice's circuit to Bob's. Note that RP can't
  1117. recognize Alice, Bob, or the data they transmit.
  1118. \item Alice now sends a \emph{relay begin} cell along the circuit. It
  1119. arrives at Bob's onion proxy. Bob's onion proxy connects to Bob's
  1120. webserver.
  1121. \item An anonymous stream has been established, and Alice and Bob
  1122. communicate as normal.
  1123. \end{tightlist}
  1124. When establishing an introduction point, Bob provides the onion router
  1125. with a public ``introduction'' key. The hash of this public key
  1126. identifies a unique service, and (since Bob is required to sign his
  1127. messages) prevents anybody else from usurping Bob's introduction point
  1128. in the future. Bob uses the same public key when establishing the other
  1129. introduction points for that service. Bob periodically refreshes his
  1130. entry in the DHT.
  1131. The message that Alice gives
  1132. the introduction point includes a hash of Bob's public key to identify
  1133. the service, along with an optional initial authentication token (the
  1134. introduction point can do prescreening, for example to block replays). Her
  1135. message to Bob may include an end-to-end authentication token so Bob
  1136. can choose whether to respond.
  1137. The authentication tokens can be used to provide selective access:
  1138. important users get tokens to ensure uninterrupted access to the
  1139. service. During normal situations, Bob's service might simply be offered
  1140. directly from mirrors, and Bob gives out tokens to high-priority users. If
  1141. the mirrors are knocked down by distributed DoS attacks or even
  1142. physical attack, those users can switch to accessing Bob's service via
  1143. the Tor rendezvous system.
  1144. Since Bob's introduction points might themselves be subject to DoS he
  1145. could be faced with a choice between keeping many
  1146. introduction connections open or risking such an attack. In this case,
  1147. similar to the authentication tokens, he can provide selected users
  1148. with a current list and/or future schedule of introduction points that
  1149. are not advertised in the DHT\@. This is most likely to be practical
  1150. if there is a relatively stable and large group of introduction points
  1151. generally available. Alternatively, Bob could give secret public keys
  1152. to selected users for consulting the DHT\@. All of these approaches
  1153. have the advantage of limiting the damage that can be done even if
  1154. some of the selected high-priority users collude in the DoS\@.
  1155. \SubSection{Integration with user applications}
  1156. Bob configures his onion proxy to know the local IP address and port of his
  1157. service, a strategy for authorizing clients, and a public key. Bob
  1158. publishes the public key, an expiration time (``not valid after''), and
  1159. the current introduction points for his service into the DHT, all indexed
  1160. by the hash of the public key. Note that Bob's webserver is unmodified,
  1161. and doesn't even know that it's hidden behind the Tor network.
  1162. Alice's applications also work unchanged---her client interface
  1163. remains a SOCKS proxy. We encode all of the necessary information
  1164. into the fully qualified domain name Alice uses when establishing her
  1165. connection. Location-hidden services use a virtual top level domain
  1166. called `.onion': thus hostnames take the form x.y.onion where x is the
  1167. authentication cookie, and y encodes the hash of PK. Alice's onion proxy
  1168. examines addresses; if they're destined for a hidden server, it decodes
  1169. the PK and starts the rendezvous as described in the table above.
  1170. \subsection{Previous rendezvous work}
  1171. Rendezvous points in low-latency anonymity systems were first
  1172. described for use in ISDN telephony \cite{isdn-mixes,jerichow-jsac98}.
  1173. Later low-latency designs used rendezvous points for hiding location
  1174. of mobile phones and low-power location trackers
  1175. \cite{federrath-ih96,reed-protocols97}. Rendezvous for low-latency
  1176. Internet connections was suggested in early Onion Routing work
  1177. \cite{or-ih96}; however, the first published design of rendezvous
  1178. points for low-latency Internet connections was by Ian Goldberg
  1179. \cite{ian-thesis}. His design differs from
  1180. ours in three ways. First, Goldberg suggests that Alice should manually
  1181. hunt down a current location of the service via Gnutella; our approach
  1182. makes lookup transparent to the user, as well as faster and more robust.
  1183. Second, in Tor the client and server negotiate ephemeral keys
  1184. via Diffie-Hellman, so plaintext is not exposed at any point. Third,
  1185. our design tries to minimize the exposure associated with running the
  1186. service, to encourage volunteers to offer introduction and rendezvous
  1187. point services. Tor's introduction points do not output any bytes to the
  1188. clients, and the rendezvous points don't know the client or the server,
  1189. and can't read the data being transmitted. The indirection scheme is
  1190. also designed to include authentication/authorization---if Alice doesn't
  1191. include the right cookie with her request for service, Bob need not even
  1192. acknowledge his existence.
  1193. \Section{Attacks and Defenses}
  1194. \label{sec:attacks}
  1195. Below we summarize a variety of attacks, and discuss how well our
  1196. design withstands them.
  1197. \subsubsection*{Passive attacks}
  1198. \emph{Observing user traffic patterns.} Observing the connection
  1199. from the user will not reveal her destination or data, but it will
  1200. reveal traffic patterns (both sent and received). Profiling via user
  1201. connection patterns is hampered because multiple application streams may
  1202. be operating simultaneously or in series over a single circuit. Thus,
  1203. further processing is necessary to discern even these usage patterns.
  1204. \emph{Observing user content.} While content at the user end is encrypted,
  1205. connections to responders may not be (further, the responding website
  1206. itself may be hostile). Filtering content is not a primary goal of Onion
  1207. Routing; nonetheless, Tor can directly use Privoxy and related
  1208. filtering services to anonymize application data streams.
  1209. \emph{Option distinguishability.} Configuration options can be a
  1210. source of distinguishable patterns. In general there is economic
  1211. incentive to allow preferential services \cite{econymics}, and some
  1212. degree of configuration choice can attract users, which
  1213. provide anonymity. So far, however, we have
  1214. not found a compelling use case in Tor for any client-configurable
  1215. options. Thus, clients are currently distinguishable only by their
  1216. behavior.
  1217. %XXX Actually, circuitrebuildperiod is such an option. -RD
  1218. \emph{End-to-end Timing correlation.} Tor only minimally hides
  1219. end-to-end timing correlations. An attacker watching patterns of
  1220. traffic at the initiator and the responder will be
  1221. able to confirm the correspondence with high probability. The
  1222. greatest protection currently available against such confirmation is to hide
  1223. the connection between the onion proxy and the first Tor node,
  1224. by running the onion proxy locally or
  1225. behind a firewall. This approach
  1226. requires an observer to separate traffic originating at the onion
  1227. router from traffic passing through it; but because we do not mix
  1228. or pad, this does not provide much defense.
  1229. \emph{End-to-end Size correlation.} Simple packet counting
  1230. without timing correlation will also be effective in confirming
  1231. endpoints of a stream. However, even without padding, we have some
  1232. limited protection: the leaky pipe topology means different numbers
  1233. of packets may enter one end of a circuit than exit at the other.
  1234. \emph{Website fingerprinting.} All the above passive
  1235. attacks that are at all effective are traffic confirmation attacks.
  1236. This puts them outside our general design goals. There is also
  1237. a passive traffic analysis attack that is potentially effective.
  1238. Rather than searching exit connections for timing and volume
  1239. correlations, the adversary may build up a database of
  1240. ``fingerprints'' containing file sizes and access patterns for many
  1241. interesting websites. He can confirm a user's connection to a given
  1242. site simply by consulting the database. This attack has
  1243. been shown to be effective against SafeWeb \cite{hintz-pet02}. But
  1244. Tor is not as vulnerable as SafeWeb to this attack: there is the
  1245. possibility that multiple streams are exiting the circuit at
  1246. different places concurrently. Also, fingerprinting will be limited to
  1247. the granularity of cells, currently 256 bytes. Other defenses include
  1248. larger cell sizes and/or minimal padding schemes that group websites
  1249. into large sets. But this remains an open problem. Link
  1250. padding or long-range dummies may also make fingerprints harder to
  1251. detect.\footnote{Note that
  1252. such fingerprinting should not be confused with the latency attacks
  1253. of \cite{back01}. Those require a fingerprint of the latencies of
  1254. all circuits through the network, combined with those from the
  1255. network edges to the targeted user and the responder website. While
  1256. these are in principal feasible and surprises are always possible,
  1257. these constitute a much more complicated attack, and there is no
  1258. current evidence of their practicality.}
  1259. \subsubsection*{Active attacks}
  1260. \emph{Compromise keys.} An attacker who learns the TLS session key can
  1261. see control cells and encrypted relay cells on every circuit on that
  1262. connection; learning a circuit
  1263. session key lets him unwrap one layer of the encryption. An attacker
  1264. who learns an OR's TLS private key can impersonate that OR for the TLS
  1265. key's lifetime, but he must
  1266. also learn the onion key to decrypt \emph{create} cells (and because of
  1267. perfect forward secrecy, he cannot hijack already established circuits
  1268. without also compromising their session keys). Periodic key rotation
  1269. limits the window of opportunity for these attacks. On the other hand,
  1270. an attacker who learns a node's identity key can replace that node
  1271. indefinitely by sending new forged descriptors to the directory servers.
  1272. \emph{Iterated compromise.} A roving adversary who can
  1273. compromise ORs (by system intrusion, legal coersion, or extralegal
  1274. coersion) could march down the circuit compromising the
  1275. nodes until he reaches the end. Unless the adversary can complete
  1276. this attack within the lifetime of the circuit, however, the ORs
  1277. will have discarded the necessary information before the attack can
  1278. be completed. (Thanks to the perfect forward secrecy of session
  1279. keys, the attacker cannot force nodes to decrypt recorded
  1280. traffic once the circuits have been closed.) Additionally, building
  1281. circuits that cross jurisdictions can make legal coercion
  1282. harder---this phenomenon is commonly called ``jurisdictional
  1283. arbitrage.'' The Java Anon Proxy project recently experienced the
  1284. need for this approach, when
  1285. the German government successfully ordered them to add a backdoor to
  1286. all of their nodes \cite{jap-backdoor}.
  1287. \emph{Run a recipient.} By running a Web server, an adversary
  1288. trivially learns the timing patterns of users connecting to it, and
  1289. can introduce arbitrary patterns in its responses. This can greatly
  1290. facilitate end-to-end attacks: If the adversary can induce certain
  1291. users to connect to his webserver (perhaps by advertising
  1292. content targeted at those users), she now holds one end of their
  1293. connection. Additionally, there is a danger that the application
  1294. protocols and associated programs can be induced to reveal
  1295. information about the initiator. Tor does not aim to solve this problem;
  1296. we depend on Privoxy and similar protocol cleaners.
  1297. \emph{Run an onion proxy.} It is expected that end users will
  1298. nearly always run their own local onion proxy. However, in some
  1299. settings, it may be necessary for the proxy to run
  1300. remotely---typically, in an institutional setting which wants
  1301. to monitor the activity of those connecting to the proxy.
  1302. Compromising an onion proxy means compromising all future connections
  1303. through it.
  1304. \emph{DoS non-observed nodes.} An observer who can observe some
  1305. of the Tor network can increase the value of this traffic analysis
  1306. by attacking non-observed nodes to shut them down, reduce
  1307. their reliability, or persuade users that they are not trustworthy.
  1308. The best defense here is robustness.
  1309. \emph{Run a hostile node.} In addition to the abilities of a
  1310. local observer, an isolated hostile node can create circuits through
  1311. itself, or alter traffic patterns, to affect traffic at
  1312. other nodes. Its ability to directly DoS a neighbor is now limited
  1313. by bandwidth throttling. Nonetheless, in order to compromise the
  1314. anonymity of the endpoints of a circuit by its observations, a
  1315. hostile node must be immediately adjacent to that endpoint.
  1316. \emph{Run multiple hostile nodes.} If an adversary is able to
  1317. run multiple ORs, and is able to persuade the directory servers
  1318. that those ORs are trustworthy and independant, then occasionally
  1319. some user will choose one of those ORs for the start and another
  1320. as the end of a circuit. When this happens, the user's
  1321. anonymity is compromised for those streams. If an adversary can
  1322. control $m$ out of $N$ nodes, he should be able to correlate at most
  1323. $\left(\frac{m}{N}\right)^2$ of the traffic in this way---although an
  1324. adversary
  1325. could possibly attract a disproportionately large amount of traffic
  1326. by running an exit node with an unusually permissive exit policy.
  1327. \emph{Run a hostile directory server.} Directory servers control
  1328. admission to the network. However, because the network directory
  1329. must be signed by a majority of servers, the threat of a single
  1330. hostile server is minimized.
  1331. \emph{Selectively DoS a Tor node.} As noted, neighbors are
  1332. bandwidth limited; however, it is possible to open up sufficient
  1333. circuits that converge at a single onion router to
  1334. overwhelm its network connection, its ability to process new
  1335. circuits, or both.
  1336. % We aim to address something like this attack with our congestion
  1337. % control algorithm.
  1338. \emph{Introduce timing into messages.} This is simply a stronger
  1339. version of passive timing attacks already discussed earlier.
  1340. \emph{Tagging attacks.} A hostile node could ``tag'' a
  1341. cell by altering it. This would render it unreadable, but if the
  1342. stream is, for example, an unencrypted request to a Web site,
  1343. the garbled content coming out at the appropriate time could confirm
  1344. the association. However, integrity checks on cells prevent
  1345. this attack.
  1346. \emph{Replace contents of unauthenticated protocols.} When
  1347. relaying an unauthenticated protocol like HTTP, a hostile exit node
  1348. can impersonate the target server. Thus, whenever possible, clients
  1349. should prefer protocols with end-to-end authentication.
  1350. \emph{Replay attacks.} Some anonymity protocols are vulnerable
  1351. to replay attacks. Tor is not; replaying one side of a handshake
  1352. will result in a different negotiated session key, and so the rest
  1353. of the recorded session can't be used.
  1354. \emph{Smear attacks.} An attacker could use the Tor network to
  1355. engage in socially dissapproved acts, so as to try to bring the
  1356. entire network into disrepute and get its operators to shut it down.
  1357. Exit policies can help reduce the possibilities for abuse, but
  1358. ultimately, the network will require volunteers who can tolerate
  1359. some political heat.
  1360. \emph{Distribute hostile code.} An attacker could trick users
  1361. into running subverted Tor software that did not, in fact, anonymize
  1362. their connections---or worse, trick ORs into running weakened
  1363. software that provided users with less anonymity. We address this
  1364. problem (but do not solve it completely) by signing all Tor releases
  1365. with an official public key, and including an entry in the directory
  1366. describing which versions are currently believed to be secure. To
  1367. prevent an attacker from subverting the official release itself
  1368. (through threats, bribery, or insider attacks), we provide all
  1369. releases in source code form, encourage source audits, and
  1370. frequently warn our users never to trust any software (even from
  1371. us!) that comes without source.
  1372. \subsubsection*{Directory attacks}
  1373. \emph{Destroy directory servers.} If a few directory
  1374. servers drop out of operation, the others still arrive at a final
  1375. directory. So long as any directory servers remain in operation,
  1376. they will still broadcast their views of the network and generate a
  1377. consensus directory. (If more than half are destroyed, this
  1378. directory will not, however, have enough signatures for clients to
  1379. use it automatically; human intervention will be necessary for
  1380. clients to decide whether to trust the resulting directory, or continue
  1381. to use the old valid one.)
  1382. \emph{Subvert a directory server.} By taking over a directory
  1383. server, an attacker can influence (but not control) the final
  1384. directory. Since ORs are included or excluded by majority vote,
  1385. the corrupt directory can at worst cast a tie-breaking vote to
  1386. decide whether to include marginal ORs. How often such marginal
  1387. cases will occur in practice, however, remains to be seen.
  1388. \emph{Subvert a majority of directory servers.} If the
  1389. adversary controls more than half of the directory servers, he can
  1390. decide on a final directory, and thus can include as many
  1391. compromised ORs in the final directory as he wishes. Other than
  1392. trying to ensure that directory server operators are truly
  1393. independent and resistant to attack, Tor does not address this
  1394. possibility.
  1395. \emph{Encourage directory server dissent.} The directory
  1396. agreement protocol requires that directory server operators agree on
  1397. the list of directory servers. An adversary who can persuade some
  1398. of the directory server operators to distrust one another could
  1399. split the quorum into mutually hostile camps, thus partitioning
  1400. users based on which directory they used. Tor does not address
  1401. this attack.
  1402. \emph{Trick the directory servers into listing a hostile OR.}
  1403. Our threat model explicitly assumes directory server operators will
  1404. be able to filter out most hostile ORs. If this is not true, an
  1405. attacker can flood the directory with compromised servers.
  1406. \emph{Convince the directories that a malfunctioning OR is
  1407. working.} In the current Tor implementation, directory servers
  1408. assume that if they can start a TLS connection to an an OR, that OR
  1409. must be running correctly. It would be easy for a hostile OR to
  1410. subvert this test by only accepting TLS connections from ORs, and
  1411. ignoring all cells. Thus, directory servers must actively test ORs
  1412. by building circuits and streams as appropriate. The benefits and
  1413. hazards of a similar approach are discussed in \cite{mix-acc}.
  1414. \subsubsection*{Attacks against rendezvous points}
  1415. \emph{Make many introduction requests.} An attacker could
  1416. attempt to deny Bob service by flooding his Introduction Point with
  1417. requests. Because the introduction point can block requests that
  1418. lack authentication tokens, however, Bob can restrict the volume of
  1419. requests he receives, or require a certain amount of computation for
  1420. every request he receives.
  1421. \emph{Attack an introduction point.} An attacker could try to
  1422. disrupt a location-hidden service by disabling its introduction
  1423. point. But because a service's identity is attached to its public
  1424. key, not its introduction point, the service can simply re-advertise
  1425. itself at a different introduction point.
  1426. \emph{Attack multiple introduction points.} If an attacker is
  1427. able to disable all of the introduction points for a given service,
  1428. he can block access to the service. However, re-advertisement of
  1429. introduction points can still be done secretly so that only
  1430. high-priority clients know the address of the service's introduction
  1431. points. These selective secret authorizations can also be issued
  1432. during normal operation. Thus an attacker must disable
  1433. all possible introduction points.
  1434. \emph{Compromise an introduction point.} If an attacker controls
  1435. an introduction point for a service, it can flood the service with
  1436. introduction requests, or prevent valid introduction requests from
  1437. reaching the hidden server. The server will notice a flooding
  1438. attempt if it receives many introduction requests. To notice
  1439. blocking of valid requests, however, the hidden server should
  1440. periodically test the introduction point by sending its introduction
  1441. requests, and making sure it receives them.
  1442. \emph{Compromise a rendezvous point.} Controlling a rendezvous
  1443. point gains an attacker no more than controlling any other OR along
  1444. a circuit, since all data passing along the rendezvous is protected
  1445. by the session key shared by the client and server.
  1446. \Section{Open Questions in Low-latency Anonymity}
  1447. \label{sec:maintaining-anonymity}
  1448. In addition to the open problems discussed in
  1449. Section~\ref{subsec:non-goals}, many other questions must be solved
  1450. before we can be confident of Tor's security.
  1451. Many of these open issues are questions of balance. For example,
  1452. how often should users rotate to fresh circuits? Frequent rotation
  1453. is inefficient, expensive, and may lead to intersection attacks and
  1454. predecessor attacks \cite{wright03}, but infrequent rotation makes the
  1455. user's traffic linkable. Along with opening a fresh circuit, clients can
  1456. also limit linkability by exiting from a middle point of the circuit,
  1457. or by truncating and re-extending the circuit; but more analysis is
  1458. needed to determine the proper trade-off.
  1459. A similar question surrounds timing of directory operations: how often
  1460. should directories be updated? Clients that update infrequently receive
  1461. an inaccurate picture of the network, but frequent updates can overload
  1462. the directory servers. More generally, we must find more
  1463. decentralized yet practical ways to distribute up-to-date snapshots of
  1464. network status without introducing new attacks.
  1465. How should we choose path lengths? If she uses only two hops, then both
  1466. these nodes are certain that by colluding they will learn about Alice
  1467. and Bob. Our current approach is that Alice always chooses at least three
  1468. nodes unrelated to herself and her destination. Thus normally she chooses
  1469. three nodes, but if she is running an OR and her destination is on an OR,
  1470. she uses five. Should Alice choose a nondeterministic path length (say,
  1471. increasing it from a geometric distribution), to foil an attacker who
  1472. uses timing to learn that he is the fifth hop and thus concludes that
  1473. both Alice and the responder are on ORs?
  1474. Throughout this paper, we have assumed that end-to-end traffic
  1475. confirmation will immediately and automatically defeat a low-latency
  1476. anonymity system. Even high-latency anonymity systems can be
  1477. vulnerable to end-to-end traffic confirmation, if the traffic volumes
  1478. are high enough, and if users' habits are sufficiently distinct
  1479. \cite{limits-open,statistical-disclosure}. Can anything be done to
  1480. make low-latency systems resist these attacks as well as high-latency
  1481. systems? Tor already makes some effort to conceal the starts and ends of
  1482. streams by wrapping all long-range control commands in identical-looking
  1483. relay cells. Link padding could frustrate passive observers who count
  1484. packets; long-range padding could work against observers who own the
  1485. first hop in a circuit. But more research remains to find an efficient
  1486. and practical approach. Volunteers prefer not to run constant-bandwidth
  1487. padding; but no convincing traffic shaping approach has ever been
  1488. specified. Recent work on long-range padding \cite{defensive-dropping}
  1489. shows promise. One could also try to reduce correlation in packet timing
  1490. by batching and re-ordering packets, but it is unclear whether this could
  1491. improve anonymity without introducing so much latency as to render the
  1492. network unusable.
  1493. Common wisdom suggests that Alice should run her own onion router for best
  1494. anonymity, because traffic coming through her node could plausibly have
  1495. come from elsewhere. How much mixing do we need before this is actually
  1496. effective, or is it immediately beneficial because many real-world
  1497. adversaries won't be able to observe Alice's router?
  1498. To scale to many users, and to prevent an attacker from observing the
  1499. whole network at once, it may be necessary for low-latency anonymity
  1500. systems to support far more servers than Tor currently anticipates.
  1501. This introduces several issues. First, if approval by a centralized set
  1502. of directory servers is no longer feasible, what mechanism should be used
  1503. to prevent adversaries from signing up many colluding servers? Second,
  1504. if clients can no longer have a complete picture of the network at all
  1505. times, how can they perform discovery while preventing attackers from
  1506. manipulating or exploiting gaps in client knowledge? Third, if there
  1507. are too many servers for every server to constantly communicate with
  1508. every other, what kind of non-clique topology should the network use?
  1509. Restricted-route topologies promise comparable anonymity with better
  1510. scalability \cite{danezis-pets03}, but whatever topology we choose, we
  1511. need some way to keep attackers from manipulating their position within
  1512. it \cite{casc-rep}. Fourth, since no centralized authority is tracking
  1513. server reliability, How do we prevent unreliable servers from rendering
  1514. the network unusable? Fifth, do clients receive so much anonymity benefit
  1515. from running their own servers that we should expect them all to do so
  1516. \cite{econymics}, or do we need to find another incentive structure to
  1517. motivate them? Tarzan and MorphMix present possible solutions.
  1518. % advogato, captcha
  1519. A cascade topology with long-range padding and mixing may provide more
  1520. defense against traffic confirmation against a large adversary, because
  1521. it aggregates many users. Does the hydra topology (many input nodes,
  1522. few output nodes) work better against some adversaries? Are we going to
  1523. get a hydra anyway because most nodes will be middleman nodes?
  1524. When a Tor node goes down, all its circuits (and thus streams) must break.
  1525. Do users abandon the system because of this brittleness? How well
  1526. does the method in Section~\ref{subsec:dos} allow streams to survive
  1527. node failure? If affected users rebuild circuits immediately, how much
  1528. anonymity is lost? It seems the problem is even worse in a peer-to-peer
  1529. environment---so far such systems don't provide an incentive for peers to
  1530. stay connected when they're done retrieving content, so we would expect
  1531. a higher churn rate.
  1532. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1533. \Section{Future Directions}
  1534. \label{sec:conclusion}
  1535. Tor brings together many innovations into a unified deployable system. The
  1536. immediate next steps include:
  1537. \emph{Scalability:} Tor's emphasis on design simplicity and deployability
  1538. has led us to adopt a clique topology, a semi-centralized model for
  1539. directories and trusts, and a full-network-visibility model for client
  1540. knowledge. These properties will not scale past a few hundred servers.
  1541. Section~\ref{sec:maintaining-anonymity} describes some promising
  1542. approaches, but more deployment experience will be helpful in learning
  1543. the relative importance of these bottlenecks.
  1544. \emph{Bandwidth classes:} In this paper we assume all onion routers have
  1545. good bandwidth and latency. We should adapt the Morphmix model,
  1546. where nodes advertise their bandwidth level (DSL, T1, T3), and
  1547. Alice avoids bottlenecks in her path by choosing nodes that match or
  1548. exceed her bandwidth. In this way DSL users can join the Tor network.
  1549. \emph{Incentives:} Volunteers who run nodes are rewarded with publicity
  1550. and possibly better anonymity \cite{econymics}. More nodes means increased
  1551. scalability, and more users can mean more anonymity. We need to continue
  1552. examining the incentive structures for participating in Tor.
  1553. \emph{Cover traffic:} Currently Tor avoids cover traffic because its costs
  1554. in performance and bandwidth are clear, whereas its security benefits are
  1555. not well-understood. We must pursue more research on both link-level cover
  1556. traffic and long-range cover traffic to determine some simple padding
  1557. schemes that offer provable protection against our chosen adversary.
  1558. %%\emph{Offer two relay cell sizes:} Traffic on the Internet tends to be
  1559. %%large for bulk transfers and small for interactive traffic. One cell
  1560. %%size cannot be optimal for both types of traffic.
  1561. % This should go in the spec and todo, but not the paper yet. -RD
  1562. \emph{Caching at exit nodes:} We should run a caching web proxy at each
  1563. exit node, to provide anonymity for cached pages (Alice's request never
  1564. leaves the Tor network), to improve speed, and to reduce bandwidth cost.
  1565. %XXX and to have a layer to block to block funny stuff out of port 80.
  1566. % is that a useful thing to say?
  1567. On the other hand, forward security is weakened because routers have the
  1568. pages in their cache. We must find the right balance between usability
  1569. and security.
  1570. \emph{Better directory distribution:} Directory retrieval presents
  1571. a scaling problem, since clients currently download a description of
  1572. the entire network state every 15 minutes. As the state grows larger
  1573. and clients more numerous, we may need to move to a solution in which
  1574. clients only receive incremental updates to directory state.
  1575. \emph{Implement location-hidden services:} The design in
  1576. Section~\ref{sec:rendezvous} has not yet been implemented. While doing
  1577. so we are likely to encounter additional issues that must be resolved,
  1578. both in terms of usability and anonymity.
  1579. \emph{Further specification review:} Although we have a public,
  1580. byte-level specification for the Tor protocols, this document has
  1581. not received extensive external review. We hope that as Tor
  1582. becomes more widely deployed, more people will examine its
  1583. specification.
  1584. \emph{Multisystem interoperability:} We are currently working with the
  1585. designer of MorphMix to make the common elements of our two systems
  1586. share a common specification and implementation. So far, this seems
  1587. to be relatively straightforward. Interoperability will allow testing
  1588. and direct comparison of the two designs for trust and scalability.
  1589. \emph{Wider-scale deployment:} The original goal of Tor was to
  1590. gain experience in deploying an anonymizing overlay network, and
  1591. learn from having actual users. We are now at a point in design
  1592. and development where we can start deploying a wider network. Once
  1593. we have many actual users, we will doubtlessly be better
  1594. able to evaluate some of our design decisions, including our
  1595. robustness/latency trade-offs, our performance trade-offs (including
  1596. cell size), our abuse-prevention mechanisms, and
  1597. our overall usability.
  1598. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1599. %% commented out for anonymous submission
  1600. %\Section{Acknowledgments}
  1601. % Peter Palfrader, Geoff Goodell, Adam Shostack, Joseph Sokol-Margolis,
  1602. % John Bashinski
  1603. % for editing and comments
  1604. % Matej Pfajfar, Andrei Serjantov, Marc Rennhard for design discussions
  1605. % Bram Cohen for congestion control discussions
  1606. % Adam Back for suggesting telescoping circuits
  1607. % Cathy Meadows for formal analysis of candidate extend DH protocols
  1608. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1609. \bibliographystyle{latex8}
  1610. \bibliography{tor-design}
  1611. \end{document}
  1612. % Style guide:
  1613. % U.S. spelling
  1614. % avoid contractions (it's, can't, etc.)
  1615. % prefer ``for example'' or ``such as'' to e.g.
  1616. % prefer ``that is'' to i.e.
  1617. % 'mix', 'mixes' (as noun)
  1618. % 'mix-net'
  1619. % 'mix', 'mixing' (as verb)
  1620. % 'middleman' [Not with a hyphen; the hyphen has been optional
  1621. % since Middle English.]
  1622. % 'nymserver'
  1623. % 'Cypherpunk', 'Cypherpunks', 'Cypherpunk remailer'
  1624. % 'Onion Routing design', 'onion router' [note capitalization]
  1625. % 'SOCKS'
  1626. % Try not to use \cite as a noun.
  1627. % 'Authorizating' sounds great, but it isn't a word.
  1628. % 'First, second, third', not 'Firstly, secondly, thirdly'.
  1629. % 'circuit', not 'channel'
  1630. % Typography: no space on either side of an em dash---ever.
  1631. % Hyphens are for multi-part words; en dashs imply movement or
  1632. % opposition (The Alice--Bob connection); and em dashes are
  1633. % for punctuation---like that.
  1634. % A relay cell; a control cell; a \emph{create} cell; a
  1635. % \emph{relay truncated} cell. Never ``a \emph{relay truncated}.''
  1636. %
  1637. % 'Substitute ``Damn'' every time you're inclined to write ``very;'' your
  1638. % editor will delete it and the writing will be just as it should be.'
  1639. % -- Mark Twain