110-avoid-infinite-circuits.txt 4.7 KB

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