121-hidden-service-authentication.txt 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. Filename: 121-hidden-service-authentication.txt
  2. Title: Hidden Service Authentication
  3. Version: $Revision$
  4. Last-Modified: $Date$
  5. Author: Tobias Kamm, Thomas Lauterbach, Karsten Loesing, Ferdinand Rieger,
  6. Christoph Weingarten
  7. Created: 10-Sep-2007
  8. Status: Open
  9. Change history:
  10. 26-Sep-2007 Initial proposal for or-dev
  11. 08-Dec-2007 Incorporated comments by Nick posted to or-dev on 10-Oct-2007
  12. 15-Dec-2007 Rewrote complete proposal for better readability, modified
  13. authentication protocol, merged in personal notes
  14. 24-Dec-2007 Replaced misleading term "authentication" by "authorization"
  15. and added some clarifications (comments by Sven Kaffille)
  16. 28-Apr-2008 Updated most parts of the concrete authorization protocol
  17. 04-Jul-2008 Add a simple algorithm to delay descriptor publication for
  18. different clients of a hidden service
  19. Overview:
  20. This proposal deals with a general infrastructure for performing
  21. authorization (not necessarily implying authentication) of requests to
  22. hidden services at three points: (1) when downloading and decrypting
  23. parts of the hidden service descriptor, (2) at the introduction point,
  24. and (3) at Bob's Tor client before contacting the rendezvous point. A
  25. service provider will be able to restrict access to his service at these
  26. three points to authorized clients only. Further, the proposal contains a
  27. first instance of an authorization protocol for the presented
  28. infrastructure.
  29. This proposal is based on v2 hidden service descriptors as described in
  30. proposal 114 and introduced in version 0.2.0.10-alpha.
  31. The proposal is structured as follows: The next section motivates the
  32. integration of authorization mechanisms in the hidden service protocol.
  33. Then we describe a general infrastructure for authorization in hidden
  34. services, followed by a specific authorization protocol for this
  35. infrastructure. At the end we discuss a number of attacks and non-attacks
  36. as well as compatibility issues.
  37. Motivation:
  38. The major part of hidden services does not require client authorization
  39. now and won't do so in the future. To the contrary, many clients would
  40. not want to be (pseudonymously) identifiable by the service (though this
  41. is unavoidable to some extent), but rather use the service
  42. anonymously. These services are not addressed by this proposal.
  43. However, there may be certain services which are intended to be accessed
  44. by a limited set of clients only. A possible application might be a
  45. wiki or forum that should only be accessible for a closed user group.
  46. Another, less intuitive example might be a real-time communication
  47. service, where someone provides a presence and messaging service only to
  48. his buddies. Finally, a possible application would be a personal home
  49. server that should be remotely accessed by its owner.
  50. Performing authorization for a hidden service within the Tor network, as
  51. proposed here, offers a range of advantages compared to allowing all
  52. client connections in the first instance and deferring authorization to
  53. the transported protocol:
  54. (1) Reduced traffic: Unauthorized requests would be rejected as early as
  55. possible, thereby reducing the overall traffic in the network generated
  56. by establishing circuits and sending cells.
  57. (2) Better protection of service location: Unauthorized clients could not
  58. force Bob to create circuits to their rendezvous points, thus preventing
  59. the attack described by Øverlier and Syverson in their paper "Locating
  60. Hidden Servers" even without the need for guards.
  61. (3) Hiding activity: Apart from performing the actual authorization, a
  62. service provider could also hide the mere presence of his service from
  63. unauthorized clients when not providing hidden service descriptors to
  64. them, rejecting unauthorized requests already at the introduction
  65. point (ideally without leaking presence information at any of these
  66. points), or not answering unauthorized introduction requests.
  67. (4) Better protection of introduction points: When providing hidden
  68. service descriptors to authorized clients only and encrypting the
  69. introduction points as described in proposal 114, the introduction points
  70. would be unknown to unauthorized clients and thereby protected from DoS
  71. attacks.
  72. (5) Protocol independence: Authorization could be performed for all
  73. transported protocols, regardless of their own capabilities to do so.
  74. (6) Ease of administration: A service provider running multiple hidden
  75. services would be able to configure access at a single place uniformly
  76. instead of doing so for all services separately.
  77. (7) Optional QoS support: Bob could adapt his node selection algorithm
  78. for building the circuit to Alice's rendezvous point depending on a
  79. previously guaranteed QoS level, thus providing better latency or
  80. bandwidth for selected clients.
  81. A disadvantage of performing authorization within the Tor network is
  82. that a hidden service cannot make use of authorization data in
  83. the transported protocol. Tor hidden services were designed to be
  84. independent of the transported protocol. Therefore it's only possible to
  85. either grant or deny access to the whole service, but not to specific
  86. resources of the service.
  87. Authorization often implies authentication, i.e. proving one's identity.
  88. However, when performing authorization within the Tor network, untrusted
  89. points should not gain any useful information about the identities of
  90. communicating parties, neither server nor client. A crucial challenge is
  91. to remain anonymous towards directory servers and introduction points.
  92. However, trying to hide identity from the hidden service is a futile
  93. task, because a client would never know if he is the only authorized
  94. client and therefore perfectly identifiable. Therefore, hiding client
  95. identity from the hidden service is not aimed by this proposal.
  96. The current implementation of hidden services does not provide any kind
  97. of authorization. The hidden service descriptor version 2, introduced by
  98. proposal 114, was designed to use a descriptor cookie for downloading and
  99. decrypting parts of the descriptor content, but this feature is not yet
  100. in use. Further, most relevant cell formats specified in rend-spec
  101. contain fields for authorization data, but those fields are neither
  102. implemented nor do they suffice entirely.
  103. Details:
  104. 1. General infrastructure for authorization to hidden services
  105. We spotted three possible authorization points in the hidden service
  106. protocol:
  107. (1) when downloading and decrypting parts of the hidden service
  108. descriptor,
  109. (2) at the introduction point, and
  110. (3) at Bob's Tor client before contacting the rendezvous point.
  111. The general idea of this proposal is to allow service providers to
  112. restrict access to some or all of these points to authorized clients
  113. only.
  114. 1.1. Client authorization at directory
  115. Since the implementation of proposal 114 it is possible to combine a
  116. hidden service descriptor with a so-called descriptor cookie. If done so,
  117. the descriptor cookie becomes part of the descriptor ID, thus having an
  118. effect on the storage location of the descriptor. Someone who has learned
  119. about a service, but is not aware of the descriptor cookie, won't be able
  120. to determine the descriptor ID and download the current hidden service
  121. descriptor; he won't even know whether the service has uploaded a
  122. descriptor recently. Descriptor IDs are calculated as follows (see
  123. section 1.2 of rend-spec for the complete specification of v2 hidden
  124. service descriptors):
  125. descriptor-id =
  126. H(service-id | H(time-period | descriptor-cookie | replica))
  127. Currently, service-id is equivalent to permanent-id which is calculated
  128. as in the following formula. But in principle it could be any public
  129. key.
  130. permanent-id = H(permanent-key)[:10]
  131. The second purpose of the descriptor cookie is to encrypt the list of
  132. introduction points, including optional authorization data. Hence, the
  133. hidden service directories won't learn any introduction information from
  134. storing a hidden service descriptor. This feature is implemented but
  135. unused at the moment, so that this proposal will harness the advantages
  136. of proposal 114.
  137. The descriptor cookie can be used for authorization by keeping it secret
  138. from everyone but authorized clients. A service could then decide whether
  139. to publish hidden service descriptors using that descriptor cookie later
  140. on. An authorized client being aware of the descriptor cookie would be
  141. able to download and decrypt the hidden service descriptor.
  142. The number of concurrently used descriptor cookies for one hidden service
  143. is not restricted. A service could use a single descriptor cookie for all
  144. users, a distinct cookie per user, or something in between, like one
  145. cookie per group of users. It is up to the specific protocol and how it
  146. is applied by a service provider.
  147. Two or more hidden service descriptors for different groups or users
  148. should not be uploaded at the same time. A directory node could conclude
  149. easily that the descriptors, were issued by the same hidden service, thus
  150. being able to link the two groups or users. Therefore, descriptors for
  151. different users or clients that ought to be stored on the same directory
  152. are delayed, so that only one descriptor is uploaded to a directory at a
  153. time. The remaining descriptors are uploaded with a delay of 30 seconds.
  154. Further, descriptors for different groups or users that are to be stored
  155. on different directories are delayed for a random time of up to 30
  156. seconds to hide relations from colluding directories. Certainly, this
  157. does not prevent linking entirely, but it makes it somewhat harder.
  158. There is a conflict between hiding links between clients and making a
  159. service available in a timely manner.
  160. Although this part of the proposal is meant to describe a general
  161. infrastructure for authorization, changing the way of using the
  162. descriptor cookie to look up hidden service descriptors, e.g. applying
  163. some sort of asymmetric crypto system, would require in-depth changes
  164. that would be incompatible to v2 hidden service descriptors. On the
  165. contrary, using another key for en-/decrypting the introduction point
  166. part of a hidden service descriptor, e.g. a different symmetric key or
  167. asymmetric encryption, would be easy to implement and compatible to v2
  168. hidden service descriptors as understood by hidden service directories
  169. (clients and servers would have to be upgraded anyway for using the new
  170. features).
  171. 1.2. Client authorization at introduction point
  172. The next possible authorization point after downloading and decrypting
  173. a hidden service descriptor is the introduction point. It may be important
  174. for authorization, because it bears the last chance of hiding presence
  175. of a hidden service from unauthorized clients. Further, performing
  176. authorization at the introduction point might reduce traffic in the
  177. network, because unauthorized requests would not be passed to the
  178. hidden service. This applies to those clients who are aware of a
  179. descriptor cookie and thereby of the hidden service descriptor, but do
  180. not have authorization data to pass the introduction point or access the
  181. service (such a situation might occur when authorization data for
  182. authorization at the directory is not issued on a per-user base as
  183. opposed to authorization data for authorization at the introduction
  184. point).
  185. It is important to note that the introduction point must be considered
  186. untrustworthy, and therefore cannot replace authorization at the hidden
  187. service itself. Nor should the introduction point learn any sensitive
  188. identifiable information from either server or client.
  189. In order to perform authorization at the introduction point, three
  190. message formats need to be modified: (1) v2 hidden service descriptors,
  191. (2) ESTABLISH_INTRO cells, and (3) INTRODUCE1 cells.
  192. A v2 hidden service descriptor needs to contain authorization data that
  193. is introduction-point-specific and sometimes also authorization data
  194. that is introduction-point-independent. Therefore, v2 hidden service
  195. descriptors as specified in section 1.2 of rend-spec already contain two
  196. reserved fields "intro-authorization" and "service-authorization"
  197. (originally, the names of these fields were "...-authentication")
  198. containing an authorization type number and arbitrary authorization
  199. data. We propose that authorization data consists of base64 encoded
  200. objects of arbitrary length, surrounded by "-----BEGIN MESSAGE-----" and
  201. "-----END MESSAGE-----". This will increase the size of hidden service
  202. descriptors, which however is possible, as there is no strict upper
  203. limit.
  204. The current ESTABLISH_INTRO cells as described in section 1.3 of
  205. rend-spec do not contain either authorization data or version
  206. information. Therefore, we propose a new version 1 of the ESTABLISH_INTRO
  207. cells adding these two issues as follows:
  208. V Format byte: set to 255 [1 octet]
  209. V Version byte: set to 1 [1 octet]
  210. KL Key length [2 octets]
  211. PK Bob's public key [KL octets]
  212. HS Hash of session info [20 octets]
  213. AUTHT The auth type that is supported [1 octet]
  214. AUTHL Length of auth data [2 octets]
  215. AUTHD Auth data [variable]
  216. SIG Signature of above information [variable]
  217. From the format it is possible to determine the maximum allowed size for
  218. authorization data: given the fact that cells are 512 octets long, of
  219. which 498 octets are usable (see section 6.1 of tor-spec), and assuming
  220. 1024 bit = 128 octet long keys, there are 215 octets left for
  221. authorization data. Hence, authorization protocols are bound to use no
  222. more than these 215 octets, regardless of the number of clients that
  223. shall be authenticated at the introduction point. Otherwise, one would
  224. need to send multiple ESTABLISH_INTRO cells or split them up, what we do
  225. not specify here.
  226. In order to understand a v1 ESTABLISH_INTRO cell, the implementation of
  227. a relay must have a certain Tor version, which would probably be some
  228. 0.2.1.x. Hidden services need to be able to distinguish relays being
  229. capable of understanding the new v1 cell formats and perform
  230. authorization. We propose to use the version number that is contained in
  231. networkstatus documents to find capable introduction points.
  232. The current INTRODUCE1 cells as described in section 1.8 of rend-spec is
  233. not designed to carry authorization data and has no version number, too.
  234. We propose the following version 1 of INTRODUCE1 cells:
  235. Cleartext
  236. V Version byte: set to 1 [1 octet]
  237. PK_ID Identifier for Bob's PK [20 octets]
  238. AUTHT The auth type that is supported [1 octet]
  239. AUTHL Length of auth data [2 octets]
  240. AUTHD Auth data [variable]
  241. Encrypted to Bob's PK:
  242. (RELAY_INTRODUCE2 cell)
  243. The maximum length of contained authorization data depends on the length
  244. of the contained INTRODUCE2 cell. A calculation follows below when
  245. describing the INTRODUCE2 cell format we propose to use.
  246. Unfortunately, v0 INTRODUCE1 cells consist only of a fixed-size,
  247. seemingly random PK_ID, followed by the encrypted INTRODUCE2 cell. This
  248. makes it impossible to distinguish v0 INTRODUCE1 cells from any later
  249. format. In particular, it is not possible to introduce some kind of
  250. format and version byte for newer versions of this cell. That's probably
  251. where the comment "[XXX011 want to put intro-level auth info here, but no
  252. version. crap. -RD]" that was part of rend-spec some time ago comes from.
  253. Processing of v1 INTRODUCE1 cells therefore requires knowledge about the
  254. context in which they are used. As a result, we propose that when
  255. receiving a v1 ESTABLISH_INTRO cell, an introduction point only accepts
  256. v1 INTRODUCE1 cells later on. Hence, the same introduction point cannot
  257. be used to accept both v0 and v1 INTRODUCE1 cells for the same service.
  258. (Another solution would be to distinguish v0 and v1 INTRODUCE1 cells by
  259. their size, as v0 INTRODUCE1 cells can only have specific cell sizes,
  260. depending on the version of the contained INTRODUCE2 cell; however, this
  261. approach does not appear very clean.)
  262. 1.3. Client authorization at hidden service
  263. The time when a hidden service receives an INTRODUCE2 cell constitutes
  264. the last possible authorization point during the hidden service
  265. protocol. Performing authorization here is easier than at the other two
  266. authorization points, because there are no possibly untrusted entities
  267. involved.
  268. In general, a client that is successfully authorized at the introduction
  269. point should be granted access at the hidden service, too. Otherwise, the
  270. client would receive a positive INTRODUCE_ACK cell from the introduction
  271. point and conclude that it may connect to the service, but the request
  272. will be dropped without notice. This would appear as a failure to
  273. clients. Therefore, the number of cases in which a client successfully
  274. passes the introduction point, but fails at the hidden service should be
  275. zero. However, this does not lead to the conclusion, that the
  276. authorization data used at the introduction point and the hidden service
  277. must be the same, but only that both authorization data should lead to
  278. the same authorization result.
  279. Authorization data is transmitted from client to server via an
  280. INTRODUCE2 cell that is forwarded by the introduction point. There are
  281. versions 0 to 2 specified in section 1.8 of rend-spec, but none of these
  282. contains fields for carrying authorization data. We propose a slightly
  283. modified version of v3 INTRODUCE2 cells that is specified in section
  284. 1.8.1 and which is not implemented as of December 2007. In contrast to
  285. the specified v3 we avoid specifying (and implementing) IPv6 capabilities,
  286. because Tor relays will be required to support IPv4 addresses for a long
  287. time in the future, so that this seems unnecessary at the moment. The
  288. proposed format of v3 INTRODUCE2 cells is as follows:
  289. VER Version byte: set to 3. [1 octet]
  290. AUTHT The auth type that is supported [1 octet]
  291. AUTHL Length of auth data [2 octets]
  292. AUTHD Auth data [variable]
  293. IP Rendezvous point's address [4 octets]
  294. PORT Rendezvous point's OR port [2 octets]
  295. ID Rendezvous point identity ID [20 octets]
  296. KLEN Length of onion key [2 octets]
  297. KEY Rendezvous point onion key [KLEN octets]
  298. RC Rendezvous cookie [20 octets]
  299. g^x Diffie-Hellman data, part 1 [128 octets]
  300. The maximum possible length of authorization data is related to the
  301. enclosing INTRODUCE1 cell. A v3 INTRODUCE2 cell with
  302. 1024 bit = 128 octets long public keys without any authorization data
  303. occupies 306 octets (AUTHL is only used when AUTHT has a value != 0),
  304. plus 58 octets for hybrid public key encryption (see
  305. section 5.1 of tor-spec on hybrid encryption of CREATE cells). The
  306. surrounding v1 INTRODUCE1 cell requires 24 octets. This leaves only 110
  307. of the 498 available octets free, which must be shared between
  308. authorization data to the introduction point _and_ to the hidden
  309. service.
  310. When receiving a v3 INTRODUCE2 cell, Bob checks whether a client has
  311. provided valid authorization data to him. He will only then build a
  312. circuit to the provided rendezvous point and otherwise will drop the
  313. cell.
  314. There might be several attacks based on the idea of replaying existing
  315. cells to the hidden service. In particular, someone (the introduction
  316. point or an evil authenticated client) might replay valid INTRODUCE2
  317. cells to make the hidden service build an arbitrary number of circuits to
  318. (maybe long gone) rendezvous points. Therefore, we propose that hidden
  319. services maintain a history of received INTRODUCE2 cells within the last
  320. hour and only accept INTRODUCE2 cells matching the following rules:
  321. (1) no duplicate requests coming from the same client and containing
  322. the same rendezvous cookie, and
  323. (2) a maximum of 10 cells coming from the same client with different
  324. rendezvous cookies.
  325. This allows a client to retry connection establishment using the same
  326. rendezvous point for 3 times and a total number of 10 connection
  327. establishments (not requests in the transported protocol) per hour.
  328. 1.4. Summary of authorization data fields
  329. In summary, the proposed descriptor format and cell formats provide the
  330. following fields for carrying authorization data:
  331. (1) The v2 hidden service descriptor contains:
  332. - a descriptor cookie that is used for the lookup process, and
  333. - an arbitrary encryption schema to ensure authorization to access
  334. introduction information (currently symmetric encryption with the
  335. descriptor cookie).
  336. (2) For performing authorization at the introduction point we can use:
  337. - the fields intro-authorization and service-authorization in
  338. hidden service descriptors,
  339. - a maximum of 215 octets in the ESTABLISH_INTRO cell, and
  340. - one part of 110 octets in the INTRODUCE1 cell.
  341. (3) For performing authorization at the hidden service we can use:
  342. - the fields intro-authorization and service-authorization in
  343. hidden service descriptors,
  344. - the other part of 110 octets in the INTRODUCE2 cell.
  345. It will also still be possible to access a hidden service without any
  346. authorization or only use a part of the authorization infrastructure.
  347. However, this requires to consider all parts of the infrastructure. For
  348. example, authorization at the introduction point relying on confidential
  349. intro-authorization data transported in the hidden service descriptor
  350. cannot be performed without using an encryption schema for introduction
  351. information.
  352. 1.5. Managing authorization data at servers and clients
  353. In order to provide authorization data at the hidden server and the
  354. authenticated clients, we propose to use files---either the tor
  355. configuration file or separate files. The exact format of these special
  356. files depends on the authorization protocol used.
  357. Currently, rend-spec contains the proposition to encode client-side
  358. authorization data in the URL, like in x.y.z.onion. This was never used
  359. and is also a bad idea, because in case of HTTP the requested URL may be
  360. contained in the Host and Referer fields.
  361. 2. An authorization protocol based on group and user passwords
  362. In the following we discuss an authorization protocol for the proposed
  363. authorization architecture that performs authorization at the directory
  364. and the hidden service, but not at the introduction point.
  365. The protocol relies on a distinct asymmetric (client-key) and a
  366. symmetric key (descriptor-cookie) for
  367. each client. The asymmetric key replaces the service's permanent key and
  368. the symmetric key is used as descriptor cookie as described above.
  369. 2.1. Client authorization at directory
  370. The symmetric key of 128 bits length is used as descriptor cookie for
  371. publishing/fetching
  372. hidden service descriptors and for encrypting/decrypting the contained
  373. introduction points. Further, the asymmetric key replaces the service's
  374. permanent key that is used to encode and sign a v2 hidden service descriptor.
  375. The result is a v2 hidden service descriptor with the following format:
  376. descriptor-id =
  377. H(H(client-key)[:10] | H(time-period | descriptor-cookie | replica))
  378. descriptor-content = {
  379. descriptor-id,
  380. version,
  381. client-key,
  382. H(time-period | descriptor-cookie | replica),
  383. timestamp,
  384. protocol-versions,
  385. { introduction-points } encrypted with descriptor-cookie
  386. } signed with private-key
  387. Whenever a
  388. server decides to remove authorization for a client, he can simply stop
  389. publishing hidden service descriptors using the descriptor cookie.
  390. The fact that there needs to be a separate
  391. hidden service descriptor for each user leads to a large number of
  392. such descriptors. However, this is the only way for a service
  393. provider to remove a client's authorization without remains. We assume
  394. that distributing the directory of hidden service descriptors as
  395. implemented by proposal 114 provides the necessary scalability to do so.
  396. 2.2. Client authorization at introduction point
  397. There is no need to perform authorization at the introduction point in
  398. this protocol. Only authorized clients can decrypt the introduction
  399. point part of a hidden service descriptor. This contains the
  400. introduction key that was introduced by proposal 114 and that is required
  401. to get an INTRODUCE1 cell passed at the introduction point.
  402. 2.3. Client authorization at hidden service
  403. Authorization at the hidden service also makes use of the
  404. descriptor cookie. The client include this descriptor cookie,
  405. in INTRODUCE2 cells that it sends to the server.
  406. The server compares authorization data of incoming INTRODUCE2 cells with
  407. the locally stored value that it would expect. The authorization type
  408. number of this protocol for INTRODUCE2 cells is "2".
  409. 2.4. Providing authorization data
  410. The Tor client of a hidden service needs to know the client keys
  411. and descriptor cookies of all authorized clients. We decided to
  412. create a new configuration option that specifies a comma-separated list
  413. of human-readable client names:
  414. HiddenServiceAuthorizeClient client-name,client-name,...
  415. When a hidden service is configured, the client keys and descriptor
  416. cookies for all configured client names are either read from a file
  417. or generated and appended to that file. The file format is:
  418. "client-name" human-readable client identifier NL
  419. "service-address" onion-address NL
  420. "descriptor-cookie" 128-bit key ^= 22 base64 chars NL
  421. "client-key" NL a public key in PEM format
  422. On client side, we propose to add a new configuration option that
  423. contains a service name, the service identifier (H(client-key)[:10]),
  424. and the descriptor cookie that are required to access a hidden service.
  425. The configuration option has the following syntax:
  426. HidServAuth service-name service-address descriptor-cookie
  427. Whenever the user tries to access the given onion address, the given
  428. descriptor cookie is used for authorization.
  429. Security implications:
  430. In the following we want to discuss possible attacks by dishonest
  431. entities in the presented infrastructure and specific protocol. These
  432. security implications would have to be verified once more when adding
  433. another protocol. The dishonest entities (theoretically) include the
  434. hidden server itself, the authenticated clients, hidden service directory
  435. nodes, introduction points, and rendezvous points. The relays that are
  436. part of circuits used during protocol execution, but never learn about
  437. the exchanged descriptors or cells by design, are not considered.
  438. Obviously, this list makes no claim to be complete. The discussed attacks
  439. are sorted by the difficulty to perform them, in ascending order,
  440. starting with roles that everyone could attempt to take and ending with
  441. partially trusted entities abusing the trust put in them.
  442. (1) A hidden service directory could attempt to conclude presence of a
  443. server from the existence of a locally stored hidden service descriptor:
  444. This passive attack is possible only for a single client-service
  445. relation, because descriptors need to contain a
  446. publicly visible signature of the server using the client key
  447. A possible protection
  448. would be to increase the number of hidden service directories in the
  449. network.
  450. (2) A hidden service directory could try to break the descriptor cookies
  451. of locally stored descriptors: This attack can be performed offline. The
  452. only useful countermeasure against it might be using safe passwords that
  453. are generated by Tor.
  454. (3) An introduction point could try to identify the pseudonym of the
  455. hidden service on behalf of which it operates: This is impossible by
  456. design, because the service uses a fresh public key for every
  457. establishment of an introduction point (see proposal 114) and the
  458. introduction point receives a fresh introduction cookie, so that there is
  459. no identifiable information about the service that the introduction point
  460. could learn. The introduction point cannot even tell if client accesses
  461. belong to the same client or not, nor can it know the total number of
  462. authorized clients. The only information might be the pattern of
  463. anonymous client accesses, but that is hardly enough to reliably identify
  464. a specific service.
  465. (4) An introduction point could want to learn the identities of accessing
  466. clients: This is also impossible by design, because all clients use the
  467. same introduction cookie for authorization at the introduction point.
  468. (5) An introduction point could try to replay a correct INTRODUCE1 cell
  469. to other introduction points of the same service, e.g. in order to force
  470. the service to create a huge number of useless circuits: This attack is
  471. not possible by design, because INTRODUCE1 cells are encrypted using a
  472. freshly created introduction key that is only known to authorized
  473. clients.
  474. (6) An introduction point could attempt to replay a correct INTRODUCE2
  475. cell to the hidden service, e.g. for the same reason as in the last
  476. attack: This attack is very limited by the fact that a server will only
  477. accept 3 INTRODUCE2 cells containing the same rendezvous cookie and drop
  478. all further replayed cells.
  479. (7) An introduction point could block client requests by sending either
  480. positive or negative INTRODUCE_ACK cells back to the client, but without
  481. forwarding INTRODUCE2 cells to the server: This attack is an annoyance
  482. for clients, because they might wait for a timeout to elapse until trying
  483. another introduction point. However, this attack is not introduced by
  484. performing authorization and it cannot be targeted towards a specific
  485. client. A countermeasure might be for the server to periodically perform
  486. introduction requests to his own service to see if introduction points
  487. are working correctly.
  488. (8) The rendezvous point could attempt to identify either server or
  489. client: This remains impossible as it was before, because the
  490. rendezvous cookie does not contain any identifiable information.
  491. (9) An authenticated client could swamp the server with valid INTRODUCE1
  492. and INTRODUCE2 cells, e.g. in order to force the service to create
  493. useless circuits to rendezvous points; as opposed to an introduction
  494. point replaying the same INTRODUCE2 cell, a client could include a new
  495. rendezvous cookie for every request: The countermeasure for this attack
  496. is the restriction to 10 connection establishments per client and hour.
  497. Compatibility:
  498. An implementation of this proposal would require changes to hidden
  499. servers and clients to process authorization data and encode and
  500. understand the new formats. However, both servers and clients would
  501. remain compatible to regular hidden services without authorization.
  502. Implementation:
  503. The implementation of this proposal can be divided into a number of
  504. changes to hidden service and client side. There are no
  505. changes necessary on directory, introduction, or rendezvous nodes. All
  506. changes are marked with either [service] or [client] do denote on which
  507. side they need to be made.
  508. /1/ Configure client authorization [service]
  509. - Parse configuration option HiddenServiceAuthorizeClient containing
  510. authorized client names.
  511. - Load previously created client keys and descriptor cookies.
  512. - Generate missing client keys and descriptor cookies, add them to
  513. client_keys file.
  514. - Rewrite the hostname file.
  515. - Keep client keys and descriptor cookies of authorized clients in
  516. memory.
  517. [- In case of reconfiguration, mark which client authorizations were
  518. added and whether any were removed. This can be used later when
  519. deciding whether to rebuild introduction points and publish new
  520. hidden service descriptors. Not implemented yet.]
  521. /2/ Publish hidden service descriptors [service]
  522. - Create and upload hidden service descriptors for all authorized
  523. clients.
  524. [- See /1/ for the case of reconfiguration.]
  525. /3/ Configure permission for hidden services [client]
  526. - Parse configuration option HidServAuth containing service
  527. authorization, store authorization data in memory.
  528. /5/ Fetch hidden service descriptors [client]
  529. - Look up client authorization upon receiving a hidden service request.
  530. - Request hidden service descriptor ID including client key and
  531. descriptor cookie. Only request v2 descriptors, no v0.
  532. /6/ Process hidden service descriptor [client]
  533. - Decrypt introduction points with descriptor cookie.
  534. /7/ Create introduction request [client]
  535. - Include descriptor cookie in INTRODUCE2 cell to introduction point.
  536. - Pass descriptor cookie around between involved connections and
  537. circuits.
  538. /8/ Process introduction request [service]
  539. - Read descriptor cookie from INTRODUCE2 cell.
  540. - Check whether descriptor cookie is authorized for access, including
  541. checking access counters.
  542. - Log access for accountability.