tor-design.tex 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440
  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: Design of a Second-Generation Onion Router}
  35. %\author{Roger Dingledine \\ The Free Haven Project \\ arma@freehaven.net \and
  36. %Nick Mathewson \\ The Free Haven Project \\ nickm@freehaven.net \and
  37. %Paul Syverson \\ Naval Research Lab \\ syverson@itd.nrl.navy.mil}
  38. \maketitle
  39. \thispagestyle{empty}
  40. \begin{abstract}
  41. We present Tor, a connection-based low-latency anonymous communication
  42. system. Tor is the successor to Onion Routing
  43. and addresses many limitations in the original Onion Routing design.
  44. Tor works in a real-world Internet environment,
  45. % it's user-space too
  46. requires little synchronization or coordination between nodes, and
  47. protects against known anonymity-breaking attacks as well
  48. as or better than other systems with similar design parameters.
  49. % and we present a big list of open problems at the end
  50. \end{abstract}
  51. %\begin{center}
  52. %\textbf{Keywords:} anonymity, peer-to-peer, remailer, nymserver, reply block
  53. %\end{center}
  54. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  55. \Section{Overview}
  56. \label{sec:intro}
  57. Onion Routing is a distributed overlay network designed to anonymize
  58. low-latency TCP-based applications such as web browsing, secure shell,
  59. and instant messaging. Clients choose a path through the network and
  60. build a \emph{virtual circuit}, in which each node (or ``onion router'')
  61. in the path knows its
  62. predecessor and successor, but no others. Traffic flowing down the circuit
  63. is sent in fixed-size \emph{cells}, which are unwrapped by a symmetric key
  64. at each node (like the layers of an onion) and relayed downstream. The
  65. original Onion Routing project published several design and analysis
  66. papers
  67. \cite{or-jsac98,or-discex00,or-ih96,or-pet00}. While there was briefly
  68. a wide area Onion Routing network,
  69. % how long is briefly? a day, a month? -RD
  70. the only long-running and publicly accessible
  71. implementation was a fragile proof-of-concept that ran on a single
  72. machine. Many critical design and deployment issues were never resolved,
  73. and the design has not been updated in several years.
  74. Here we describe Tor, a protocol for asynchronous, loosely
  75. federated onion routers that provides the following improvements over
  76. the old Onion Routing design, and over other low-latency anonymity systems:
  77. \begin{tightlist}
  78. \item \textbf{Perfect forward secrecy:} The original Onion Routing
  79. design was vulnerable to a single hostile node recording traffic and later
  80. compromising successive nodes in the circuit and forcing them to
  81. decrypt it.
  82. Rather than using a single onion to lay each circuit,
  83. Tor now uses an incremental or \emph{telescoping}
  84. path-building design, where the initiator negotiates session keys with
  85. each successive hop in the circuit. Once these keys are deleted,
  86. subsequently compromised nodes cannot decrypt old traffic.
  87. As a side benefit, onion replay detection is no longer
  88. necessary, and the process of building circuits is more reliable, since
  89. the initiator knows when a hop fails and can then try extending to a new node.
  90. % Perhaps mention that not all of these are things that we invented. -NM
  91. \item \textbf{Separation of protocol cleaning from anonymity:}
  92. The original Onion Routing design required a separate ``application
  93. proxy'' for each
  94. supported application protocol --- most
  95. of which were never written, so many applications were never supported.
  96. Tor uses the standard and near-ubiquitous SOCKS
  97. \cite{socks4,socks5} proxy interface, allowing us to support most TCP-based
  98. programs without modification. This design change allows Tor to
  99. use the filtering features of privacy-enhancing
  100. application-level proxies such as Privoxy without having to
  101. incorporate those features itself.
  102. \item \textbf{Many TCP streams can share one circuit:} The original
  103. Onion Routing design built a separate circuit for each application-level
  104. request.
  105. This hurt performance by requiring multiple public key operations for
  106. every request, and also presented
  107. a threat to anonymity (see Section~\ref{maintaining-anonymity}).
  108. \footnote{The first Onion Routing design \cite{or-ih96} protected against
  109. this threat to some
  110. extent by encouraging users to hide network access behind an onion
  111. router/firewall that was also forwarding traffic from other nodes.
  112. However, it is desirable for users to
  113. benefit from Onion Routing even when they can't run their own
  114. onion routers.
  115. %Such users, especially if they engage in certain unusual
  116. %communication behaviors, may be identifiable \cite{wright03}.
  117. %To
  118. %complicate the possibility of such attacks Tor multiplexes many
  119. %stream down each circuit, but still rotates the circuit
  120. %periodically to avoid too much linkability from requests on a single
  121. %circuit.
  122. %
  123. % [This digression probably belongs in maintaining-anonymity. -NM
  124. }
  125. The current Tor design multiplexes multiple TCP streams along each virtual
  126. circuit, in order to improve efficiency and anonymity.
  127. \item \textbf{No mixing, padding, or traffic shaping:} The original
  128. Onion Routing design called for mixing of data from each circuit,
  129. plus full link padding both between onion routers and between onion
  130. proxies (that is, users) and onion routers \cite{or-jsac98}. The
  131. later analysis paper \cite{or-pet00} suggested \emph{traffic shaping}
  132. to provide similar protection but use less bandwidth, but did not go
  133. into detail. However, recent research \cite{econymics} and deployment
  134. experience \cite{freedom21-security} suggest that this level of resource
  135. use is not practical or economical; and even full link padding is still
  136. vulnerable \cite{defensive-dropping}. Thus, until we have a proven and
  137. convenient design for traffic shaping or low-latency mixing that will help
  138. anonymity against a realistic adversary, we leave these strategies out.
  139. \item \textbf{Leaky-pipe circuit topology:} Through in-band
  140. signalling within the
  141. circuit, Tor initiators can direct traffic to nodes partway down the
  142. circuit. This not only allows for long-range padding to frustrate traffic
  143. shape and volume attacks at the initiator \cite{defensive-dropping},
  144. but because circuits are used by more than one application, it also
  145. allows traffic to exit the circuit from the middle -- thus
  146. frustrating traffic shape and volume attacks based on observing exit
  147. points.
  148. %Or something like that. hm. Tone this down maybe? Or support it. -RD
  149. %How's that? -PS
  150. \item \textbf{Congestion control:} Earlier anonymity designs do not
  151. address traffic bottlenecks. Unfortunately, typical approaches to load
  152. balancing and flow control in overlay networks involve inter-node control
  153. communication and global views of traffic. Tor's decentralized ack-based
  154. congestion control maintains reasonable anonymity while allowing nodes
  155. at the edges of the network to detect congestion or flooding attacks
  156. and send less data until the congestion subsides.
  157. \item \textbf{Directory servers:} The original Onion Routing design
  158. planned to flood link-state information through the network --- an
  159. approach which can be unreliable and
  160. open to partitioning attacks or outright deception. Tor takes a simplified
  161. view towards distributing link-state information. Certain more trusted
  162. onion routers also serve as directory servers; they provide signed
  163. \emph{directories} describing all routers they know about, and which
  164. are currently up. Users periodically download these directories via HTTP.
  165. \item \textbf{End-to-end integrity checking:} Without integrity checking
  166. on traffic going through the network, any onion router on the path
  167. can change the contents of cells as they pass by --- for example, to redirect a
  168. connection on the fly so it connects to a different webserver, or to
  169. tag encrypted traffic and look for the tagged traffic at the network
  170. edges \cite{minion-design}. Tor hampers these attacks by checking data
  171. integrity before it leaves the network.
  172. \item \textbf{Robustness to failed nodes:} A failed node in a traditional
  173. mix network means lost messages, but thanks to Tor's step-by-step
  174. circuit building, users can notice failed
  175. nodes while building circuits and route around them. Additionally,
  176. liveness information from directories allows users to avoid
  177. unreliable nodes in the first place.
  178. %We further provide a
  179. %simple mechanism that allows connections to be established despite recent
  180. %node failure or slightly dated information from a directory server. Tor
  181. %permits onion routers to have \emph{router twins} --- nodes that share
  182. %the same private decryption key. Note that because connections now have
  183. %perfect forward secrecy, an onion router still cannot read the traffic
  184. %on a connection established through its twin even while that connection
  185. %is active. Also, which nodes are twins can change dynamically depending
  186. %on current circumstances, and twins may or may not be under the same
  187. %administrative authority.
  188. %
  189. %[Commented out; Router twins provide no real increase in robustness
  190. %to failed nodes. If a non-twinned node goes down, the
  191. %circuit-builder notices this and routes around it. Circuit-building
  192. %is offline, so there shouldn't even be a latency hit. -NM]
  193. \item \textbf{Variable exit policies:} Tor provides a consistent
  194. mechanism for
  195. each node to specify and advertise a policy describing the hosts and
  196. ports to which it will connect. These exit policies
  197. are critical in a volunteer-based distributed infrastructure, because
  198. each operator is comfortable with allowing different types of traffic
  199. to exit the Tor network from his node.
  200. \item \textbf{Implementable in user-space:} Because it only attempts to
  201. anonymize TCP streams, Tor differs from other anonymity systems like
  202. Freedom \cite{freedom} in that it does not require patches to an operating
  203. system's network stack in order to operate. Although this approach is less
  204. flexible, it has proven valuable to Tor's portability and deployability.
  205. \item \textbf{Rendezvous points and location-protected servers:} Tor
  206. provides an integrated mechanism for responder anonymity via
  207. location-protected servers. Previous Onion Routing designs included
  208. long-lived ``reply onions'' which could be used to build virtual
  209. circuits to a hidden server, but this approach is
  210. brittle because a reply onion becomes useless if any node in the
  211. path goes down or rotates its keys, and it's also
  212. %vulnerable to flooding attacks,
  213. % no it isn't. no more than our rendezvous point approach at least -RD
  214. incompatible with forward security. In Tor's
  215. current design, clients use {\it introduction points} to negotiate {\it
  216. rendezvous points} to connect with hidden servers; and reply onions
  217. are no longer required.
  218. \end{tightlist}
  219. [XXX carefully mention implementation, emphasizing that experience
  220. deploying isn't there yet, and not all features are implemented.
  221. Mention that it runs, is kinda alpha, kinda deployed, runs on win32.]
  222. We review previous work in Section \ref{sec:background}, describe
  223. our goals and assumptions in Section \ref{sec:assumptions},
  224. and then address the above list of improvements in Sections
  225. \ref{sec:design}-\ref{sec:maintaining-anonymity}. We then summarize
  226. how our design stands up to known attacks, and conclude with a list of
  227. open problems.
  228. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  229. \Section{Background and threat model}
  230. \label{sec:background}
  231. \SubSection{Related work}
  232. \label{sec:related-work}
  233. Modern anonymity designs date to Chaum's Mix-Net\cite{chaum-mix} design of
  234. 1981. Chaum proposed hiding sender-recipient connections by wrapping
  235. messages in several layers of public key cryptography, and relaying them
  236. through a path composed of Mix servers. Mix servers in turn decrypt, delay,
  237. and re-order messages, before relay them along the path towards their
  238. destinations.
  239. Subsequent relay-based anonymity designs have diverged in two
  240. principal directions. Some have attempted to maximize anonymity at
  241. the cost of introducing comparatively large and variable latencies,
  242. for example, Babel\cite{babel}, Mixmaster\cite{mixmaster-spec}, and
  243. Mixminion\cite{minion-design}. Because of this
  244. trade-off, such \emph{high-latency} networks are well-suited for anonymous
  245. email, but introduce too much lag for interactive tasks such as web browsing,
  246. internet chat, or SSH connections.
  247. % Parts of this graf belongs later in expository order. Some of the
  248. % sentences seem superficially unrelated.
  249. Tor belongs to the second category: \emph{low-latency} designs that
  250. attempt to anonymize interactive network traffic. Because such
  251. traffic tends to involve a relatively large numbers of packets, it is
  252. difficult to prevent an attacker who can eavesdrop entry and exit
  253. points from correlating packets entering the anonymity network with
  254. packets leaving it. Although some work has been done to frustrate
  255. these attacks, most designs protect primarily against traffic analysis
  256. rather than traffic confirmation \cite{or-jsac98}. One can pad and
  257. limit communication to a constant rate or at least to control the
  258. variation in traffic shape. This can have prohibitive bandwidth costs
  259. and/or performance limitations. One can also use a cascade (fixed
  260. shared route) with a relatively fixed set of users. This assumes a
  261. significant degree of agreement and provides an easier target for an active
  262. attacker since the endpoints are generally known. However, a practical
  263. network with both of these features and thousands of active users has
  264. been run for many years (the Java Anon Proxy, aka Web MIXes,
  265. \cite{web-mix}).
  266. Another low latency design that was proposed independently and at
  267. about the same time as the original Onion Routing was PipeNet \cite{pipenet}.
  268. It provided anonymity protections that were stronger than Onion Routing's,
  269. but at the cost of allowing a single user to shut down the network simply
  270. by not sending. It was also never implemented or formally published.
  271. The simplest low-latency designs are single-hop proxies such as the
  272. Anonymizer \cite{anonymizer}, wherein a single trusted server removes
  273. identifying users' data before relaying it. These designs are easy to
  274. analyze, but require end-users to trust the anonymizing proxy.
  275. More complex are distributed-trust, channel-based anonymizing systems. In
  276. these designs, a user establishes one or more medium-term bidirectional
  277. end-to-end tunnels to exit servers, and uses those tunnels to deliver a
  278. number of low-latency packets to and from one or more destinations per
  279. tunnel. Establishing tunnels is comparatively expensive and typically
  280. requires public-key cryptography, whereas relaying packets along a tunnel is
  281. comparatively inexpensive. Because a tunnel crosses several servers, no
  282. single server can learn the user's communication partners.
  283. %[Ouch: We haven't said what an onion is yet, but we use the word here! -NM]
  284. Systems such as earlier versions of Freedom and the original Onion Routing
  285. build the anonymous channel all at once (using an onion).
  286. Later designs of Freedom and Tor as described herein build
  287. the channel in stages, as does AnonNet
  288. \cite{anonnet}. Amongst other things, this makes perfect forward
  289. secrecy feasible.
  290. Some systems, such as Crowds \cite{crowds-tissec}, do not rely on the
  291. changing appearance of packets to hide the path; rather they employ
  292. mechanisms so that an intermediary cannot be sure when it is
  293. receiving from/sending to the ultimate initiator. There is no public-key
  294. encryption needed for Crowds, but the responder and all data are
  295. visible to all nodes on the path so that anonymity of connection
  296. initiator depends on filtering all identifying information from the
  297. data stream. Crowds is also designed only for HTTP traffic.
  298. Hordes \cite{hordes-jcs} is based on Crowds but also uses multicast
  299. responses to hide the initiator. Herbivore \cite{herbivore} and
  300. P5 \cite{p5} go even further requiring broadcast.
  301. They each use broadcast in different ways, and tradeoffs are made to
  302. make broadcast more practical. Both Herbivore and P5 are designed primarily
  303. for communication between communicating peers, although Herbivore
  304. permits external connections by requesting a peer to serve as a proxy.
  305. Allowing easy connections to nonparticipating responders or recipients
  306. is a practical requirement for many users, e.g., to visit
  307. nonparticipating Web sites or to exchange mail with nonparticipating
  308. recipients.
  309. Distributed-trust anonymizing systems differ in how they prevent attackers
  310. from controlling too many servers and thus compromising too many user paths.
  311. Some protocols rely on a centrally maintained set of well-known anonymizing
  312. servers. The current Tor design falls into this category.
  313. Others (such as Tarzan and MorphMix) allow unknown users to run
  314. servers, while using a limited resource (DHT space for Tarzan; IP space for
  315. MorphMix) to prevent an attacker from owning too much of the network.
  316. Crowds uses a centralized ``blender'' to enforce Crowd membership
  317. policy. For small crowds it is suggested that familiarity with all
  318. members is adequate. For large diverse crowds, limiting accounts in
  319. control of any one party is more difficult:
  320. ``(e.g., the blender administrator sets up an account for a user only
  321. after receiving a written, notarized request from that user) and each
  322. account to one jondo, and by monitoring and limiting the number of
  323. jondos on any one net- work (using IP address), the attacker would be
  324. forced to launch jondos using many different identities and on many
  325. different networks to succeed'' \cite{crowds-tissec}.
  326. Tor is not primarily designed for censorship resistance but rather
  327. for anonymous communication. However, Tor's rendezvous points, which
  328. enable connections between mutually anonymous entities, also
  329. facilitate connections to hidden servers. These building blocks to
  330. censorship resistance and other capabilities are described in
  331. Section~\ref{sec:rendezvous}. Location-hidden servers are an
  332. essential component for anonymous publishing systems such as
  333. Publius\cite{publius}, Free Haven\cite{freehaven-berk}, and
  334. Tangler\cite{tangler}.
  335. [XXX I'm considering the subsection as ended here for now. I'm leaving the
  336. following notes in case we want to revisit any of them. -PS]
  337. Channel-based anonymizing systems also differ in their use of dummy traffic.
  338. [XXX]
  339. Finally, several systems provide low-latency anonymity without channel-based
  340. communication. Crowds and [XXX] provide anonymity for HTTP requests; [...]
  341. [XXX Mention error recovery?]
  342. STILL NOT MENTIONED:
  343. isdn-mixes\\
  344. real-time mixes\\
  345. rewebbers\\
  346. cebolla\\
  347. [XXX Close by mentioning where Tor fits.]
  348. \Section{Design goals and assumptions}
  349. \label{sec:assumptions}
  350. \subsection{Goals}
  351. % Reformat this section like ``Adversary Model'' is formatted. -NM
  352. Like other low-latency anonymity designs, Tor seeks to frustrate
  353. attackers from linking communication partners, or from linking
  354. multiple communications to or from a single point. Within this
  355. main goal, however, several design considerations have directed
  356. Tor's evolution.
  357. First, we have tried to build a {\bf deployable} system. [XXX why?]
  358. This requirement precludes designs that are expensive to run (for
  359. example, by requiring more bandwidth than volunteers will easily
  360. provide); designs that place a heavy liability burden on operators
  361. (for example, by allowing attackers to implicate operators in illegal
  362. activities); and designs that are difficult or expensive to implement
  363. (for example, by requiring kernel patches to many operating systems,
  364. or ). [Only anon people need to run special software! Look at minion
  365. reviews]
  366. Second, the system must be {\bf usable}. A hard-to-use system has
  367. fewer users --- and because anonymity systems hide users among users, a
  368. system with fewer users provides less anonymity. Thus, usability is
  369. not only a convenience, but is a security requirement for anonymity
  370. systems. In order to be usable, Tor should with most of a
  371. user's unmodified aplication; shouldn't introduce prohibitive delays; and
  372. [XXX what else?].
  373. Third, the protocol must be {\bf extensible}, so that it can serve as
  374. a test-bed for future research in low-latency anonymity systems.
  375. (Note that while an extensible protocol benefits researchers, there is
  376. a danger that differing choices of extensions will render users
  377. distinguishable. Thus, implementations should not permit different
  378. protocol extensions to coexist in a single deployed network.)
  379. % We should mention that there's a specification someplace: the spec makes us
  380. % easier to extend too. -NM
  381. The protocol's design and security parameters must be {\bf
  382. conservative}. Additional features impose implementation and
  383. complexity costs. [XXX Say that we don't want to try to come up with
  384. speculative solutions to problems we don't KNOW how to solve? -NM]
  385. \subsection{Non-goals}
  386. In favoring conservative, deployable designs, we have explicitly
  387. deferred a number of goals --- not because they are not desirable in
  388. anonymity systems --- but because they are either solved
  389. elsewhere, or an area of active research without a generally accepted
  390. solution.
  391. Unlike Tarzan or Morphmix, Tor does not attempt to scale to completely
  392. decentralized peer-to-peer environments with thousands of short-lived
  393. servers, many of which may be controlled by an adversary.
  394. Tor does not claim to provide a definitive solution to end-to-end
  395. timing or intersection attacks for users who do not run their own
  396. Onion Routers.
  397. % Mention would-be approaches. -NM
  398. % Does that mean we do claim to solve intersection attack for
  399. % the enclave-firewall model? -RD
  400. Tor does not provide \emph{protocol normalization} like the Anonymizer or
  401. Privoxy. In order to provide client indistinguishibility for
  402. complex and variable protocols such as HTTP, Tor must be layered with
  403. a filtering proxy such as Privoxy. Similarly, Tor does not currently
  404. integrate tunneling for non-stream-based protocols; this too must be
  405. provided by an external service.
  406. Tor is not steganographic: it doesn't try to conceal which users are
  407. sending or receiving communications.
  408. \SubSection{Adversary Model}
  409. \label{subsec:adversary-model}
  410. Like all practical low-latency systems, Tor is not secure against a
  411. global passive adversary, which is the most commonly assumed adversary
  412. for analysis of theoretical anonymous communication designs. The adversary
  413. we assume
  414. is weaker than global with respect to distribution, but it is not
  415. merely passive.
  416. We assume a threat model that expands on that from \cite{or-pet00}.
  417. The basic adversary components we consider are:
  418. \begin{description}
  419. \item[Observer:] can observe a connection (e.g., a sniffer on an
  420. Internet router), but cannot initiate connections. Observations may
  421. include timing and/or volume of packets as well as appearance of
  422. individual packets (including headers and content).
  423. \item[Disrupter:] can delay (indefinitely) or corrupt traffic on a
  424. link. Can change all those things that an observer can observe up to
  425. the limits of computational ability (e.g., cannot forge signatures
  426. unless a key is compromised).
  427. \item[Hostile initiator:] can initiate (or destroy) connections with
  428. specific routes as well as vary the timing and content of traffic
  429. on the connections it creates. A special case of the disrupter with
  430. additional abilities appropriate to its role in forming connections.
  431. \item[Hostile responder:] can vary the traffic on the connections made
  432. to it including refusing them entirely, intentionally modifying what
  433. it sends and at what rate, and selectively closing them. Also a
  434. special case of the disrupter.
  435. \item[Key breaker:] can break the key used to encrypt connection
  436. initiation requests sent to a Tor-node.
  437. % Er, there are no long-term private decryption keys. They have
  438. % long-term private signing keys, and medium-term onion (decryption)
  439. % keys. Plus short-term link keys. Should we lump them together or
  440. % separate them out? -RD
  441. %
  442. % Hmmm, I was talking about the keys used to encrypt the onion skin
  443. % that contains the public DH key from the initiator. Is that what you
  444. % mean by medium-term onion key? (``Onion key'' used to mean the
  445. % session keys distributed in the onion, back when there were onions.)
  446. % Also, why are link keys short-term? By link keys I assume you mean
  447. % keys that neighbor nodes use to superencrypt all the stuff they send
  448. % to each other on a link. Did you mean the session keys? I had been
  449. % calling session keys short-term and everything else long-term. I
  450. % know I was being sloppy. (I _have_ written papers formalizing
  451. % concepts of relative freshness.) But, there's some questions lurking
  452. % here. First up, I don't see why the onion-skin encryption key should
  453. % be any shorter term than the signature key in terms of threat
  454. % resistance. I understand that how we update onion-skin encryption
  455. % keys makes them depend on the signature keys. But, this is not the
  456. % basis on which we should be deciding about key rotation. Another
  457. % question is whether we want to bother with someone who breaks a
  458. % signature key as a particular adversary. He should be able to do
  459. % nearly the same as a compromised tor-node, although they're not the
  460. % same. I reworded above, I'm thinking we should leave other concerns
  461. % for later. -PS
  462. \item{Hostile Tor node:} can arbitrarily manipulate the
  463. connections under its control, as well as creating new connections
  464. (that pass through itself).
  465. \end{description}
  466. All feasible adversaries can be composed out of these basic
  467. adversaries. This includes combinations such as one or more
  468. compromised Tor-nodes cooperating with disrupters of links on which
  469. those nodes are not adjacent, or such as combinations of hostile
  470. outsiders and link observers (who watch links between adjacent
  471. Tor-nodes). Note that one type of observer might be a Tor-node. This
  472. is sometimes called an honest-but-curious adversary. While an observer
  473. Tor-node will perform only correct protocol interactions, it might
  474. share information about connections and cannot be assumed to destroy
  475. session keys at end of a session. Note that a compromised Tor-node is
  476. stronger than any other adversary component in the sense that
  477. replacing a component of any adversary with a compromised Tor-node
  478. results in a stronger overall adversary (assuming that the compromised
  479. Tor-node retains the same signature keys and other private
  480. state-information as the component it replaces).
  481. In general we are more focused on traffic analysis attacks than
  482. traffic confirmation attacks. A user who runs a Tor proxy on his own
  483. machine, connects to some remote Tor-node and makes a connection to an
  484. open Internet site, such as a public web server, is vulnerable to
  485. traffic confirmation. That is, an active attacker who suspects that
  486. the particular client is communicating with the particular server will
  487. be able to confirm this if she can attack and observe both the
  488. connection between the Tor network and the client and that between the
  489. Tor network and the server. Even a purely passive attacker will be
  490. able to confirm if the timing and volume properties of the traffic on
  491. the connnection are unique enough. This is not to say that Tor offers
  492. no resistance to traffic confirmation; it does. We defer discussion
  493. of this point and of particular attacks until Section~\ref{sec:attacks},
  494. after we have described Tor in more detail. However, we note here some
  495. basic assumptions that affect the threat model.
  496. [XXX I think this next subsection should be cut, leaving its points
  497. for the attacks section. But I'm leaving it here for now. The above
  498. line refers to the immediately following SubSection.-PS]
  499. \SubSection{Known attacks against low-latency anonymity systems}
  500. \label{subsec:known-attacks}
  501. % Should be merged into ``Threat model'' and reiterated in Attacks. -NM
  502. We discuss each of these attacks in more detail below, along with the
  503. aspects of the Tor design that provide defense. We provide a summary
  504. of the attacks and our defenses against them in Section~\ref{sec:attacks}.
  505. Passive attacks:
  506. simple observation,
  507. timing correlation,
  508. size correlation,
  509. option distinguishability,
  510. Active attacks:
  511. key compromise,
  512. iterated subpoena,
  513. run recipient,
  514. run a hostile node,
  515. compromise entire path,
  516. selectively DOS servers,
  517. introduce timing into messages,
  518. directory attacks,
  519. tagging attacks,
  520. smear attacks,
  521. entrapment attacks
  522. \SubSection{Assumptions}
  523. % Should be merged into ``Threat model''.
  524. For purposes of this paper, we assume all directory servers are honest
  525. % No longer true, see subsec:dirservers below -RD
  526. and trusted. Perhaps more accurately, we assume that all users and
  527. nodes can perform their own periodic checks on information they have
  528. from directory servers and that all will always have access to at
  529. least one directory server that they trust and from which they obtain
  530. all directory information. Future work may include robustness
  531. techniques to cope with a minority dishonest servers.
  532. Somewhere between ten percent and twenty percent of nodes are assumed
  533. to be compromised. In some circumstances, e.g., if the Tor network is
  534. running on a hardened network where all operators have had
  535. background checks, the percent of compromised nodes might be much
  536. lower. It may be worthwhile to consider cases where many of the `bad'
  537. nodes are not fully compromised but simply (passive) observing
  538. adversaries or that some nodes have only had compromise of the keys
  539. that decrypt connection initiation requests. But, we assume for
  540. simplicity that `bad' nodes are compromised in the sense spelled out
  541. above. We assume that all adversary components, regardless of their
  542. capabilities are collaborating and are connected in an offline clique.
  543. We do not assume any hostile users, except in the context of
  544. % This sounds horrible. What do you mean we don't assume any hostile
  545. % users? Surely we can tolerate some? -RD
  546. rendezvous points. Nonetheless, we assume that users vary widely in
  547. both the duration and number of times they are connected to the Tor
  548. network. They can also be assumed to vary widely in the volume and
  549. shape of the traffic they send and receive.
  550. [XXX what else?]
  551. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  552. \Section{The Tor Design}
  553. \label{sec:design}
  554. The Tor network is an overlay network; each node is called an onion router
  555. (OR). Onion routers run on normal computers without needing any special
  556. privileges. Each OR maintains a long-term TLS connection to every other
  557. OR (although we look at ways to relax this clique-topology assumption in
  558. section \ref{subsec:restricted-routes}). A subset of the ORs also act as
  559. directory servers, tracking which routers are currently in the network;
  560. see section \ref{subsec:dirservers} for directory server details. Users
  561. run local software called an onion proxy (OP) that fetches directories,
  562. establishes paths (called \emph{virtual circuits}) over the network,
  563. and handles connections from the user applications. Onion proxies accept
  564. TCP streams and multiplex them across the virtual circuit. The onion
  565. router on the other side
  566. % I don't mean other side, I mean wherever it is on the circuit. But
  567. % don't want to introduce complexity this early? Hm. -RD
  568. of the circuit connects to the destinations of
  569. the TCP streams and relays data.
  570. Onion routers have three types of keys. The first key is the identity
  571. (signing) key. An OR uses this key to sign TLS certificates, to sign its
  572. router descriptor (a summary of its keys, address, bandwidth, exit policy,
  573. etc), and to sign directories if it is a directory server. Changing the
  574. identity key of a router is considered equivalent to creating a new
  575. router. The second key is the onion (decryption) key, which is used
  576. for decrypting requests from users to set up a circuit and negotiate
  577. ephemeral keys. Thirdly, each OR shares link keys (generated by TLS)
  578. with the other ORs it's connected to. We discuss rotating these keys in
  579. Section \ref{subsec:rotating-keys}.
  580. Section \ref{subsec:cells} discusses the structure of the fixed-size
  581. \emph{cells} that are the unit of communication in Tor. We describe
  582. in Section \ref{subsec:circuits} how circuits work, and how they are
  583. built, extended, truncated, and destroyed. Section \ref{subsec:tcp}
  584. discusses the process of opening TCP streams through Tor, and finally
  585. Section \ref{subsec:congestion} talks about congestion control and
  586. fairness issues.
  587. \SubSection{Cells}
  588. \label{subsec:cells}
  589. Traffic passes from node to node in fixed-size cells. Each cell is 256
  590. bytes, and consists of a header and a payload. The header includes the
  591. circuit identifier (ACI) which specifies which circuit the cell refers to
  592. (many circuits can be multiplexed over the single TCP connection between
  593. ORs or between an OP and an OR), and a command to describe what to do
  594. with the cell's payload. Cells are either control cells, meaning they are
  595. intended to be interpreted by the node that receives them, or relay cells,
  596. meaning they carry end-to-end stream data. Controls cells can be one of:
  597. \emph{padding} (currently used for keepalive, but can be used for link
  598. padding), \emph{create} or \emph{created} (to set up a new circuit),
  599. or \emph{destroy} (to tear down a circuit).
  600. Relay cells have an additional header (the relay header) after the
  601. cell header, which specifies the stream identifier (many streams can
  602. be multiplexed over a circuit), an end-to-end checksum for integrity
  603. checking, the length of the relay payload, and a relay command. Relay
  604. commands can be one of: \emph{relay
  605. data} (for data flowing down the stream), \emph{relay begin} (to open a
  606. stream), \emph{relay end} (to close a stream), \emph{relay connected}
  607. (to notify the OP that a relay begin has succeeded), \emph{relay
  608. extend} and \emph{relay extended} (to extend the circuit by a hop,
  609. and to acknowledge), \emph{relay truncate} and \emph{relay truncated}
  610. (to tear down only part of the circuit, and to acknowledge), \emph{relay
  611. sendme} (used for congestion control), and \emph{relay drop} (used to
  612. implement long-range dummies).
  613. We will talk more about each of these cell types below.
  614. % Nick: should there have been a table here? -RD
  615. \SubSection{Circuits and streams}
  616. \label{subsec:circuits}
  617. While the original Onion Routing design built one circuit for each stream,
  618. Tor circuits can be used by many streams. Thus because circuits can
  619. take several tenths of a second to construct due to crypto and network
  620. latency, users construct circuits preemptively. Users build a new circuit
  621. periodically (currently every minute) if the previous one has been used,
  622. and expire old used circuits that are no longer in use. Thus even very
  623. active users spend a negligible amount of time and CPU in building
  624. circuits, but only a limited number of requests can be linked to each
  625. other by a given exit node.
  626. Users set up circuits incrementally, negotiating a symmetric key with
  627. each hop one at a time. To create a new circuit, the user (call her
  628. Alice) sends a \emph{create} cell to the first node in her chosen
  629. path. The payload is the first half of the Diffie-Hellman handshake,
  630. encrypted to the onion key of the OR (call him Bob). Bob responds with a
  631. \emph{created} cell with the second half of the DH handshake, along with
  632. a hash of $K=g^{xy}$. The goal is to get unilateral entity authentication
  633. (Alice knows she's handshaking with Bob, Bob doesn't care who it is ---
  634. recall that Alice has no key and is trying to remain anonymous) and
  635. unilateral key authentication (Alice and Bob agree on a key, and Alice
  636. knows Bob is the only other person who could know it). We also want
  637. perfect forward secrecy, key freshness, etc.
  638. \begin{equation}
  639. \begin{aligned}
  640. \mathrm{Alice} \rightarrow \mathrm{Bob}&: E_{PK_{Bob}}(g^x) \\
  641. \mathrm{Bob} \rightarrow \mathrm{Alice}&: g^y, H(K | \mathrm{``handshake"}) \\
  642. \end{aligned}
  643. \end{equation}
  644. Being able to prove knowledge of this $K$ shows both that it was Bob
  645. who received $g^x$, and that it was Bob who came up with $y$. We use
  646. PK encryption in the first step (rather than, eg, using the first two
  647. steps of STS, which has a signature in the second step) because we
  648. don't have enough room in a single cell for a public key and also a
  649. signature. Preliminary analysis with the NRL protocol analyzer shows
  650. the above protocol to be secure (including providing PFS) under the
  651. traditional Dolev-Yao model.
  652. % cite Cathy? -RD
  653. % did I use the buzzwords correctly? -RD
  654. To extend a circuit past the first hop, Alice sends a \emph{relay extend}
  655. cell to the last node in the circuit, specifying the address of the new
  656. OR and an encrypted $g^x$ for it. That node copies the half-handshake
  657. into a \emph{create} cell, and passes it to the new OR to extend the
  658. circuit. When it responds with a \emph{created} cell, the penultimate OR
  659. copies the payload into a \emph{relay extended} cell and passes it back.
  660. % Nick: please fix my "that OR" pronouns -RD
  661. Once Alice has established the circuit (so she shares a key with each
  662. OR on the circuit), she can send relay cells.
  663. %The stream ID in the relay header indicates to which stream the cell belongs.
  664. % Nick: should i include the above line?
  665. Alice can address each relay cell to any of the ORs on the circuit. To
  666. construct a relay cell destined for a given OR, she iteratively
  667. encrypts the cell payload (that is, the relay header and payload)
  668. with the symmetric key of each hop up to that node. Then, at each hop
  669. down the circuit, the OR decrypts the cell payload and checks whether
  670. it recognizes the stream ID. A stream ID is recognized either if it
  671. is an already open stream at that OR, or if it is equal to zero. The
  672. zero stream ID is treated specially, and is used for control messages,
  673. e.g. starting a new stream. If the stream ID is unrecognized, the OR
  674. sends the relay cell downstream. This \emph{leaky pipe} circuit design
  675. allows Alice's streams to exit at different ORs, for example to tolerate
  676. different exit policies, or to keep the ORs from knowing that two streams
  677. originate at the same person.
  678. To tear down a circuit, Alice sends a destroy control cell. Each OR
  679. in the circuit receives the destroy cell, closes all open streams on
  680. that circuit, and passes a new destroy cell forward. But since circuits
  681. can be built incrementally, they can also be torn down incrementally:
  682. Alice can send a relay truncate cell to a node along the circuit. That
  683. node will send a destroy cell forward, and reply with a relay truncated
  684. acknowledgement. Alice might truncate her circuit so she can extend it
  685. to different nodes without notifying the first few nodes (or somebody
  686. observing them) that she is changing her circuit. That is, nodes in the
  687. middle are not even aware that the circuit was truncated, because the
  688. relay cells are encrypted. Similarly, if a node on the circuit goes down,
  689. the adjacent node can send a relay truncated back to Alice. Thus the
  690. ``break a node and see which circuits go down'' attack is weakened.
  691. \SubSection{Opening and closing streams}
  692. \label{subsec:tcp}
  693. When Alice's application wants to open a TCP connection to a given
  694. address and port, it asks the OP (via SOCKS) to make the connection. The
  695. OP chooses the newest open circuit (or creates one if none is available),
  696. chooses a suitable OR on that circuit to be the exit node (usually the
  697. last node, but maybe others due to exit policy conflicts; see Section
  698. \ref{sec:exit-policies}), chooses a new random stream ID for this stream,
  699. and delivers a relay begin cell to that exit node. It uses a stream ID
  700. of zero for the begin cell (so the OR will recognize it), and the relay
  701. payload lists the new stream ID and the destination address and port.
  702. Once the exit node completes the connection to the remote host, it
  703. responds with a relay connected cell through the circuit. Upon receipt,
  704. the OP notifies the application that it can begin talking.
  705. There's a catch to using SOCKS, though -- some applications hand the
  706. alphanumeric address to the proxy, while others resolve it into an IP
  707. address first and then hand the IP to the proxy. When the application
  708. does the DNS resolution first, Alice broadcasts her destination. Common
  709. applications like Mozilla and ssh have this flaw.
  710. In the case of Mozilla, we're fine: the filtering web proxy called Privoxy
  711. does the SOCKS call safely, and Mozilla talks to Privoxy safely. But a
  712. portable general solution, such as for ssh, is an open problem. We could
  713. modify the local nameserver, but this approach is invasive, brittle, and
  714. not portable. We could encourage the resolver library to do resolution
  715. via TCP rather than UDP, but this approach is hard to do right, and also
  716. has portability problems. Our current answer is to encourage the use of
  717. privacy-aware proxies like Privoxy wherever possible, and also provide
  718. a tool similar to \emph{dig} that can do a private lookup through the
  719. Tor network.
  720. Ending a Tor stream is analogous to ending a TCP stream: it uses a
  721. two-step handshake for normal operation, or a one-step handshake for
  722. errors. If one side of the stream closes abnormally, that node simply
  723. sends a relay teardown cell, and tears down the stream. If one side
  724. % Nick: mention relay teardown in 'cell' subsec? good enough name? -RD
  725. of the stream closes the connection normally, that node sends a relay
  726. end cell down the circuit. When the other side has sent back its own
  727. relay end, the stream can be torn down. This two-step handshake allows
  728. for TCP-based applications that, for example, close a socket for writing
  729. but are still willing to read.
  730. \SubSection{Tagging attacks on streams}
  731. In the old Onion Routing design, traffic was vulnerable to a malleability
  732. attack: since there was no integrity checking, an adversary could
  733. guess some of the plaintext of a cell, xor it out, and xor in his own
  734. plaintext. Even an external adversary could do this despite the link
  735. encryption!
  736. Some examples of this attack might be to change a create cell to a
  737. destroy cell, to change the destination address in a relay begin cell
  738. to the adversary's webserver, or to change a user on an ftp connection
  739. from typing ``dir'' to typing ``delete *''. Any node or observer along
  740. the path can introduce such corruption in a stream.
  741. Tor solves the tagging attack with respect to external adversaries simply
  742. by using TLS. Addressing the insider tagging attack is more complex.
  743. Rather than doing integrity checking of the relay cells at each hop
  744. (like Mixminion \cite{minion-design}), which would increase packet size
  745. by a function of path length\footnote{This is also the argument against
  746. using recent cipher modes like EAX \cite{eax} --- we don't want the added
  747. message-expansion overhead at each hop, and we don't want to leak the path
  748. length}, we choose to accept passive timing attacks, and do integrity
  749. checking only at the edges of the circuit. When Alice negotiates a key
  750. with that hop, they both start a SHA-1 with some derivative of that key,
  751. thus starting out with randomness that only the two of them know. From
  752. then on they each incrementally add all the data bytes flowing across
  753. the stream to the SHA-1, and each relay cell includes the first 4 bytes
  754. of the current value of the hash.
  755. The attacker must be able to guess all previous bytes between Alice
  756. and Bob on that circuit (including the pseudorandomness from the key
  757. negotiation), plus the bytes in the current cell, to remove modify the
  758. cell. The computational overhead isn't so bad, compared to doing an AES
  759. crypt at each hop in the circuit. We use only four bytes per cell to
  760. minimize overhead; the chance that an adversary will correctly guess a
  761. valid hash, plus the payload the current cell, is acceptly low, given
  762. that Alice or Bob tear down the circuit if they receive a bad hash.
  763. %% probably don't need to even mention this, because the randomness
  764. %% covers it:
  765. %The fun SHA1 attack where the bad guy can incrementally add to a hash
  766. %to get a new valid hash doesn't apply to us, because we never show any
  767. %hashes to anybody.
  768. \SubSection{Website fingerprinting attacks}
  769. old onion routing is vulnerable to website fingerprinting attacks like
  770. david martin's from usenix sec and drew's from pet2002. so is tor. we
  771. need to send some padding or something, including long-range padding
  772. (to foil the first hop), to solve this. let's hope somebody writes
  773. a followup to \cite{defensive-dropping} that tells us what, exactly,
  774. to do, and why, exactly, it helps.
  775. \SubSection{Congestion control and fairness}
  776. \label{subsec:congestion}
  777. Even with bandwidth throttling, we still need to worry about congestion,
  778. either accidental or intentional. If a lot of people make circuits into
  779. the same node, and they all come out through the same connection, then
  780. that connection may become saturated (be unable to send out cells as
  781. quickly as it wants to). For example, an adversary can make a 'put'
  782. request through the onion routing network to a webserver he owns,
  783. and then refuse to read any of the bytes at the webserver end of the
  784. circuit. These bottlenecks can propagate back through the entire network,
  785. mucking up everything.
  786. Describe circuit-level and stream-level
  787. congestion control issues and solutions.
  788. Describe circuit-level and stream-level fairness issues; cite Marc's
  789. anonnet stuff.
  790. \Section{Other design decisions}
  791. \SubSection{Resource management and DoS prevention}
  792. \label{subsec:dos}
  793. Describe DoS prevention. cookies before tls begins, rate limiting of
  794. create cells, link-to-link rate limiting, etc.
  795. Mention twins, what the do, what they can't.
  796. How we should do sequencing and acking like TCP so that we can better
  797. tolerate lost data cells.
  798. Mention that designers have to choose what you send across your
  799. circuit: wrapped IP packets, wrapped stream data, etc. [Disspell
  800. TCP-over-TCP misconception.]
  801. Mention that OR-to-OR connections should be highly reliable. If
  802. they aren't, everything can stall.
  803. \SubSection{Exit policies and abuse}
  804. \label{subsec:exitpolicies}
  805. Exit abuse is a serious barrier to wide-scale Tor deployment --- we
  806. must block or limit attacks and other abuse that users can do through
  807. the Tor network.
  808. Each onion router's \emph{exit policy} describes to which external
  809. addresses and ports the router will permit stream connections. On one end
  810. of the spectrum are \emph{open exit} nodes that will connect anywhere;
  811. on the other end are \emph{middleman} nodes that only relay traffic to
  812. other Tor nodes, and \emph{private exit} nodes that only connect locally
  813. or to addresses internal to that node's organization.
  814. This private exit
  815. node configuration is more secure for clients --- the adversary cannot
  816. see plaintext traffic leaving the network (e.g. to a webserver), so he
  817. is less sure of Alice's destination. More generally, nodes can require
  818. a variety of forms of traffic authentication \cite{onion-discex00}.
  819. Most onnion routers will function as \emph{limited exits} that permit
  820. connections to the world at large, but restrict access to certain abuse-prone
  821. addresses and services.
  822. Tor offers more reliability than the high-latency fire-and-forget
  823. anonymous email networks, because the sender opens a TCP stream
  824. with the remote mail server and receives an explicit confirmation of
  825. acceptance. But ironically, the private exit node model works poorly for
  826. email, when Tor nodes are run on volunteer machines that also do other
  827. things, because it's quite hard to configure mail transport agents so
  828. normal users can send mail normally, but the Tor process can only deliver
  829. mail locally. Further, most organizations have specific hosts that will
  830. deliver mail on behalf of certain IP ranges; Tor operators must be aware
  831. of these hosts and consider putting them in the Tor exit policy.
  832. The abuse issues on closed (e.g. military) networks are different
  833. from the abuse on open networks like the Internet. While these IP-based
  834. access controls are still commonplace on the Internet, on closed networks,
  835. nearly all participants will be honest, and end-to-end authentication
  836. can be assumed for anything important.
  837. Tor is harder than minion because tcp doesn't include an abuse
  838. address. you could reach inside the http stream and change the agent
  839. or something, but that's a specific case and probably won't help
  840. much anyway.
  841. And volunteer nodes don't resolve to anonymizer.mit.edu so it never
  842. even occurs to people that it wasn't you.
  843. Preventing abuse of open exit nodes is an unsolved problem. Princeton's
  844. CoDeeN project \cite{darkside} gives us a glimpse of what we're in for.
  845. % This is more speculative than a description of our design.
  846. but their solutions, which mainly involve rate limiting and blacklisting
  847. nodes which do bad things, don't translate directly to Tor. Rate limiting
  848. still works great, but Tor intentionally separates sender from recipient,
  849. so it's hard to know which sender was the one who did the bad thing,
  850. without just making the whole network wide open.
  851. even limiting most nodes to allow http, ssh, and aim to exit and reject
  852. all other stuff is sketchy, because plenty of abuse can happen over
  853. port 80. but it's a surprisingly good start, because it blocks most things,
  854. and because people are more used to the concept of port 80 abuse not
  855. coming from the machine's owner.
  856. we could also run intrusion detection system (IDS) modules at each tor
  857. node, to dynamically monitor traffic streams for attack signatures. it
  858. can even react when it sees a signature by closing the stream. but IDS's
  859. don't actually work most of the time, and besides, how do you write a
  860. signature for "is sending a mean mail"?
  861. we should run a squid at each exit node, to provide comparable anonymity
  862. to private exit nodes for cache hits, to speed everything up, and to
  863. have a buffer for funny stuff coming out of port 80. we could similarly
  864. have other exit proxies for other protocols, like mail, to check
  865. delivered mail for being spam.
  866. A mixture of open and restricted exit nodes will allow the most
  867. flexibility for volunteers running servers. But while a large number
  868. of middleman nodes is useful to provide a large and robust network,
  869. a small number of exit nodes still simplifies traffic analysis because
  870. there are fewer nodes the adversary needs to monitor, and also puts a
  871. greater burden on the exit nodes.
  872. The JAP cascade model is really nice because they only need one node to
  873. take the heat per cascade. On the other hand, a hydra scheme could work
  874. better (it's still hard to watch all the clients).
  875. Discuss importance of public perception, and how abuse affects it.
  876. ``Usability is a security parameter''. ``Public Perception is also a
  877. security parameter.''
  878. Discuss smear attacks.
  879. \SubSection{Directory Servers}
  880. \label{subsec:dirservers}
  881. First-generation Onion Routing designs \cite{or-jsac98,freedom2-arch} did
  882. % is or-jsac98 the right cite here? what's our stock OR cite? -RD
  883. in-band network status updates: each router flooded a signed statement
  884. to its neighbors, which propagated it onward. But anonymizing networks
  885. have different security goals than typical link-state routing protocols.
  886. For example, we worry more about delays (accidental or intentional)
  887. that can cause different parts of the network to have different pictures
  888. of link-state and topology. We also worry about attacks to deceive a
  889. client about the router membership list, topology, or current network
  890. state. Such \emph{partitioning attacks} on client knowledge help an
  891. adversary with limited resources to efficiently deploy those resources
  892. when attacking a target.
  893. Instead, Tor uses a small group of redundant directory servers to
  894. track network topology and node state such as current keys and exit
  895. policies. The directory servers are normal onion routers, but there are
  896. only a few of them and they are more trusted. They listen on a separate
  897. port as an HTTP server, both so participants can fetch current network
  898. state and router lists (a \emph{directory}), and so other onion routers
  899. can upload their router descriptors.
  900. [[mention that descriptors are signed with long-term keys; ORs publish
  901. regularly to dirservers; policies for generating directories; key
  902. rotation (link, onion, identity); Everybody already know directory
  903. keys; how to approve new nodes (advogato, sybil, captcha (RTT));
  904. policy for handling connections with unknown ORs; diff-based
  905. retrieval; diff-based consesus; separate liveness from descriptor
  906. list]]
  907. Of course, a variety of attacks remain. An adversary who controls a
  908. directory server can track certain clients by providing different
  909. information --- perhaps by listing only nodes under its control
  910. as working, or by informing only certain clients about a given
  911. node. Moreover, an adversary without control of a directory server can
  912. still exploit differences among client knowledge. If Eve knows that
  913. node $M$ is listed on server $D_1$ but not on $D_2$, she can use this
  914. knowledge to link traffic through $M$ to clients who have queried $D_1$.
  915. Thus these directory servers must be synchronized and redundant. The
  916. software is distributed with the signature public key of each directory
  917. server, and directories must be signed by a threshold of these keys.
  918. The directory servers in Tor are modeled after those in Mixminion
  919. \cite{minion-design}, but our situation is easier. Firstly, we make the
  920. simplifying assumption that all participants agree on who the directory
  921. servers are. Secondly, Mixminion needs to predict node behavior ---
  922. that is, build a reputation system for guessing future performance of
  923. nodes based on past performance, and then figure out a way to build
  924. a threshold consensus of these predictions. Tor just needs to get a
  925. threshold consensus of the current state of the network.
  926. The threshold consensus can be reached with standard Byzantine agreement
  927. techniques \cite{castro-liskov}.
  928. % Should I just stop the section here? Is the rest crap? -RD
  929. But this library, while more efficient than previous Byzantine agreement
  930. systems, is still complex and heavyweight for our purposes: we only need
  931. to compute a single algorithm, and we do not require strict in-order
  932. computation steps. The Tor directory servers build a consensus directory
  933. through a simple four-round broadcast protocol. First, each server signs
  934. and broadcasts its current opinion to the other directory servers; each
  935. server then rebroadcasts all the signed opinions it has received. At this
  936. point all directory servers check to see if anybody's cheating. If so,
  937. directory service stops, the humans are notified, and that directory
  938. server is permanently removed from the network. Assuming no cheating,
  939. each directory server then computes a local algorithm on the set of
  940. opinions, resulting in a uniform shared directory. Then the servers sign
  941. this directory and broadcast it; and finally all servers rebroadcast
  942. the directory and all the signatures.
  943. The rebroadcast steps ensure that a directory server is heard by either
  944. all of the other servers or none of them (some of the links between
  945. directory servers may be down). Broadcasts are feasible because there
  946. are so few directory servers (currently 3, but we expect to use as many
  947. as 9 as the network scales). The actual local algorithm for computing
  948. the shared directory is straightforward, and is described in the Tor
  949. specification \cite{tor-spec}.
  950. % we should, uh, add this to the spec. oh, and write it. -RD
  951. Using directory servers rather than flooding approaches provides
  952. simplicity and flexibility. For example, they don't complicate
  953. the analysis when we start experimenting with non-clique network
  954. topologies. And because the directories are signed, they can be cached at
  955. all the other onion routers (or even elsewhere). Thus directory servers
  956. are not a performance bottleneck when we have many users, and also they
  957. won't aid traffic analysis by forcing clients to periodically announce
  958. their existence to any central point.
  959. % Mention Hydra as an example of non-clique topologies. -NM, from RD
  960. \Section{Rendezvous points: location privacy}
  961. \label{sec:rendezvous}
  962. Rendezvous points are a building block for \emph{location-hidden services}
  963. (aka responder anonymity) in the Tor network. Location-hidden
  964. services means Bob can offer a tcp service, such as a webserver,
  965. without revealing the IP of that service.
  966. We provide this censorship resistance for Bob by allowing him to
  967. advertise several onion routers (his \emph{Introduction Points}) as his
  968. public location. Alice, the client, chooses a node for her \emph{Meeting
  969. Point}. She connects to one of Bob's introduction points, informs him
  970. about her rendezvous point, and then waits for him to connect to the
  971. rendezvous
  972. point. This extra level of indirection means Bob's introduction points
  973. don't open themselves up to abuse by serving files directly, eg if Bob
  974. chooses a node in France to serve material distateful to the French. The
  975. extra level of indirection also allows Bob to respond to some requests
  976. and ignore others.
  977. We provide the necessary glue so that Alice can view webpages from Bob's
  978. location-hidden webserver with minimal invasive changes. Both Alice and
  979. Bob must run local onion proxies.
  980. The steps of a rendezvous:
  981. \begin{tightlist}
  982. \item Bob chooses some Introduction Points, and advertises them on a
  983. Distributed Hash Table (DHT).
  984. \item Bob establishes onion routing connections to each of his
  985. Introduction Points, and waits.
  986. \item Alice learns about Bob's service out of band (perhaps Bob told her,
  987. or she found it on a website). She looks up the details of Bob's
  988. service from the DHT.
  989. \item Alice chooses and establishes a Rendezvous Point (RP) for this
  990. transaction.
  991. \item Alice goes to one of Bob's Introduction Points, and gives it a blob
  992. (encrypted for Bob) which tells him about herself, the RP
  993. she chose, and the first half of an ephemeral key handshake. The
  994. Introduction Point sends the blob to Bob.
  995. \item Bob chooses whether to ignore the blob, or to onion route to RP.
  996. Let's assume the latter.
  997. \item RP plugs together Alice and Bob. Note that RP can't recognize Alice,
  998. Bob, or the data they transmit (they share a session key).
  999. \item Alice sends a Begin cell along the circuit. It arrives at Bob's
  1000. onion proxy. Bob's onion proxy connects to Bob's webserver.
  1001. \item Data goes back and forth as usual.
  1002. \end{tightlist}
  1003. When establishing an introduction point, Bob provides the onion router
  1004. with a public ``introduction'' key. The hash of this public key
  1005. identifies a unique service, and (since Bob is required to sign his
  1006. messages) prevents anybody else from usurping Bob's introduction point
  1007. in the future. Bob uses the same public key when establishing the other
  1008. introduction points for that service.
  1009. The blob that Alice gives the introduction point includes a hash of Bob's
  1010. public key to identify the service, an optional initial authentication
  1011. token (the introduction point can do prescreening, eg to block replays),
  1012. and (encrypted to Bob's public key) the location of the rendezvous point,
  1013. a rendezvous cookie Bob should tell RP so he gets connected to
  1014. Alice, an optional authentication token so Bob can choose whether to respond,
  1015. and the first half of a DH key exchange. When Bob connects to RP
  1016. and gets connected to Alice's pipe, his first cell contains the
  1017. other half of the DH key exchange.
  1018. % briefly talk about our notion of giving cookies to people proportional
  1019. % to how important they are, for location-protected servers hardened
  1020. % against DDoS threat? -RD
  1021. \subsection{Integration with user applications}
  1022. For each service Bob offers, he configures his local onion proxy to know
  1023. the local IP and port of the server, a strategy for authorizating Alices,
  1024. and a public key. We assume the existence of a robust decentralized
  1025. efficient lookup system which allows authenticated updates, eg
  1026. \cite{cfs:sosp01}. (Each onion router could run a node in this lookup
  1027. system; also note that as a stopgap measure, we can just run a simple
  1028. lookup system on the directory servers.) Bob publishes into the DHT
  1029. (indexed by the hash of the public key) the public key, an expiration
  1030. time (``not valid after''), and the current introduction points for that
  1031. service. Note that Bob's webserver is unmodified, and doesn't even know
  1032. that it's hidden behind the Tor network.
  1033. As far as Alice's experience goes, we require that her client interface
  1034. remain a SOCKS proxy, and we require that she shouldn't have to modify
  1035. her applications. Thus we encode all of the necessary information into
  1036. the hostname (more correctly, fully qualified domain name) that Alice
  1037. uses, eg when clicking on a url in her browser. Location-hidden services
  1038. use the special top level domain called `.onion': thus hostnames take the
  1039. form x.y.onion where x encodes the hash of PK, and y is the authentication
  1040. cookie. Alice's onion proxy examines hostnames and recognizes when they're
  1041. destined for a hidden server. If so, it decodes the PK and starts the
  1042. rendezvous as described in the table above.
  1043. \subsection{Previous rendezvous work}
  1044. Ian Goldberg developed a similar notion of rendezvous points for
  1045. low-latency anonymity systems \cite{ian-thesis}. His ``service tag''
  1046. is the same concept as our ``hash of service's public key''. We make it
  1047. a hash of the public key so it can be self-authenticating, and so the
  1048. client can recognize the same service with confidence later on. His
  1049. design differs from ours in the following ways though. Firstly, Ian
  1050. suggests that the client should manually hunt down a current location of
  1051. the service via Gnutella; whereas our use of the DHT makes lookup faster,
  1052. more robust, and transparent to the user. Secondly, in Tor the client
  1053. and server can share ephemeral DH keys, so at no point in the path is
  1054. the plaintext
  1055. exposed. Thirdly, our design is much more practical for deployment in a
  1056. volunteer network, in terms of getting volunteers to offer introduction
  1057. and rendezvous point services. The introduction points do not output any
  1058. bytes to the clients, and the rendezvous points don't know the client,
  1059. the server, or the stuff being transmitted. The indirection scheme
  1060. is also designed with authentication/authorization in mind -- if the
  1061. client doesn't include the right cookie with its request for service,
  1062. the server doesn't even acknowledge its existence.
  1063. \Section{Analysis}
  1064. How well do we resist chosen adversary?
  1065. How well do we meet stated goals?
  1066. Mention jurisdictional arbitrage.
  1067. Pull attacks and defenses into analysis as a subsection
  1068. \Section{Maintaining anonymity in Tor}
  1069. \label{sec:maintaining-anonymity}
  1070. [Put as much of this as a part of open issues as is possible.]
  1071. [what's an anonymity set?]
  1072. packet counting attacks work great against initiators. need to do some
  1073. level of obfuscation for that. standard link padding for passive link
  1074. observers. long-range padding for people who own the first hop. are
  1075. we just screwed against people who insert timing signatures into your
  1076. traffic?
  1077. Even regardless of link padding from Alice to the cloud, there will be
  1078. times when Alice is simply not online. Link padding, at the edges or
  1079. inside the cloud, does not help for this.
  1080. how often should we pull down directories? how often send updated
  1081. server descs?
  1082. when we start up the client, should we build a circuit immediately,
  1083. or should the default be to build a circuit only on demand? should we
  1084. fetch a directory immediately?
  1085. would we benefit from greater synchronization, to blend with the other
  1086. users? would the reduced speed hurt us more?
  1087. does the "you can't see when i'm starting or ending a stream because
  1088. you can't tell what sort of relay cell it is" idea work, or is just
  1089. a distraction?
  1090. does running a server actually get you better protection, because traffic
  1091. coming from your node could plausibly have come from elsewhere? how
  1092. much mixing do you need before this is actually plausible, or is it
  1093. immediately beneficial because many adversary can't see your node?
  1094. do different exit policies at different exit nodes trash anonymity sets,
  1095. or not mess with them much?
  1096. do we get better protection against a realistic adversary by having as
  1097. many nodes as possible, so he probably can't see the whole network,
  1098. or by having a small number of nodes that mix traffic well? is a
  1099. cascade topology a more realistic way to get defenses against traffic
  1100. confirmation? does the hydra (many inputs, few outputs) topology work
  1101. better? are we going to get a hydra anyway because most nodes will be
  1102. middleman nodes?
  1103. using a circuit many times is good because it's less cpu work.
  1104. good because of predecessor attacks with path rebuilding.
  1105. bad because predecessor attacks can be more likely to link you with a
  1106. previous circuit since you're so verbose.
  1107. bad because each thing you do on that circuit is linked to the other
  1108. things you do on that circuit.
  1109. how often to rotate?
  1110. how to decide when to exit from middle?
  1111. when to truncate and re-extend versus when to start new circuit?
  1112. Because Tor runs over TCP, when one of the servers goes down it seems
  1113. that all the circuits (and thus streams) going over that server must
  1114. break. This reduces anonymity because everybody needs to reconnect
  1115. right then (does it? how much?) and because exit connections all break
  1116. at the same time, and it also reduces usability. It seems the problem
  1117. is even worse in a p2p environment, because so far such systems don't
  1118. really provide an incentive for nodes to stay connected when they're
  1119. done browsing, so we would expect a much higher churn rate than for
  1120. onion routing. Are there ways of allowing streams to survive the loss
  1121. of a node in the path?
  1122. discuss topologies. Cite George's non-freeroutes paper. Maybe this
  1123. graf goes elsewhere.
  1124. discuss attracting users; incentives; usability.
  1125. Choosing paths and path lengths.
  1126. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1127. \Section{Attacks and Defenses}
  1128. \label{sec:attacks}
  1129. Below we summarize a variety of attacks and how well our design withstands
  1130. them.
  1131. \begin{enumerate}
  1132. \item \textbf{Passive attacks}
  1133. \begin{itemize}
  1134. \item \emph{Simple observation.}
  1135. \item \emph{Timing correlation.}
  1136. \item \emph{Size correlation.}
  1137. \item \emph{Option distinguishability.}
  1138. \end{itemize}
  1139. \item \textbf{Active attacks}
  1140. \begin{itemize}
  1141. \item \emph{Key compromise.}
  1142. \item \emph{Iterated subpoena.}
  1143. \item \emph{Run recipient.}
  1144. \item \emph{Run a hostile node.}
  1145. \item \emph{Compromise entire path.}
  1146. \item \emph{Selectively DoS servers.}
  1147. \item \emph{Introduce timing into messages.}
  1148. \item \emph{Tagging attacks.}
  1149. the exit node can change the content you're getting to try to
  1150. trick you. similarly, when it rejects you due to exit policy,
  1151. it could give you a bad IP that sends you somewhere else.
  1152. \end{itemize}
  1153. we rely on DNS being globally consistent. if people in africa resolve
  1154. IPs differently, then asking to extend a circuit to a certain IP can
  1155. give away your origin.
  1156. \item \textbf{Directory attacks}
  1157. \begin{itemize}
  1158. \item knock out a dirserver
  1159. \item knock out half the dirservers
  1160. \item trick user into using different software (with different dirserver
  1161. keys)
  1162. \item OR connects to the dirservers but nowhere else
  1163. \item foo
  1164. \end{itemize}
  1165. \item \textbf{Attacks against rendezvous points}
  1166. \begin{itemize}
  1167. \item foo
  1168. \end{itemize}
  1169. \end{enumerate}
  1170. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1171. \Section{Future Directions and Open Problems}
  1172. \label{sec:conclusion}
  1173. % Mention that we need to do TCP over tor for reliability.
  1174. Tor brings together many innovations into
  1175. a unified deployable system. But there are still several attacks that
  1176. work quite well, as well as a number of sustainability and run-time
  1177. issues remaining to be ironed out. In particular:
  1178. \begin{itemize}
  1179. \item \emph{Scalability:} Since Tor's emphasis currently is on simplicity
  1180. of design and deployment, the current design won't easily handle more
  1181. than a few hundred servers, because of its clique topology. Restricted
  1182. route topologies \cite{danezis-pets03} promise comparable anonymity
  1183. with much better scaling properties, but we must solve problems like
  1184. how to randomly form the network without introducing net attacks.
  1185. % [cascades are a restricted route topology too. we must mention
  1186. % earlier why we're not satisfied with the cascade approach.]-RD
  1187. % [We do. At least
  1188. \item \emph{Cover traffic:} Currently we avoid cover traffic because
  1189. it introduces clear performance and bandwidth costs, but and its
  1190. security properties are not well understood. With more research
  1191. \cite{SS03,defensive-dropping}, the price/value ratio may change, both for
  1192. link-level cover traffic and also long-range cover traffic. In particular,
  1193. we expect restricted route topologies to reduce the cost of cover traffic
  1194. because there are fewer links to cover.
  1195. \item \emph{Better directory distribution:} Even with the threshold
  1196. directory agreement algorithm described in \ref{subsec:dirservers},
  1197. the directory servers are still trust bottlenecks. We must find more
  1198. decentralized yet practical ways to distribute up-to-date snapshots of
  1199. network status without introducing new attacks.
  1200. \item \emph{Implementing location-hidden servers:} While Section
  1201. \ref{sec:rendezvous} provides a design for rendezvous points and
  1202. location-hidden servers, this feature has not yet been implemented.
  1203. We will likely encounter additional issues, both in terms of usability
  1204. and anonymity, that must be resolved.
  1205. \item \emph{Wider-scale deployment:} The original goal of Tor was to
  1206. gain experience in deploying an anonymizing overlay network, and learn
  1207. from having actual users. We are now at the point where we can start
  1208. deploying a wider network. We will see what happens!
  1209. % ok, so that's hokey. fix it. -RD
  1210. \item \emph{Further specification review:} Foo.
  1211. \end{itemize}
  1212. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1213. %\Section{Acknowledgments}
  1214. %% commented out for anonymous submission
  1215. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1216. \bibliographystyle{latex8}
  1217. \bibliography{tor-design}
  1218. \end{document}
  1219. % Style guide:
  1220. % U.S. spelling
  1221. % avoid contractions (it's, can't, etc.)
  1222. % 'mix', 'mixes' (as noun)
  1223. % 'mix-net'
  1224. % 'mix', 'mixing' (as verb)
  1225. % 'middleman' [Not with a hyphen; the hyphen has been optional
  1226. % since Middle English.]
  1227. % 'nymserver'
  1228. % 'Cypherpunk', 'Cypherpunks', 'Cypherpunk remailer'
  1229. % 'Onion Routing design', 'onion router' [note capitalization]
  1230. % 'SOCKS'
  1231. %
  1232. %
  1233. % 'Substitute ``Damn'' every time you're inclined to write ``very;'' your
  1234. % editor will delete it and the writing will be just as it should be.'
  1235. % -- Mark Twain