2007-09-26 16:52:10 +02:00
|
|
|
|
Filename: 121-hidden-service-authentication.txt
|
|
|
|
|
Title: Hidden Service Authentication
|
|
|
|
|
Author: Tobias Kamm, Thomas Lauterbach, Karsten Loesing, Ferdinand Rieger,
|
|
|
|
|
Christoph Weingarten
|
|
|
|
|
Created: 10-Sep-2007
|
2008-12-09 17:59:33 +01:00
|
|
|
|
Status: Finished
|
|
|
|
|
Implemented-In: 0.2.1.x
|
2007-09-26 16:52:10 +02:00
|
|
|
|
|
|
|
|
|
Change history:
|
|
|
|
|
|
|
|
|
|
26-Sep-2007 Initial proposal for or-dev
|
2007-12-09 01:18:51 +01:00
|
|
|
|
08-Dec-2007 Incorporated comments by Nick posted to or-dev on 10-Oct-2007
|
2007-12-15 21:09:43 +01:00
|
|
|
|
15-Dec-2007 Rewrote complete proposal for better readability, modified
|
|
|
|
|
authentication protocol, merged in personal notes
|
2007-12-25 12:34:29 +01:00
|
|
|
|
24-Dec-2007 Replaced misleading term "authentication" by "authorization"
|
|
|
|
|
and added some clarifications (comments by Sven Kaffille)
|
2008-04-28 23:50:30 +02:00
|
|
|
|
28-Apr-2008 Updated most parts of the concrete authorization protocol
|
2008-07-04 17:39:21 +02:00
|
|
|
|
04-Jul-2008 Add a simple algorithm to delay descriptor publication for
|
|
|
|
|
different clients of a hidden service
|
2008-07-19 15:51:34 +02:00
|
|
|
|
19-Jul-2008 Added INTRODUCE1V cell type (1.2), improved replay
|
|
|
|
|
protection for INTRODUCE2 cells (1.3), described limitations
|
|
|
|
|
for auth protocols (1.6), improved hidden service protocol
|
|
|
|
|
without client authorization (2.1), added second, more
|
|
|
|
|
scalable authorization protocol (2.2), rewrote existing
|
|
|
|
|
authorization protocol (2.3); changes based on discussion
|
|
|
|
|
with Nick
|
2008-07-31 15:27:14 +02:00
|
|
|
|
31-Jul-2008 Limit maximum descriptor size to 20 kilobytes to prevent
|
|
|
|
|
abuse.
|
2008-08-01 13:19:43 +02:00
|
|
|
|
01-Aug-2008 Use first part of Diffie-Hellman handshake for replay
|
|
|
|
|
protection instead of rendezvous cookie.
|
2008-08-01 13:35:25 +02:00
|
|
|
|
01-Aug-2008 Remove improved hidden service protocol without client
|
|
|
|
|
authorization (2.1). It might get implemented in proposal
|
|
|
|
|
142.
|
2007-09-26 16:52:10 +02:00
|
|
|
|
|
|
|
|
|
Overview:
|
|
|
|
|
|
2007-12-15 21:09:43 +01:00
|
|
|
|
This proposal deals with a general infrastructure for performing
|
2007-12-25 12:34:29 +01:00
|
|
|
|
authorization (not necessarily implying authentication) of requests to
|
|
|
|
|
hidden services at three points: (1) when downloading and decrypting
|
|
|
|
|
parts of the hidden service descriptor, (2) at the introduction point,
|
2008-04-28 23:50:30 +02:00
|
|
|
|
and (3) at Bob's Tor client before contacting the rendezvous point. A
|
2007-12-25 12:34:29 +01:00
|
|
|
|
service provider will be able to restrict access to his service at these
|
2008-07-19 15:51:34 +02:00
|
|
|
|
three points to authorized clients only. Further, the proposal contains
|
|
|
|
|
specific authorization protocols as instances that implement the
|
|
|
|
|
presented authorization infrastructure.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
This proposal is based on v2 hidden service descriptors as described in
|
|
|
|
|
proposal 114 and introduced in version 0.2.0.10-alpha.
|
|
|
|
|
|
|
|
|
|
The proposal is structured as follows: The next section motivates the
|
2007-12-25 12:34:29 +01:00
|
|
|
|
integration of authorization mechanisms in the hidden service protocol.
|
|
|
|
|
Then we describe a general infrastructure for authorization in hidden
|
2008-07-19 15:51:34 +02:00
|
|
|
|
services, followed by specific authorization protocols for this
|
2007-12-15 21:09:43 +01:00
|
|
|
|
infrastructure. At the end we discuss a number of attacks and non-attacks
|
|
|
|
|
as well as compatibility issues.
|
2007-09-26 16:52:10 +02:00
|
|
|
|
|
|
|
|
|
Motivation:
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
The major part of hidden services does not require client authorization
|
2007-12-15 21:09:43 +01:00
|
|
|
|
now and won't do so in the future. To the contrary, many clients would
|
2008-02-21 10:01:32 +01:00
|
|
|
|
not want to be (pseudonymously) identifiable by the service (though this
|
|
|
|
|
is unavoidable to some extent), but rather use the service
|
2007-12-25 12:34:29 +01:00
|
|
|
|
anonymously. These services are not addressed by this proposal.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
However, there may be certain services which are intended to be accessed
|
|
|
|
|
by a limited set of clients only. A possible application might be a
|
|
|
|
|
wiki or forum that should only be accessible for a closed user group.
|
|
|
|
|
Another, less intuitive example might be a real-time communication
|
|
|
|
|
service, where someone provides a presence and messaging service only to
|
|
|
|
|
his buddies. Finally, a possible application would be a personal home
|
|
|
|
|
server that should be remotely accessed by its owner.
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
Performing authorization for a hidden service within the Tor network, as
|
2007-12-15 21:09:43 +01:00
|
|
|
|
proposed here, offers a range of advantages compared to allowing all
|
2007-12-25 12:34:29 +01:00
|
|
|
|
client connections in the first instance and deferring authorization to
|
|
|
|
|
the transported protocol:
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
(1) Reduced traffic: Unauthorized requests would be rejected as early as
|
|
|
|
|
possible, thereby reducing the overall traffic in the network generated
|
|
|
|
|
by establishing circuits and sending cells.
|
|
|
|
|
|
|
|
|
|
(2) Better protection of service location: Unauthorized clients could not
|
|
|
|
|
force Bob to create circuits to their rendezvous points, thus preventing
|
2008-09-11 11:23:53 +02:00
|
|
|
|
the attack described by <20>verlier and Syverson in their paper "Locating
|
2007-12-15 21:09:43 +01:00
|
|
|
|
Hidden Servers" even without the need for guards.
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(3) Hiding activity: Apart from performing the actual authorization, a
|
|
|
|
|
service provider could also hide the mere presence of his service from
|
|
|
|
|
unauthorized clients when not providing hidden service descriptors to
|
2008-04-28 23:50:30 +02:00
|
|
|
|
them, rejecting unauthorized requests already at the introduction
|
2007-12-25 12:34:29 +01:00
|
|
|
|
point (ideally without leaking presence information at any of these
|
2008-04-28 23:50:30 +02:00
|
|
|
|
points), or not answering unauthorized introduction requests.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
(4) Better protection of introduction points: When providing hidden
|
|
|
|
|
service descriptors to authorized clients only and encrypting the
|
|
|
|
|
introduction points as described in proposal 114, the introduction points
|
|
|
|
|
would be unknown to unauthorized clients and thereby protected from DoS
|
|
|
|
|
attacks.
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(5) Protocol independence: Authorization could be performed for all
|
|
|
|
|
transported protocols, regardless of their own capabilities to do so.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
(6) Ease of administration: A service provider running multiple hidden
|
|
|
|
|
services would be able to configure access at a single place uniformly
|
|
|
|
|
instead of doing so for all services separately.
|
2007-12-25 12:34:29 +01:00
|
|
|
|
|
2007-12-15 21:09:43 +01:00
|
|
|
|
(7) Optional QoS support: Bob could adapt his node selection algorithm
|
|
|
|
|
for building the circuit to Alice's rendezvous point depending on a
|
|
|
|
|
previously guaranteed QoS level, thus providing better latency or
|
|
|
|
|
bandwidth for selected clients.
|
|
|
|
|
|
2008-02-21 10:01:32 +01:00
|
|
|
|
A disadvantage of performing authorization within the Tor network is
|
|
|
|
|
that a hidden service cannot make use of authorization data in
|
2007-12-25 12:34:29 +01:00
|
|
|
|
the transported protocol. Tor hidden services were designed to be
|
|
|
|
|
independent of the transported protocol. Therefore it's only possible to
|
|
|
|
|
either grant or deny access to the whole service, but not to specific
|
2008-04-28 23:50:30 +02:00
|
|
|
|
resources of the service.
|
2007-12-25 12:34:29 +01:00
|
|
|
|
|
|
|
|
|
Authorization often implies authentication, i.e. proving one's identity.
|
|
|
|
|
However, when performing authorization within the Tor network, untrusted
|
|
|
|
|
points should not gain any useful information about the identities of
|
|
|
|
|
communicating parties, neither server nor client. A crucial challenge is
|
|
|
|
|
to remain anonymous towards directory servers and introduction points.
|
|
|
|
|
However, trying to hide identity from the hidden service is a futile
|
|
|
|
|
task, because a client would never know if he is the only authorized
|
2008-04-28 23:50:30 +02:00
|
|
|
|
client and therefore perfectly identifiable. Therefore, hiding client
|
2008-10-14 22:04:47 +02:00
|
|
|
|
identity from the hidden service is not an aim of this proposal.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
The current implementation of hidden services does not provide any kind
|
2007-12-25 12:34:29 +01:00
|
|
|
|
of authorization. The hidden service descriptor version 2, introduced by
|
2007-12-15 21:09:43 +01:00
|
|
|
|
proposal 114, was designed to use a descriptor cookie for downloading and
|
|
|
|
|
decrypting parts of the descriptor content, but this feature is not yet
|
|
|
|
|
in use. Further, most relevant cell formats specified in rend-spec
|
2007-12-25 12:34:29 +01:00
|
|
|
|
contain fields for authorization data, but those fields are neither
|
2007-12-15 21:09:43 +01:00
|
|
|
|
implemented nor do they suffice entirely.
|
2007-09-26 16:52:10 +02:00
|
|
|
|
|
|
|
|
|
Details:
|
|
|
|
|
|
2008-10-14 22:04:47 +02:00
|
|
|
|
1. General infrastructure for authorization to hidden services
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
We spotted three possible authorization points in the hidden service
|
2007-12-15 21:09:43 +01:00
|
|
|
|
protocol:
|
|
|
|
|
|
|
|
|
|
(1) when downloading and decrypting parts of the hidden service
|
|
|
|
|
descriptor,
|
|
|
|
|
(2) at the introduction point, and
|
2008-04-28 23:50:30 +02:00
|
|
|
|
(3) at Bob's Tor client before contacting the rendezvous point.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
The general idea of this proposal is to allow service providers to
|
2008-04-28 23:50:30 +02:00
|
|
|
|
restrict access to some or all of these points to authorized clients
|
|
|
|
|
only.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2008-02-21 10:01:32 +01:00
|
|
|
|
1.1. Client authorization at directory
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
Since the implementation of proposal 114 it is possible to combine a
|
|
|
|
|
hidden service descriptor with a so-called descriptor cookie. If done so,
|
|
|
|
|
the descriptor cookie becomes part of the descriptor ID, thus having an
|
|
|
|
|
effect on the storage location of the descriptor. Someone who has learned
|
|
|
|
|
about a service, but is not aware of the descriptor cookie, won't be able
|
|
|
|
|
to determine the descriptor ID and download the current hidden service
|
|
|
|
|
descriptor; he won't even know whether the service has uploaded a
|
|
|
|
|
descriptor recently. Descriptor IDs are calculated as follows (see
|
|
|
|
|
section 1.2 of rend-spec for the complete specification of v2 hidden
|
|
|
|
|
service descriptors):
|
|
|
|
|
|
|
|
|
|
descriptor-id =
|
2008-04-28 23:50:30 +02:00
|
|
|
|
H(service-id | H(time-period | descriptor-cookie | replica))
|
|
|
|
|
|
|
|
|
|
Currently, service-id is equivalent to permanent-id which is calculated
|
|
|
|
|
as in the following formula. But in principle it could be any public
|
|
|
|
|
key.
|
|
|
|
|
|
|
|
|
|
permanent-id = H(permanent-key)[:10]
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
The second purpose of the descriptor cookie is to encrypt the list of
|
2007-12-25 12:34:29 +01:00
|
|
|
|
introduction points, including optional authorization data. Hence, the
|
2007-12-15 21:09:43 +01:00
|
|
|
|
hidden service directories won't learn any introduction information from
|
|
|
|
|
storing a hidden service descriptor. This feature is implemented but
|
2008-10-14 22:04:47 +02:00
|
|
|
|
unused at the moment. So this proposal will harness the advantages
|
2007-12-15 21:09:43 +01:00
|
|
|
|
of proposal 114.
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
The descriptor cookie can be used for authorization by keeping it secret
|
2007-12-15 21:09:43 +01:00
|
|
|
|
from everyone but authorized clients. A service could then decide whether
|
|
|
|
|
to publish hidden service descriptors using that descriptor cookie later
|
|
|
|
|
on. An authorized client being aware of the descriptor cookie would be
|
|
|
|
|
able to download and decrypt the hidden service descriptor.
|
2007-12-25 12:34:29 +01:00
|
|
|
|
|
2007-12-15 21:09:43 +01:00
|
|
|
|
The number of concurrently used descriptor cookies for one hidden service
|
|
|
|
|
is not restricted. A service could use a single descriptor cookie for all
|
|
|
|
|
users, a distinct cookie per user, or something in between, like one
|
|
|
|
|
cookie per group of users. It is up to the specific protocol and how it
|
2008-04-28 23:50:30 +02:00
|
|
|
|
is applied by a service provider.
|
2007-12-25 12:34:29 +01:00
|
|
|
|
|
2008-07-04 17:39:21 +02:00
|
|
|
|
Two or more hidden service descriptors for different groups or users
|
|
|
|
|
should not be uploaded at the same time. A directory node could conclude
|
2008-10-14 22:04:47 +02:00
|
|
|
|
easily that the descriptors were issued by the same hidden service, thus
|
2008-07-04 17:39:21 +02:00
|
|
|
|
being able to link the two groups or users. Therefore, descriptors for
|
|
|
|
|
different users or clients that ought to be stored on the same directory
|
|
|
|
|
are delayed, so that only one descriptor is uploaded to a directory at a
|
2008-10-14 22:04:47 +02:00
|
|
|
|
time. The remaining descriptors are uploaded with a delay of up to
|
|
|
|
|
30 seconds.
|
2008-07-04 17:39:21 +02:00
|
|
|
|
Further, descriptors for different groups or users that are to be stored
|
|
|
|
|
on different directories are delayed for a random time of up to 30
|
|
|
|
|
seconds to hide relations from colluding directories. Certainly, this
|
|
|
|
|
does not prevent linking entirely, but it makes it somewhat harder.
|
|
|
|
|
There is a conflict between hiding links between clients and making a
|
|
|
|
|
service available in a timely manner.
|
|
|
|
|
|
2007-12-15 21:09:43 +01:00
|
|
|
|
Although this part of the proposal is meant to describe a general
|
2007-12-25 12:34:29 +01:00
|
|
|
|
infrastructure for authorization, changing the way of using the
|
2007-12-15 21:09:43 +01:00
|
|
|
|
descriptor cookie to look up hidden service descriptors, e.g. applying
|
|
|
|
|
some sort of asymmetric crypto system, would require in-depth changes
|
|
|
|
|
that would be incompatible to v2 hidden service descriptors. On the
|
|
|
|
|
contrary, using another key for en-/decrypting the introduction point
|
|
|
|
|
part of a hidden service descriptor, e.g. a different symmetric key or
|
|
|
|
|
asymmetric encryption, would be easy to implement and compatible to v2
|
|
|
|
|
hidden service descriptors as understood by hidden service directories
|
2008-10-14 22:04:47 +02:00
|
|
|
|
(clients and services would have to be upgraded anyway for using the new
|
2007-12-15 21:09:43 +01:00
|
|
|
|
features).
|
|
|
|
|
|
2008-07-31 15:27:14 +02:00
|
|
|
|
An adversary could try to abuse the fact that introduction points can be
|
|
|
|
|
encrypted by storing arbitrary, unrelated data in the hidden service
|
|
|
|
|
directory. This abuse can be limited by setting a hard descriptor size
|
|
|
|
|
limit, forcing the adversary to split data into multiple chunks. There
|
|
|
|
|
are some limitations that make splitting data across multiple descriptors
|
|
|
|
|
unattractive: 1) The adversary would not be able to choose descriptor IDs
|
2008-10-14 22:04:47 +02:00
|
|
|
|
freely and would therefore have to implement his own indexing
|
|
|
|
|
structure. 2) Validity of descriptors is limited to at most 24 hours
|
|
|
|
|
after which descriptors need to be republished.
|
2008-07-31 15:27:14 +02:00
|
|
|
|
|
|
|
|
|
The regular descriptor size in bytes is 745 + num_ipos * 837 + auth_data.
|
|
|
|
|
A large descriptor with 7 introduction points and 5 kilobytes of
|
|
|
|
|
authorization data would be 11724 bytes in size. The upper size limit of
|
|
|
|
|
descriptors should be set to 20 kilobytes, which limits the effect of
|
|
|
|
|
abuse while retaining enough flexibility in designing authorization
|
|
|
|
|
protocols.
|
|
|
|
|
|
2008-02-21 10:01:32 +01:00
|
|
|
|
1.2. Client authorization at introduction point
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
The next possible authorization point after downloading and decrypting
|
2008-04-28 23:50:30 +02:00
|
|
|
|
a hidden service descriptor is the introduction point. It may be important
|
2007-12-25 12:34:29 +01:00
|
|
|
|
for authorization, because it bears the last chance of hiding presence
|
2007-12-15 21:09:43 +01:00
|
|
|
|
of a hidden service from unauthorized clients. Further, performing
|
2007-12-25 12:34:29 +01:00
|
|
|
|
authorization at the introduction point might reduce traffic in the
|
2007-12-15 21:09:43 +01:00
|
|
|
|
network, because unauthorized requests would not be passed to the
|
|
|
|
|
hidden service. This applies to those clients who are aware of a
|
|
|
|
|
descriptor cookie and thereby of the hidden service descriptor, but do
|
2007-12-25 12:34:29 +01:00
|
|
|
|
not have authorization data to pass the introduction point or access the
|
|
|
|
|
service (such a situation might occur when authorization data for
|
2008-10-14 22:04:47 +02:00
|
|
|
|
authorization at the directory is not issued on a per-user basis, but
|
|
|
|
|
authorization data for authorization at the introduction point is).
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
It is important to note that the introduction point must be considered
|
2007-12-25 12:34:29 +01:00
|
|
|
|
untrustworthy, and therefore cannot replace authorization at the hidden
|
2007-12-15 21:09:43 +01:00
|
|
|
|
service itself. Nor should the introduction point learn any sensitive
|
2008-10-14 22:04:47 +02:00
|
|
|
|
identifiable information from either the service or the client.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
In order to perform authorization at the introduction point, three
|
2007-12-15 21:09:43 +01:00
|
|
|
|
message formats need to be modified: (1) v2 hidden service descriptors,
|
|
|
|
|
(2) ESTABLISH_INTRO cells, and (3) INTRODUCE1 cells.
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
A v2 hidden service descriptor needs to contain authorization data that
|
|
|
|
|
is introduction-point-specific and sometimes also authorization data
|
2007-12-15 21:09:43 +01:00
|
|
|
|
that is introduction-point-independent. Therefore, v2 hidden service
|
|
|
|
|
descriptors as specified in section 1.2 of rend-spec already contain two
|
2007-12-25 12:34:29 +01:00
|
|
|
|
reserved fields "intro-authorization" and "service-authorization"
|
|
|
|
|
(originally, the names of these fields were "...-authentication")
|
|
|
|
|
containing an authorization type number and arbitrary authorization
|
|
|
|
|
data. We propose that authorization data consists of base64 encoded
|
2007-12-15 21:09:43 +01:00
|
|
|
|
objects of arbitrary length, surrounded by "-----BEGIN MESSAGE-----" and
|
|
|
|
|
"-----END MESSAGE-----". This will increase the size of hidden service
|
2008-10-14 22:04:47 +02:00
|
|
|
|
descriptors, but this is allowed since there is no strict upper limit.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
The current ESTABLISH_INTRO cells as described in section 1.3 of
|
2008-04-28 23:50:30 +02:00
|
|
|
|
rend-spec do not contain either authorization data or version
|
2007-12-15 21:09:43 +01:00
|
|
|
|
information. Therefore, we propose a new version 1 of the ESTABLISH_INTRO
|
|
|
|
|
cells adding these two issues as follows:
|
|
|
|
|
|
|
|
|
|
V Format byte: set to 255 [1 octet]
|
|
|
|
|
V Version byte: set to 1 [1 octet]
|
|
|
|
|
KL Key length [2 octets]
|
|
|
|
|
PK Bob's public key [KL octets]
|
|
|
|
|
HS Hash of session info [20 octets]
|
|
|
|
|
AUTHT The auth type that is supported [1 octet]
|
|
|
|
|
AUTHL Length of auth data [2 octets]
|
|
|
|
|
AUTHD Auth data [variable]
|
|
|
|
|
SIG Signature of above information [variable]
|
|
|
|
|
|
|
|
|
|
From the format it is possible to determine the maximum allowed size for
|
2007-12-25 12:34:29 +01:00
|
|
|
|
authorization data: given the fact that cells are 512 octets long, of
|
2007-12-15 21:09:43 +01:00
|
|
|
|
which 498 octets are usable (see section 6.1 of tor-spec), and assuming
|
|
|
|
|
1024 bit = 128 octet long keys, there are 215 octets left for
|
2007-12-25 12:34:29 +01:00
|
|
|
|
authorization data. Hence, authorization protocols are bound to use no
|
2007-12-15 21:09:43 +01:00
|
|
|
|
more than these 215 octets, regardless of the number of clients that
|
|
|
|
|
shall be authenticated at the introduction point. Otherwise, one would
|
2008-10-14 22:04:47 +02:00
|
|
|
|
need to send multiple ESTABLISH_INTRO cells or split them up, which we do
|
2007-12-15 21:09:43 +01:00
|
|
|
|
not specify here.
|
|
|
|
|
|
|
|
|
|
In order to understand a v1 ESTABLISH_INTRO cell, the implementation of
|
2008-07-19 15:51:34 +02:00
|
|
|
|
a relay must have a certain Tor version. Hidden services need to be able
|
|
|
|
|
to distinguish relays being capable of understanding the new v1 cell
|
|
|
|
|
formats and perform authorization. We propose to use the version number
|
|
|
|
|
that is contained in networkstatus documents to find capable
|
|
|
|
|
introduction points.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2008-10-14 22:04:47 +02:00
|
|
|
|
The current INTRODUCE1 cell as described in section 1.8 of rend-spec is
|
2007-12-25 12:34:29 +01:00
|
|
|
|
not designed to carry authorization data and has no version number, too.
|
2008-07-19 15:51:34 +02:00
|
|
|
|
Unfortunately, unversioned INTRODUCE1 cells consist only of a fixed-size,
|
|
|
|
|
seemingly random PK_ID, followed by the encrypted INTRODUCE2 cell. This
|
|
|
|
|
makes it impossible to distinguish unversioned INTRODUCE1 cells from any
|
|
|
|
|
later format. In particular, it is not possible to introduce some kind of
|
|
|
|
|
format and version byte for newer versions of this cell. That's probably
|
|
|
|
|
where the comment "[XXX011 want to put intro-level auth info here, but no
|
|
|
|
|
version. crap. -RD]" that was part of rend-spec some time ago comes from.
|
|
|
|
|
|
|
|
|
|
We propose that new versioned INTRODUCE1 cells use the new cell type 41
|
|
|
|
|
RELAY_INTRODUCE1V (where V stands for versioned):
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
Cleartext
|
|
|
|
|
V Version byte: set to 1 [1 octet]
|
|
|
|
|
PK_ID Identifier for Bob's PK [20 octets]
|
2008-10-14 22:04:47 +02:00
|
|
|
|
AUTHT The auth type that is included [1 octet]
|
2007-12-15 21:09:43 +01:00
|
|
|
|
AUTHL Length of auth data [2 octets]
|
|
|
|
|
AUTHD Auth data [variable]
|
|
|
|
|
Encrypted to Bob's PK:
|
|
|
|
|
(RELAY_INTRODUCE2 cell)
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
The maximum length of contained authorization data depends on the length
|
2007-12-15 21:09:43 +01:00
|
|
|
|
of the contained INTRODUCE2 cell. A calculation follows below when
|
|
|
|
|
describing the INTRODUCE2 cell format we propose to use.
|
|
|
|
|
|
2008-02-21 10:01:32 +01:00
|
|
|
|
1.3. Client authorization at hidden service
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
The time when a hidden service receives an INTRODUCE2 cell constitutes
|
2007-12-25 12:34:29 +01:00
|
|
|
|
the last possible authorization point during the hidden service
|
|
|
|
|
protocol. Performing authorization here is easier than at the other two
|
|
|
|
|
authorization points, because there are no possibly untrusted entities
|
2007-12-15 21:09:43 +01:00
|
|
|
|
involved.
|
|
|
|
|
|
|
|
|
|
In general, a client that is successfully authorized at the introduction
|
|
|
|
|
point should be granted access at the hidden service, too. Otherwise, the
|
|
|
|
|
client would receive a positive INTRODUCE_ACK cell from the introduction
|
|
|
|
|
point and conclude that it may connect to the service, but the request
|
|
|
|
|
will be dropped without notice. This would appear as a failure to
|
|
|
|
|
clients. Therefore, the number of cases in which a client successfully
|
2008-10-14 22:04:47 +02:00
|
|
|
|
passes the introduction point but fails at the hidden service should be
|
|
|
|
|
zero. However, this does not lead to the conclusion that the
|
2007-12-25 12:34:29 +01:00
|
|
|
|
authorization data used at the introduction point and the hidden service
|
|
|
|
|
must be the same, but only that both authorization data should lead to
|
|
|
|
|
the same authorization result.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
Authorization data is transmitted from client to server via an
|
2007-12-15 21:09:43 +01:00
|
|
|
|
INTRODUCE2 cell that is forwarded by the introduction point. There are
|
|
|
|
|
versions 0 to 2 specified in section 1.8 of rend-spec, but none of these
|
2008-10-14 22:04:47 +02:00
|
|
|
|
contain fields for carrying authorization data. We propose a slightly
|
2007-12-15 21:09:43 +01:00
|
|
|
|
modified version of v3 INTRODUCE2 cells that is specified in section
|
2008-04-28 23:50:30 +02:00
|
|
|
|
1.8.1 and which is not implemented as of December 2007. In contrast to
|
|
|
|
|
the specified v3 we avoid specifying (and implementing) IPv6 capabilities,
|
|
|
|
|
because Tor relays will be required to support IPv4 addresses for a long
|
|
|
|
|
time in the future, so that this seems unnecessary at the moment. The
|
|
|
|
|
proposed format of v3 INTRODUCE2 cells is as follows:
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
VER Version byte: set to 3. [1 octet]
|
2008-07-19 15:51:34 +02:00
|
|
|
|
AUTHT The auth type that is used [1 octet]
|
2007-12-15 21:09:43 +01:00
|
|
|
|
AUTHL Length of auth data [2 octets]
|
|
|
|
|
AUTHD Auth data [variable]
|
2008-07-19 15:51:34 +02:00
|
|
|
|
TS Timestamp (seconds since 1-1-1970) [4 octets]
|
2008-04-28 23:50:30 +02:00
|
|
|
|
IP Rendezvous point's address [4 octets]
|
|
|
|
|
PORT Rendezvous point's OR port [2 octets]
|
2007-12-15 21:09:43 +01:00
|
|
|
|
ID Rendezvous point identity ID [20 octets]
|
|
|
|
|
KLEN Length of onion key [2 octets]
|
|
|
|
|
KEY Rendezvous point onion key [KLEN octets]
|
|
|
|
|
RC Rendezvous cookie [20 octets]
|
|
|
|
|
g^x Diffie-Hellman data, part 1 [128 octets]
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
The maximum possible length of authorization data is related to the
|
2008-07-19 15:51:34 +02:00
|
|
|
|
enclosing INTRODUCE1V cell. A v3 INTRODUCE2 cell with
|
2008-10-14 22:04:47 +02:00
|
|
|
|
1024 bit = 128 octets long public key without any authorization data
|
2008-04-28 23:50:30 +02:00
|
|
|
|
occupies 306 octets (AUTHL is only used when AUTHT has a value != 0),
|
|
|
|
|
plus 58 octets for hybrid public key encryption (see
|
2007-12-15 21:09:43 +01:00
|
|
|
|
section 5.1 of tor-spec on hybrid encryption of CREATE cells). The
|
2008-07-19 15:51:34 +02:00
|
|
|
|
surrounding INTRODUCE1V cell requires 24 octets. This leaves only 110
|
2007-12-15 21:09:43 +01:00
|
|
|
|
of the 498 available octets free, which must be shared between
|
2007-12-25 12:34:29 +01:00
|
|
|
|
authorization data to the introduction point _and_ to the hidden
|
2007-12-15 21:09:43 +01:00
|
|
|
|
service.
|
|
|
|
|
|
|
|
|
|
When receiving a v3 INTRODUCE2 cell, Bob checks whether a client has
|
2008-07-19 15:51:34 +02:00
|
|
|
|
provided valid authorization data to him. He also requires that the
|
|
|
|
|
timestamp is no more than 30 minutes in the past or future and that the
|
2008-08-01 13:19:43 +02:00
|
|
|
|
first part of the Diffie-Hellman handshake has not been used in the past
|
|
|
|
|
60 minutes to prevent replay attacks by rogue introduction points. (The
|
|
|
|
|
reason for not using the rendezvous cookie to detect replays---even
|
|
|
|
|
though it is only sent once in the current design---is that it might be
|
|
|
|
|
desirable to re-use rendezvous cookies for multiple introduction requests
|
|
|
|
|
in the future.) If all checks pass, Bob builds a circuit to the provided
|
2008-10-14 22:04:47 +02:00
|
|
|
|
rendezvous point. Otherwise he drops the cell.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2008-02-21 10:01:32 +01:00
|
|
|
|
1.4. Summary of authorization data fields
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
In summary, the proposed descriptor format and cell formats provide the
|
2007-12-25 12:34:29 +01:00
|
|
|
|
following fields for carrying authorization data:
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
(1) The v2 hidden service descriptor contains:
|
|
|
|
|
- a descriptor cookie that is used for the lookup process, and
|
2007-12-25 12:34:29 +01:00
|
|
|
|
- an arbitrary encryption schema to ensure authorization to access
|
|
|
|
|
introduction information (currently symmetric encryption with the
|
|
|
|
|
descriptor cookie).
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(2) For performing authorization at the introduction point we can use:
|
|
|
|
|
- the fields intro-authorization and service-authorization in
|
2007-12-15 21:09:43 +01:00
|
|
|
|
hidden service descriptors,
|
|
|
|
|
- a maximum of 215 octets in the ESTABLISH_INTRO cell, and
|
2008-07-19 15:51:34 +02:00
|
|
|
|
- one part of 110 octets in the INTRODUCE1V cell.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(3) For performing authorization at the hidden service we can use:
|
|
|
|
|
- the fields intro-authorization and service-authorization in
|
2007-12-15 21:09:43 +01:00
|
|
|
|
hidden service descriptors,
|
2008-04-28 23:50:30 +02:00
|
|
|
|
- the other part of 110 octets in the INTRODUCE2 cell.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
It will also still be possible to access a hidden service without any
|
2007-12-25 12:34:29 +01:00
|
|
|
|
authorization or only use a part of the authorization infrastructure.
|
|
|
|
|
However, this requires to consider all parts of the infrastructure. For
|
|
|
|
|
example, authorization at the introduction point relying on confidential
|
|
|
|
|
intro-authorization data transported in the hidden service descriptor
|
|
|
|
|
cannot be performed without using an encryption schema for introduction
|
|
|
|
|
information.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2008-02-21 10:01:32 +01:00
|
|
|
|
1.5. Managing authorization data at servers and clients
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2008-10-14 22:04:47 +02:00
|
|
|
|
In order to provide authorization data at the hidden service and the
|
|
|
|
|
authenticated clients, we propose to use files---either the Tor
|
2008-04-28 23:50:30 +02:00
|
|
|
|
configuration file or separate files. The exact format of these special
|
|
|
|
|
files depends on the authorization protocol used.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
|
|
|
|
Currently, rend-spec contains the proposition to encode client-side
|
2007-12-25 12:34:29 +01:00
|
|
|
|
authorization data in the URL, like in x.y.z.onion. This was never used
|
2007-12-15 21:09:43 +01:00
|
|
|
|
and is also a bad idea, because in case of HTTP the requested URL may be
|
|
|
|
|
contained in the Host and Referer fields.
|
|
|
|
|
|
2008-07-19 15:51:34 +02:00
|
|
|
|
1.6. Limitations for authorization protocols
|
|
|
|
|
|
|
|
|
|
There are two limitations of the current hidden service protocol for
|
|
|
|
|
authorization protocols that shall be identified here.
|
|
|
|
|
|
|
|
|
|
1. The three cell types ESTABLISH_INTRO, INTRODUCE1V, and INTRODUCE2
|
|
|
|
|
restricts the amount of data that can be used for authorization.
|
|
|
|
|
This forces authorization protocols that require per-user
|
|
|
|
|
authorization data at the introduction point to restrict the number
|
2008-10-14 22:04:47 +02:00
|
|
|
|
of authorized clients artificially. A possible solution could be to
|
2008-07-19 15:51:34 +02:00
|
|
|
|
split contents among multiple cells and reassemble them at the
|
|
|
|
|
introduction points.
|
|
|
|
|
|
|
|
|
|
2. The current hidden service protocol does not specify cell types to
|
|
|
|
|
perform interactive authorization between client and introduction
|
|
|
|
|
point or hidden service. If there should be an authorization
|
|
|
|
|
protocol that requires interaction, new cell types would have to be
|
|
|
|
|
defined and integrated into the hidden service protocol.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2. Specific authorization protocol instances
|
|
|
|
|
|
2008-08-01 13:35:25 +02:00
|
|
|
|
In the following we present two specific authorization protocols that
|
2008-07-19 15:51:34 +02:00
|
|
|
|
make use of (parts of) the new authorization infrastructure:
|
|
|
|
|
|
2008-08-01 13:35:25 +02:00
|
|
|
|
1. The first protocol allows a service provider to restrict access
|
2008-07-19 15:51:34 +02:00
|
|
|
|
to clients with a previously received secret key only, but does not
|
|
|
|
|
attempt to hide service activity from others.
|
|
|
|
|
|
2008-08-01 13:35:25 +02:00
|
|
|
|
2. The second protocol, albeit being feasible for a limited set of about
|
2008-07-19 15:51:34 +02:00
|
|
|
|
16 clients, performs client authorization and hides service activity
|
|
|
|
|
from everyone but the authorized clients.
|
|
|
|
|
|
2008-08-04 17:55:20 +02:00
|
|
|
|
These two protocol instances extend the existing hidden service protocol
|
|
|
|
|
version 2. Hidden services that perform client authorization may run in
|
|
|
|
|
parallel to other services running versions 0, 2, or both.
|
2008-08-01 13:35:25 +02:00
|
|
|
|
|
|
|
|
|
2.1. Service with large-scale client authorization
|
2008-07-19 15:51:34 +02:00
|
|
|
|
|
|
|
|
|
The first client authorization protocol aims at performing access control
|
2008-08-04 17:55:20 +02:00
|
|
|
|
while consuming as few additional resources as possible. A service
|
2008-07-19 15:51:34 +02:00
|
|
|
|
provider should be able to permit access to a large number of clients
|
|
|
|
|
while denying access for everyone else. However, the price for
|
|
|
|
|
scalability is that the service won't be able to hide its activity from
|
|
|
|
|
unauthorized or formerly authorized clients.
|
|
|
|
|
|
|
|
|
|
The main idea of this protocol is to encrypt the introduction-point part
|
|
|
|
|
in hidden service descriptors to authorized clients using symmetric keys.
|
|
|
|
|
This ensures that nobody else but authorized clients can learn which
|
|
|
|
|
introduction points a service currently uses, nor can someone send a
|
|
|
|
|
valid INTRODUCE1 message without knowing the introduction key. Therefore,
|
|
|
|
|
a subsequent authorization at the introduction point is not required.
|
|
|
|
|
|
|
|
|
|
A service provider generates symmetric "descriptor cookies" for his
|
|
|
|
|
clients and distributes them outside of Tor. The suggested key size is
|
|
|
|
|
128 bits, so that descriptor cookies can be encoded in 22 base64 chars
|
|
|
|
|
(which can hold up to 22 * 5 = 132 bits, leaving 4 bits to encode the
|
2008-08-04 14:44:14 +02:00
|
|
|
|
authorization type (here: "0") and allow a client to distinguish this
|
2008-07-19 15:51:34 +02:00
|
|
|
|
authorization protocol from others like the one proposed below).
|
|
|
|
|
Typically, the contact information for a hidden service using this
|
|
|
|
|
authorization protocol looks like this:
|
|
|
|
|
|
|
|
|
|
v2cbb2l4lsnpio4q.onion Ll3X7Xgz9eHGKCCnlFH0uz
|
|
|
|
|
|
|
|
|
|
When generating a hidden service descriptor, the service encrypts the
|
|
|
|
|
introduction-point part with a single randomly generated symmetric
|
|
|
|
|
128-bit session key using AES-CTR as described for v2 hidden service
|
|
|
|
|
descriptors in rend-spec. Afterwards, the service encrypts the session
|
2008-08-04 17:55:20 +02:00
|
|
|
|
key to all descriptor cookies using AES. Authorized client should be able
|
|
|
|
|
to efficiently find the session key that is encrypted for him/her, so
|
|
|
|
|
that 4 octet long client ID are generated consisting of descriptor cookie
|
2008-10-14 22:04:47 +02:00
|
|
|
|
and initialization vector. Descriptors always contain a number of
|
2008-08-04 17:55:20 +02:00
|
|
|
|
encrypted session keys that is a multiple of 16 by adding fake entries.
|
|
|
|
|
Encrypted session keys are ordered by client IDs in order to conceal
|
|
|
|
|
addition or removal of authorized clients by the service provider.
|
|
|
|
|
|
|
|
|
|
ATYPE Authorization type: set to 1. [1 octet]
|
|
|
|
|
ALEN Number of clients := 1 + ((clients - 1) div 16) [1 octet]
|
|
|
|
|
for each symmetric descriptor cookie:
|
|
|
|
|
ID Client ID: H(descriptor cookie | IV)[:4] [4 octets]
|
|
|
|
|
SKEY Session key encrypted with descriptor cookie [16 octets]
|
|
|
|
|
(end of client-specific part)
|
|
|
|
|
RND Random data [(15 - ((clients - 1) mod 16)) * 20 octets]
|
|
|
|
|
IV AES initialization vector [16 octets]
|
|
|
|
|
IPOS Intro points, encrypted with session key [remaining octets]
|
2008-07-19 15:51:34 +02:00
|
|
|
|
|
|
|
|
|
An authorized client needs to configure Tor to use the descriptor cookie
|
|
|
|
|
when accessing the hidden service. Therefore, a user adds the contact
|
|
|
|
|
information that she received from the service provider to her torrc
|
|
|
|
|
file. Upon downloading a hidden service descriptor, Tor finds the
|
|
|
|
|
encrypted introduction-point part and attempts to decrypt it using the
|
|
|
|
|
configured descriptor cookie. (In the rare event of two or more client
|
|
|
|
|
IDs being equal a client tries to decrypt all of them.)
|
|
|
|
|
|
|
|
|
|
Upon sending the introduction, the client includes her descriptor cookie
|
2008-08-01 13:35:25 +02:00
|
|
|
|
as auth type "1" in the INTRODUCE2 cell that she sends to the service.
|
2008-07-19 15:51:34 +02:00
|
|
|
|
The hidden service checks whether the included descriptor cookie is
|
|
|
|
|
authorized to access the service and either responds to the introduction
|
|
|
|
|
request, or not.
|
|
|
|
|
|
2008-08-01 13:35:25 +02:00
|
|
|
|
2.2. Authorization for limited number of clients
|
2008-07-19 15:51:34 +02:00
|
|
|
|
|
|
|
|
|
A second, more sophisticated client authorization protocol goes the extra
|
|
|
|
|
mile of hiding service activity from unauthorized clients. With all else
|
|
|
|
|
being equal to the preceding authorization protocol, the second protocol
|
|
|
|
|
publishes hidden service descriptors for each user separately and gets
|
|
|
|
|
along with encrypting the introduction-point part of descriptors to a
|
|
|
|
|
single client. This allows the service to stop publishing descriptors for
|
|
|
|
|
removed clients. As long as a removed client cannot link descriptors
|
|
|
|
|
issued for other clients to the service, it cannot derive service
|
|
|
|
|
activity any more. The downside of this approach is limited scalability.
|
|
|
|
|
Even though the distributed storage of descriptors (cf. proposal 114)
|
|
|
|
|
tackles the problem of limited scalability to a certain extent, this
|
|
|
|
|
protocol should not be used for services with more than 16 clients. (In
|
|
|
|
|
fact, Tor should refuse to advertise services for more than this number
|
|
|
|
|
of clients.)
|
|
|
|
|
|
|
|
|
|
A hidden service generates an asymmetric "client key" and a symmetric
|
|
|
|
|
"descriptor cookie" for each client. The client key is used as
|
|
|
|
|
replacement for the service's permanent key, so that the service uses a
|
|
|
|
|
different identity for each of his clients. The descriptor cookie is used
|
|
|
|
|
to store descriptors at changing directory nodes that are unpredictable
|
|
|
|
|
for anyone but service and client, to encrypt the introduction-point
|
|
|
|
|
part, and to be included in INTRODUCE2 cells. Once the service has
|
|
|
|
|
created client key and descriptor cookie, he tells them to the client
|
|
|
|
|
outside of Tor. The contact information string looks similar to the one
|
|
|
|
|
used by the preceding authorization protocol (with the only difference
|
2008-08-04 14:44:14 +02:00
|
|
|
|
that it has "1" encoded as auth-type in the remaining 4 of 132 bits
|
|
|
|
|
instead of "0" as before).
|
2008-07-19 15:51:34 +02:00
|
|
|
|
|
|
|
|
|
When creating a hidden service descriptor for an authorized client, the
|
|
|
|
|
hidden service uses the client key and descriptor cookie to compute
|
|
|
|
|
secret ID part and descriptor ID:
|
|
|
|
|
|
|
|
|
|
secret-id-part = H(time-period | descriptor-cookie | replica)
|
|
|
|
|
|
|
|
|
|
descriptor-id = H(client-key[:10] | secret-id-part)
|
|
|
|
|
|
|
|
|
|
The hidden service also replaces permanent-key in the descriptor with
|
|
|
|
|
client-key and encrypts introduction-points with the descriptor cookie.
|
|
|
|
|
|
2008-08-01 13:35:25 +02:00
|
|
|
|
ATYPE Authorization type: set to 2. [1 octet]
|
2008-07-19 15:51:34 +02:00
|
|
|
|
IV AES initialization vector [16 octets]
|
|
|
|
|
IPOS Intro points, encr. with descriptor cookie [remaining octets]
|
|
|
|
|
|
|
|
|
|
When uploading descriptors, the hidden service needs to make sure that
|
|
|
|
|
descriptors for different clients are not uploaded at the same time (cf.
|
|
|
|
|
Section 1.1) which is also a limiting factor for the number of clients.
|
|
|
|
|
|
|
|
|
|
When a client is requested to establish a connection to a hidden service
|
|
|
|
|
it looks up whether it has any authorization data configured for that
|
|
|
|
|
service. If the user has configured authorization data for authorization
|
2008-08-01 13:35:25 +02:00
|
|
|
|
protocol "2", the descriptor ID is determined as described in the last
|
2008-07-19 15:51:34 +02:00
|
|
|
|
paragraph. Upon receiving a descriptor, the client decrypts the
|
|
|
|
|
introduction-point part using its descriptor cookie. Further, the client
|
2008-08-01 13:35:25 +02:00
|
|
|
|
includes its descriptor cookie as auth-type "2" in INTRODUCE2 cells that
|
2008-07-19 15:51:34 +02:00
|
|
|
|
it sends to the service.
|
|
|
|
|
|
2008-08-01 13:35:25 +02:00
|
|
|
|
2.3. Hidden service configuration
|
2008-07-19 15:51:34 +02:00
|
|
|
|
|
2008-08-04 17:55:20 +02:00
|
|
|
|
A hidden service that is meant to perform client authorization adds a
|
|
|
|
|
new option HiddenServiceAuthorizeClient to its hidden service
|
|
|
|
|
configuration. This option contains the authorization type which is
|
|
|
|
|
either "1" for the protocol described in 2.1 or "2" for the protocol in
|
|
|
|
|
2.2 and a comma-separated list of human-readable client names, so that
|
|
|
|
|
Tor can create authorization data for these clients:
|
2008-07-19 15:51:34 +02:00
|
|
|
|
|
|
|
|
|
HiddenServiceAuthorizeClient auth-type client-name,client-name,...
|
|
|
|
|
|
|
|
|
|
If this option is configured, HiddenServiceVersion is automatically
|
2008-08-04 17:55:20 +02:00
|
|
|
|
reconfigured to contain only version numbers of 2 or higher.
|
2008-07-19 15:51:34 +02:00
|
|
|
|
|
|
|
|
|
Tor stores all generated authorization data for the authorization
|
2008-08-01 13:35:25 +02:00
|
|
|
|
protocols described in Sections 2.1 and 2.2 in a new file using the
|
2008-07-19 15:51:34 +02:00
|
|
|
|
following file format:
|
2008-04-28 23:50:30 +02:00
|
|
|
|
|
|
|
|
|
"client-name" human-readable client identifier NL
|
|
|
|
|
"descriptor-cookie" 128-bit key ^= 22 base64 chars NL
|
2008-07-19 15:51:34 +02:00
|
|
|
|
|
2008-08-01 13:35:25 +02:00
|
|
|
|
If the authorization protocol of Section 2.2 is used, Tor also generates
|
2008-07-19 15:51:34 +02:00
|
|
|
|
and stores the following data:
|
|
|
|
|
|
2008-04-28 23:50:30 +02:00
|
|
|
|
"client-key" NL a public key in PEM format
|
|
|
|
|
|
2008-08-01 13:35:25 +02:00
|
|
|
|
2.4. Client configuration
|
2008-07-19 15:51:34 +02:00
|
|
|
|
|
|
|
|
|
Clients need to make their authorization data known to Tor using another
|
|
|
|
|
configuration option that contains a service name (mainly for the sake of
|
|
|
|
|
convenience), the service address, and the descriptor cookie that is
|
|
|
|
|
required to access a hidden service (the authorization protocol number is
|
|
|
|
|
encoded in the descriptor cookie):
|
|
|
|
|
|
|
|
|
|
HidServAuth service-name service-address descriptor-cookie
|
2007-12-09 01:18:51 +01:00
|
|
|
|
|
2007-09-26 16:52:10 +02:00
|
|
|
|
Security implications:
|
|
|
|
|
|
2008-04-28 23:50:30 +02:00
|
|
|
|
In the following we want to discuss possible attacks by dishonest
|
2007-12-15 21:09:43 +01:00
|
|
|
|
entities in the presented infrastructure and specific protocol. These
|
|
|
|
|
security implications would have to be verified once more when adding
|
|
|
|
|
another protocol. The dishonest entities (theoretically) include the
|
2008-10-14 22:04:47 +02:00
|
|
|
|
hidden service itself, the authenticated clients, hidden service directory
|
2007-12-15 21:09:43 +01:00
|
|
|
|
nodes, introduction points, and rendezvous points. The relays that are
|
|
|
|
|
part of circuits used during protocol execution, but never learn about
|
|
|
|
|
the exchanged descriptors or cells by design, are not considered.
|
|
|
|
|
Obviously, this list makes no claim to be complete. The discussed attacks
|
|
|
|
|
are sorted by the difficulty to perform them, in ascending order,
|
|
|
|
|
starting with roles that everyone could attempt to take and ending with
|
|
|
|
|
partially trusted entities abusing the trust put in them.
|
|
|
|
|
|
|
|
|
|
(1) A hidden service directory could attempt to conclude presence of a
|
2008-10-14 22:04:47 +02:00
|
|
|
|
service from the existence of a locally stored hidden service descriptor:
|
2008-04-28 23:50:30 +02:00
|
|
|
|
This passive attack is possible only for a single client-service
|
2008-10-14 22:04:47 +02:00
|
|
|
|
relation, because descriptors need to contain a publicly visible
|
|
|
|
|
signature of the service using the client key.
|
|
|
|
|
A possible protection would be to increase the number of hidden service
|
|
|
|
|
directories in the network.
|
2007-12-25 12:34:29 +01:00
|
|
|
|
|
|
|
|
|
(2) A hidden service directory could try to break the descriptor cookies
|
|
|
|
|
of locally stored descriptors: This attack can be performed offline. The
|
|
|
|
|
only useful countermeasure against it might be using safe passwords that
|
|
|
|
|
are generated by Tor.
|
|
|
|
|
|
2008-10-14 22:04:47 +02:00
|
|
|
|
[passwords? where did those come in? -RD]
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(3) An introduction point could try to identify the pseudonym of the
|
2007-12-15 21:09:43 +01:00
|
|
|
|
hidden service on behalf of which it operates: This is impossible by
|
|
|
|
|
design, because the service uses a fresh public key for every
|
|
|
|
|
establishment of an introduction point (see proposal 114) and the
|
|
|
|
|
introduction point receives a fresh introduction cookie, so that there is
|
|
|
|
|
no identifiable information about the service that the introduction point
|
|
|
|
|
could learn. The introduction point cannot even tell if client accesses
|
|
|
|
|
belong to the same client or not, nor can it know the total number of
|
|
|
|
|
authorized clients. The only information might be the pattern of
|
|
|
|
|
anonymous client accesses, but that is hardly enough to reliably identify
|
2008-04-28 23:50:30 +02:00
|
|
|
|
a specific service.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(4) An introduction point could want to learn the identities of accessing
|
2007-12-15 21:09:43 +01:00
|
|
|
|
clients: This is also impossible by design, because all clients use the
|
2007-12-25 12:34:29 +01:00
|
|
|
|
same introduction cookie for authorization at the introduction point.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(5) An introduction point could try to replay a correct INTRODUCE1 cell
|
2007-12-15 21:09:43 +01:00
|
|
|
|
to other introduction points of the same service, e.g. in order to force
|
|
|
|
|
the service to create a huge number of useless circuits: This attack is
|
2008-04-28 23:50:30 +02:00
|
|
|
|
not possible by design, because INTRODUCE1 cells are encrypted using a
|
|
|
|
|
freshly created introduction key that is only known to authorized
|
|
|
|
|
clients.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(6) An introduction point could attempt to replay a correct INTRODUCE2
|
2007-12-15 21:09:43 +01:00
|
|
|
|
cell to the hidden service, e.g. for the same reason as in the last
|
2008-10-14 22:04:47 +02:00
|
|
|
|
attack: This attack is stopped by the fact that a service will drop
|
|
|
|
|
INTRODUCE2 cells containing a DH handshake they have seen recently.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(7) An introduction point could block client requests by sending either
|
2007-12-15 21:09:43 +01:00
|
|
|
|
positive or negative INTRODUCE_ACK cells back to the client, but without
|
|
|
|
|
forwarding INTRODUCE2 cells to the server: This attack is an annoyance
|
|
|
|
|
for clients, because they might wait for a timeout to elapse until trying
|
|
|
|
|
another introduction point. However, this attack is not introduced by
|
2007-12-25 12:34:29 +01:00
|
|
|
|
performing authorization and it cannot be targeted towards a specific
|
2007-12-15 21:09:43 +01:00
|
|
|
|
client. A countermeasure might be for the server to periodically perform
|
|
|
|
|
introduction requests to his own service to see if introduction points
|
|
|
|
|
are working correctly.
|
|
|
|
|
|
2007-12-25 12:34:29 +01:00
|
|
|
|
(8) The rendezvous point could attempt to identify either server or
|
2008-04-28 23:50:30 +02:00
|
|
|
|
client: This remains impossible as it was before, because the
|
2007-12-15 21:09:43 +01:00
|
|
|
|
rendezvous cookie does not contain any identifiable information.
|
2007-12-25 12:34:29 +01:00
|
|
|
|
|
2008-04-28 23:50:30 +02:00
|
|
|
|
(9) An authenticated client could swamp the server with valid INTRODUCE1
|
2007-12-15 21:09:43 +01:00
|
|
|
|
and INTRODUCE2 cells, e.g. in order to force the service to create
|
|
|
|
|
useless circuits to rendezvous points; as opposed to an introduction
|
|
|
|
|
point replaying the same INTRODUCE2 cell, a client could include a new
|
|
|
|
|
rendezvous cookie for every request: The countermeasure for this attack
|
2008-10-14 22:04:47 +02:00
|
|
|
|
is the restriction to 10 connection establishments per client per hour.
|
2007-12-15 21:09:43 +01:00
|
|
|
|
|
2007-09-26 16:52:10 +02:00
|
|
|
|
Compatibility:
|
|
|
|
|
|
2007-12-15 21:09:43 +01:00
|
|
|
|
An implementation of this proposal would require changes to hidden
|
2008-10-14 22:04:47 +02:00
|
|
|
|
services and clients to process authorization data and encode and
|
|
|
|
|
understand the new formats. However, both services and clients would
|
2007-12-25 12:34:29 +01:00
|
|
|
|
remain compatible to regular hidden services without authorization.
|
2007-09-26 16:52:10 +02:00
|
|
|
|
|
2008-04-28 23:50:30 +02:00
|
|
|
|
Implementation:
|
|
|
|
|
|
|
|
|
|
The implementation of this proposal can be divided into a number of
|
|
|
|
|
changes to hidden service and client side. There are no
|
|
|
|
|
changes necessary on directory, introduction, or rendezvous nodes. All
|
|
|
|
|
changes are marked with either [service] or [client] do denote on which
|
|
|
|
|
side they need to be made.
|
|
|
|
|
|
|
|
|
|
/1/ Configure client authorization [service]
|
|
|
|
|
|
|
|
|
|
- Parse configuration option HiddenServiceAuthorizeClient containing
|
|
|
|
|
authorized client names.
|
|
|
|
|
- Load previously created client keys and descriptor cookies.
|
|
|
|
|
- Generate missing client keys and descriptor cookies, add them to
|
|
|
|
|
client_keys file.
|
|
|
|
|
- Rewrite the hostname file.
|
|
|
|
|
- Keep client keys and descriptor cookies of authorized clients in
|
|
|
|
|
memory.
|
|
|
|
|
[- In case of reconfiguration, mark which client authorizations were
|
|
|
|
|
added and whether any were removed. This can be used later when
|
|
|
|
|
deciding whether to rebuild introduction points and publish new
|
|
|
|
|
hidden service descriptors. Not implemented yet.]
|
|
|
|
|
|
|
|
|
|
/2/ Publish hidden service descriptors [service]
|
|
|
|
|
|
|
|
|
|
- Create and upload hidden service descriptors for all authorized
|
|
|
|
|
clients.
|
|
|
|
|
[- See /1/ for the case of reconfiguration.]
|
|
|
|
|
|
|
|
|
|
/3/ Configure permission for hidden services [client]
|
|
|
|
|
|
|
|
|
|
- Parse configuration option HidServAuth containing service
|
|
|
|
|
authorization, store authorization data in memory.
|
|
|
|
|
|
|
|
|
|
/5/ Fetch hidden service descriptors [client]
|
|
|
|
|
|
|
|
|
|
- Look up client authorization upon receiving a hidden service request.
|
|
|
|
|
- Request hidden service descriptor ID including client key and
|
|
|
|
|
descriptor cookie. Only request v2 descriptors, no v0.
|
|
|
|
|
|
|
|
|
|
/6/ Process hidden service descriptor [client]
|
|
|
|
|
|
|
|
|
|
- Decrypt introduction points with descriptor cookie.
|
|
|
|
|
|
|
|
|
|
/7/ Create introduction request [client]
|
|
|
|
|
|
|
|
|
|
- Include descriptor cookie in INTRODUCE2 cell to introduction point.
|
|
|
|
|
- Pass descriptor cookie around between involved connections and
|
|
|
|
|
circuits.
|
|
|
|
|
|
|
|
|
|
/8/ Process introduction request [service]
|
|
|
|
|
|
|
|
|
|
- Read descriptor cookie from INTRODUCE2 cell.
|
|
|
|
|
- Check whether descriptor cookie is authorized for access, including
|
|
|
|
|
checking access counters.
|
|
|
|
|
- Log access for accountability.
|
2008-02-21 10:01:32 +01:00
|
|
|
|
|