For some open and accepted proposals, note their target versions.
[tor.git] / doc / spec / proposals / 110-avoid-infinite-circuits.txt
blobc1323e883e7a8ab134e143098714cee02ff0e929
1 Filename: 110-avoid-infinite-circuits.txt
2 Title: Avoiding infinite length circuits
3 Version: $Revision$
4 Last-Modified: $Date$
5 Author: Roger Dingledine
6 Created: 13-Mar-2007
7 Status: Accepted
8 Target: 0.2.1.x
10 History:
12   Revised 3 July 2008 by nickm: rename from relay_extend to
13      relay_early.  Revise to current migration plan.  Allow K cells
14      over circuit lifetime, not just at start.
16 Overview:
18   Right now, an attacker can add load to the Tor network by extending a
19   circuit an arbitrary number of times. Every cell that goes down the
20   circuit then adds N times that amount of load in overall bandwidth
21   use. This vulnerability arises because servers don't know their position
22   on the path, so they can't tell how many nodes there are before them
23   on the path.
25   We propose a new set of relay cells that are distinguishable by
26   intermediate hops as permitting extend cells. This approach will allow
27   us to put an upper bound on circuit length relative to the number of
28   colluding adversary nodes; but there are some downsides too.
30 Motivation:
32   The above attack can be used to generally increase load all across the
33   network, or it can be used to target specific servers: by building a
34   circuit back and forth between two victim servers, even a low-bandwidth
35   attacker can soak up all the bandwidth offered by the fastest Tor
36   servers.
38   The general attacks could be used as a demonstration that Tor isn't
39   perfect (leading to yet more media articles about "breaking" Tor), and
40   the targetted attacks will come into play once we have a reputation
41   system -- it will be trivial to DoS a server so it can't pass its
42   reputation checks, in turn impacting security.
44 Design:
46   We should split RELAY cells into two types: RELAY and RELAY_EARLY.
48   Only K (say, 10) Relay_early cells can be sent across a circuit, and
49   only relay_early cells are allowed to contain extend requests. We
50   still support obscuring the length of the circuit (if more research
51   shows us what to do), because Alice can choose how many of the K to
52   mark as relay_early. Note that relay_early cells *can* contain any
53   sort of data cell; so in effect it's actually the relay type cells
54   that are restricted. By default, she would just send the first K
55   data cells over the stream as relay_early cells, regardless of their
56   actual type.
58   Each intermediate server would pass on the same type of cell that it
59   received (either relay or relay_early), and the cell's destination
60   will be able to learn whether it's allowed to contain an Extend request.
62   If an intermediate server receives more than K relay_early cells, or
63   if it sees a relay cell that contains an extend request, then it
64   tears down the circuit (protocol violation).
66 Security implications:
68   The upside is that this limits the bandwidth amplification factor to
69   K: for an individual circuit to become arbitrary-length, the attacker
70   would need an adversary-controlled node every K hops, and at that
71   point the attack is no worse than if the attacker creates N/K separate
72   K-hop circuits.
74   On the other hand, we want to pick a large enough value of K that we
75   don't mind the cap.
77   If we ever want to take steps to hide the number of hops in the circuit
78   or a node's position in the circuit, this design probably makes that
79   more complex.
81 Migration:
83   In 0.2.0, servers speaking v2 or later of the link protocol accept
84   RELAY_EARLY cells, and pass them on.  If the next OR in the circuit
85   is not speaking the v2 link protocol, the server relays the cell as
86   a RELAY cell.
88   In 0.2.1.x, clients begin using RELAY_EARLY cells on v2 connections.
89   This functionality can be safely backported to 0.2.0.x.  Clients
90   should pick a random number betweeen (say) 8 and 10 to send.
92   In 0.2.1.x, servers close any circuit in which more than K
93   relay_early cells are sent.
95   Once all versions the do not send RELAY_EARLY cells are obsolete,
96   servers can begin to reject any EXTEND requests not sent in a
97   RELAY_EARLY cell.
99 Spec:
101   [We can formalize this part once we think the design is a good one.]
103 Acknowledgements:
105   This design has been kicking around since Christian Grothoff and I came
106   up with it at PET 2004. (Nathan Evans, Christian Grothoff's student,
107   is working on implementing a fix based on this design in the summer
108   2007 timeframe.)