Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSC2134: Identity Hash Lookups #2134

Merged
merged 73 commits into from
Aug 8, 2019
Merged
Changes from 42 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
3eff76b
MSC 2134
Half-Shot Jun 15, 2019
a8c26d2
Wrap
Half-Shot Jun 15, 2019
8b92df7
s/medium/address
Half-Shot Jun 15, 2019
12431f1
Base64 potential issue
Half-Shot Jun 15, 2019
f8dbf2b
Update proposals/2134-identity-hash-lookup.md
Half-Shot Jun 17, 2019
d2b47a5
Allow for changing the hashing algo and add at-rest details
anoadragon453 Jun 18, 2019
063b9f6
Require a salt to defend against rainbow tables
anoadragon453 Jun 18, 2019
bc9b6c3
Add salt to example and signal link
anoadragon453 Jun 18, 2019
5049e55
Drop /api from the new endpoint
anoadragon453 Jun 18, 2019
6bb4a9e
Add per-is salt consideration
anoadragon453 Jun 18, 2019
f41ed02
remove sec concerns
anoadragon453 Jun 18, 2019
3ee27d3
salt->pepper. 1 pepper/is. add multi-hash idea
anoadragon453 Jun 19, 2019
f28476f
line wrap and fix wording
anoadragon453 Jun 19, 2019
1343e19
Specify hash algorithm and fallback considerations
anoadragon453 Jun 20, 2019
1fea604
Don't define error message
anoadragon453 Jun 21, 2019
e3b2ad3
pepper -> lookup_pepper
anoadragon453 Jun 21, 2019
c63edc7
Clean up wording around peppers and hashes
anoadragon453 Jun 21, 2019
2383a55
404 for deprecated endpoint
anoadragon453 Jun 21, 2019
53f025e
Specify optional pepper rotation period
anoadragon453 Jun 21, 2019
21e93a1
Naming and capitalization
turt2live Jun 21, 2019
e3ff802
http err codes and hash wording fixes
anoadragon453 Jun 24, 2019
acdb2b1
Merge branch 'hs/hash-identity' of github.com:matrix-org/matrix-doc i…
anoadragon453 Jun 24, 2019
02ac0f3
Give the user control!
anoadragon453 Jun 24, 2019
ee10576
Update with feedback
anoadragon453 Jun 24, 2019
36a35a3
Clarify how the spec defines hashing algs
anoadragon453 Jun 24, 2019
0a4c83d
no plural. 3pid -> 3PID
anoadragon453 Jun 24, 2019
fae6883
Update with review comments
anoadragon453 Jun 25, 2019
f951f31
Fix terrible wording
anoadragon453 Jun 25, 2019
96e43aa
Define what characters lookup_pepper can consist of
anoadragon453 Jun 25, 2019
df88b13
Update proposals/2134-identity-hash-lookup.md
anoadragon453 Jun 25, 2019
dfb37fc
update with feedback
anoadragon453 Jun 25, 2019
0fd4fe2
Add algo/pepper to err resp
anoadragon453 Jun 26, 2019
7549c5d
Merge branch 'hs/hash-identity' of github.com:matrix-org/matrix-doc i…
anoadragon453 Jun 26, 2019
6f81d37
New hashing method
anoadragon453 Jul 1, 2019
922a20b
small fixes
anoadragon453 Jul 1, 2019
53bd384
Clarify salting
anoadragon453 Jul 3, 2019
f4a1e02
simple method once more
anoadragon453 Jul 4, 2019
3702669
update from comments
anoadragon453 Jul 5, 2019
dd8a654
Address review comments
anoadragon453 Jul 8, 2019
1963a24
fix attacks paragraph
anoadragon453 Jul 8, 2019
ed67e26
pepper must not be an empty string, append medium
anoadragon453 Jul 8, 2019
3514437
Ability for client/server to decide on no hashing
anoadragon453 Jul 12, 2019
36cb8ed
none -> m.none
anoadragon453 Jul 16, 2019
0444c80
review comments
anoadragon453 Jul 22, 2019
887cd5e
I really hope someone doesn't invest none-hash
anoadragon453 Jul 22, 2019
577021f
resolve some comments
anoadragon453 Jul 23, 2019
b26a9ed
Expand on why we can't trust dirty homeservers
anoadragon453 Jul 23, 2019
9fd6bd3
Add details about why this proposal should exist
anoadragon453 Jul 23, 2019
3031df7
Add example for none algo
anoadragon453 Jul 23, 2019
3b8c57e
Don't require servers/clients to support "none"
anoadragon453 Jul 23, 2019
8f3e588
pepper is not a secret val. Still needs to be around.
anoadragon453 Jul 24, 2019
c6dd595
Clients can cache the hash details if they want to
anoadragon453 Jul 25, 2019
da876bb
missing word
anoadragon453 Jul 25, 2019
0ac70b2
Clarify peppering should not happen on none algo
anoadragon453 Jul 25, 2019
20c72a3
Update proposals/2134-identity-hash-lookup.md
anoadragon453 Jul 25, 2019
6119b9a
*@hobnobbob.com is unlikely to be guessed
anoadragon453 Jul 25, 2019
87a54e8
Merge branch 'hs/hash-identity' of github.com:matrix-org/matrix-doc i…
anoadragon453 Jul 25, 2019
ffbfde8
Update proposals/2134-identity-hash-lookup.md
anoadragon453 Jul 26, 2019
5580a2a
Update proposals/2134-identity-hash-lookup.md
anoadragon453 Jul 26, 2019
a17c74f
switch medium and address around, space between address and pepper
anoadragon453 Jul 26, 2019
027c2d7
Merge branch 'hs/hash-identity' of github.com:matrix-org/matrix-doc i…
anoadragon453 Jul 26, 2019
6660768
Don't repeat fast hash bit
anoadragon453 Jul 26, 2019
4d1f2ea
Apply suggestions from code review
anoadragon453 Jul 26, 2019
c8527b7
Merge branch 'hs/hash-identity' of github.com:matrix-org/matrix-doc i…
anoadragon453 Jul 26, 2019
57de107
Move medium back behind the address
anoadragon453 Jul 31, 2019
9913f5b
Slightly clarify pepper value
anoadragon453 Jul 31, 2019
33d22c3
hashes are not stream ciphers
anoadragon453 Jul 31, 2019
3789d82
Incorporate solution analysis from the context of attacks
anoadragon453 Aug 1, 2019
acf8d34
Merge branch 'hs/hash-identity' of github.com:matrix-org/matrix-doc i…
anoadragon453 Aug 1, 2019
c401a4d
punctuation
anoadragon453 Aug 1, 2019
3877724
fix speeling
anoadragon453 Aug 1, 2019
96e06b6
Add line, britishise
anoadragon453 Aug 1, 2019
3edf5e3
Make hashes real values
anoadragon453 Aug 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
279 changes: 279 additions & 0 deletions proposals/2134-identity-hash-lookup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
# MSC2134: Identity Hash Lookups
Copy link
Member

@ara4n ara4n Jul 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is almost there - thank you for the epic. The current draft reads really well.

My main remaining concerns are that we need to spell out the attacks and tradeoffs and conclusion rationale between the solutions more clearly. I’ve tried to do this in note form at https://gist.github.com/ara4n/8d5fe3030d9fad00111f9ec343e86feb - would it be possible to try to incorporate this?

Meanwhile, I agree that a rotating pepper hash lookups is the best approach here (having reasoned it through).

Otherwise, my only other remaining concern is that we should be protecting the IS db better by storing 3pids in hashed form (and thus also 3pid invites and other bindings). ie wherever we currently pass around 3pids instead we pass around a hash salted with a static salt for that IS. i don’t think we even need the raw 3pid for validation purposes, as we can validate using a nonce instead? I’d much rather we spent the time to figure out protecting the db rather than figuring out k-anon further. This could be a separate MSC though, but it feels like we should have thought it through enough to ensure that this MSC doesn’t design it out.

Copy link
Member

@anoadragon453 anoadragon453 Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main remaining concerns are that we need to spell out the attacks and tradeoffs and conclusion rationale between the solutions more clearly. I’ve tried to do this in note form at https://gist.github.com/ara4n/8d5fe3030d9fad00111f9ec343e86feb - would it be possible to try to incorporate this?

On it, thanks!

instead we pass around a hash salted with a static salt for that IS

This is something we could append on to /hash_details, or even use the lookup_pepper from it for this purpose? Perhaps renaming it to something more generic in the process? We don't want to reuse lookup_pepper of course. The salt shouldn't rotate, while the pepper should.

Looking at the IS API docs, the following would need to be changed to enable storing hashed IDs at rest.

Endpoints that would already work are:

There's still the GDPR concern that if we do get compromised, we're obligated to notify everyone that hashes were taken. Either we use matrix as the communication medium (does the law disallow this?) or we send a message to Homeservers who do have the plaintext 3PIDs that they should send an email (this could be horribly abused by an evil IS though).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right - thanks for doing the storing hashed ID analysis, this is excellent. i suggest we copy-paste this verbatim as a starting point for a new MSC so as to not block this one further.

I've asked @lampholder whether we can do data breach notifications via Matrix or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(i've given this the FCP ✅on the assumption that the spelling-out-the-attack and the more concrete tradeoff comparison makes it into the MSC)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one other gotcha sprang to mind which we should note: having written out a basic threat model, it becomes clear that a malicious IS could just fail to rotate the pepper (or reuse the same pepper). So the rotating pepper really buys us very little indeed unless clients check for pepper reuse, which seems onerous and also useless given they can’t tell about pepper reuse from before they connected.
So while we might as well keep the ability of the server to specify the pepper it uses for the hashes, in think there is limited use in bothering to rotate it.


[Issue #2130](https://github.com/matrix-org/matrix-doc/issues/2130) has been
recently created in response to a security issue brought up by an independent
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
party. To summarise the issue, lookups (of Matrix user IDs) are performed using
plain-text 3PIDs (third-party IDs) which means that the identity server can
identify and record every 3PID that the user has in their contacts, whether
that email address or phone number is already known by the identity server or
not.

If the 3PID is hashed, the identity server could not determine the address
unless it has already seen that address in plain-text during a previous call
of the [/bind
mechanism](https://matrix.org/docs/spec/identity_service/r0.2.1#post-matrix-identity-api-v1-3pid-bind)
(without significant resources to reverse the hashes). This helps prevent
bulk collection of user's contact lists by the identity server and reduces
its ability to build social graphs.

This proposal thus calls for the Identity Service API's
[/lookup](https://matrix.org/docs/spec/identity_service/r0.2.1#get-matrix-identity-api-v1-lookup)
endpoint to use hashed 3PIDs instead of their plain-text counterparts (and to
deprecate both it and
[/bulk_lookup](https://matrix.org/docs/spec/identity_service/r0.2.1#post-matrix-identity-api-v1-bulk-lookup)),
which will leak less data to identity servers.

## Proposal
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

This proposal suggests making changes to the Identity Service API's lookup
endpoints. Instead, this proposal consolidates them into a single `/lookup`
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
endpoint. Additionally, the endpoint is to be on a `v2` path, to avoid
confusion with the original `/lookup`. We also drop the `/api` in order to
preserve consistency across other endpoints:

- `/_matrix/identity/v2/lookup`

A second endpoint is added for clients to request information about the form
the server expects hashes in.

- `/_matrix/identity/v2/hash_details`

The following back-and-forth occurs between the client and server.

Let's say the client wants to check the following 3PIDs:

```
alice@example.com
bob@example.com
carl@example.com
+1 234 567 8910
denny@example.com
```

The client will hash each 3PID as a concatenation of the medium and address,
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
separated by a space and a pepper appended to the end. Note that phone numbers
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
should be formatted as defined by
https://matrix.org/docs/spec/appendices#pstn-phone-numbers, before being
hashed). First the client must append the medium to the address:

```
"alice@example.com" -> "alice@example.com email"
"bob@example.com" -> "bob@example.com email"
"carl@example.com" -> "carl@example.com email"
"+1 234 567 8910" -> "12345678910 msisdn"
"denny@example.com" -> "denny@example.com email"
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
```

Hashes must be peppered in order to reduce both the information an identity
server gains during the process, and attacks the client can perform. Clients
will have to generate a full rainbow table specific to the set pepper to
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
obtain all registered MXIDs, while the server has to generate a full rainbow
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
table with the specific pepper to get the plaintext 3pids for non-matrix
users.

In order for clients to know the pepper and hashing algorithm they should use,
Identity servers must make the information available on the `/hash_details`
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
endpoint:

```
GET /_matrix/identity/v2/hash_details

{
"lookup_pepper": "matrixrocks",
"algorithms": ["sha256"]
}
```

The name `lookup_pepper` was chosen in order to account for pepper values
being returned for other endpoints in the future. The contents of
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
`lookup_pepper` MUST match the regular expression `[a-zA-Z0-9]+` (unless no
hashing is being performed, as described below). If `lookup_pepper` is an
empty string, clients MUST cease the lookup operation.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

```
The client should append the pepper to the end of the 3PID string before
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
hashing.

"alice@example.com email" -> "alice@example.com emailmatrixrocks"
"bob@example.com email" -> "bob@example.com emailmatrixrocks"
"carl@example.com email" -> "carl@example.com emailmatrixrocks"
"12345678910 msdisn" -> "12345678910 msisdnmatrixrocks"
"denny@example.com email" -> "denny@example.com emailmatrixrocks"
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
```

Clients SHOULD request this endpoint each time before performing a lookup, to
handle identity servers which may rotate their pepper values frequently.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
Clients MUST choose one of the given hash algorithms to encrypt the 3PID
during lookup.

At a minimum, clients and identity servers MUST support SHA-256 as defined by
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
[RFC 4634](https://tools.ietf.org/html/rfc4634), identified by the
`algorithm` value `"sha256"`. SHA-256 was chosen as it is currently used
throughout the Matrix spec, as well as its properties of being quick to hash.
While this reduces the resources necessary to generate a rainbow table for
attackers, a fast hash is necessary if particularly slow mobile clients are
going to be hashing thousands of contact details. Other algorithms can be
negotiated by the client and server at their discretion.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

There are certain situations when an identity server cannot be expected to
compare hashed 3PID values; When a server is connected to a backend provider
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
such as LDAP, there is no way for the identity server to efficiently pull all
of the addresses and hash them. For this case, the `algorithm` field of `GET
/hash_details` may be set to `"none"`, and `lookup_pepper` will be an empty
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
string. No hashing will be performed if the client and server decide on this,
and 3PIDs will be sent in plain-text, similar to the v1 `/lookup` API.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

When performing a lookup, the pepper and hashing algorithm the client used
must be part of the request body (even when using the `"none"` algorithm
value). If they do not match what the server has on file (which may be the
case if the pepper was changed right after the client's request for it), then
the server must inform the client that they need to query the hash details
again, instead of just returning an empty response, which clients would
assume to mean that no contacts are registered on that identity server.

If the algorithm does not match the server's, the server should return a `400
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
M_INVALID_PARAM`. If the pepper does not match the server's, the server should
return a new error code, `400 M_INVALID_PEPPER`. A new error code is not
defined for an invalid algorithm as that is considered a client bug.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

The `M_INVALID_PEPPER` error response should contain the correct `algorithm`
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
and `lookup_pepper` fields. This is to prevent the client from needing to
query `/hash_details` again, thus saving a round-trip. `M_INVALID_PARAM` does
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
not include these fields. An example response to an incorrect pepper would
be:

```
{
"error": "Incorrect value for lookup_pepper",
"errcode": "M_INVALID_PEPPER",
"algorithm": "sha256",
"lookup_pepper": "matrixrocks"
}
```

Now comes time for the lookup. Note that the resulting hash digest MUST be
encoded in URL-safe unpadded base64 (similar to [room version 4's event
IDs](https://matrix.org/docs/spec/rooms/v4#event-ids)). Once hashing has been
performed using the defined hashing algorithm, the client sends each hash in an
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
array.

anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
```
NOTE: Hashes are not real values

"alice@example.com emailmatrixrocks" -> "y_TvXLKxFT9CURPXI1wvfjvfvsXe8FPgYj-mkQrnszs"
"bob@example.com emailmatrixrocks" -> "r0-6x3rp9zIWS2suIque-wXTnlv9sc41fatbRMEOwQE"
"carl@example.com emailmatrixrocks" -> "ryr10d1K8fcFVxALb3egiSquqvFAxQEwegXtlHoQFBw"
"12345678910 msisdnmatrixrocks" -> "c_30UaSZhl5tyanIjFoE1IXTmuU3vmptEwVOc3P2Ens"
"denny@example.com emailmatrixrocks" -> "bxt8rtRaOzMkSk49zIKE_NfqTndHvGbWHchZskW3xmY"

POST /_matrix/identity/v2/lookup

{
"hashes": [
"y_TvXLKxFT9CURPXI1wvfjvfvsXe8FPgYj-mkQrnszs",
"r0-6x3rp9zIWS2suIque-wXTnlv9sc41fatbRMEOwQE",
"ryr10d1K8fcFVxALb3egiSquqvFAxQEwegXtlHoQFBw",
"c_30UaSZhl5tyanIjFoE1IXTmuU3vmptEwVOc3P2Ens",
"bxt8rtRaOzMkSk49zIKE_NfqTndHvGbWHchZskW3xmY"
],
"algorithm": "sha256",
"pepper": "matrixrocks"
}
```

The identity server, upon receiving these hashes, can simply compare against
the hashes of the 3PIDs it stores. The server then responds with the Matrix
IDs of those that match:

```
{
"mappings": {
"y_TvXLKxFT9CURPXI1wvfjvfvsXe8FPgYj-mkQrnszs": "@alice:example.com",
"c_30UaSZhl5tyanIjFoE1IXTmuU3vmptEwVOc3P2Ens": "@fred:example.com"
}
}
```

The client can now display which 3PIDs link to which Matrix IDs.

No parameter changes will be made to
[/bind](https://matrix.org/docs/spec/identity_service/r0.2.1#post-matrix-identity-api-v1-3pid-bind)
as part of this proposal.

## Fallback considerations

`v1` versions of these endpoints may be disabled at the discretion of the
implementation, and should return a `403 M_FORBIDDEN` error if so.

If an identity server is too old and a HTTP 400 or 404 is received when
accessing the `v2` endpoint, they should fallback to the `v1` endpoint instead.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
However, clients should be aware that plain-text 3PIDs are required for the
`v1` endpoint, and SHOULD ask for user consent to send 3PIDs in plain-text, and
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
be clear about where they are being sent to.

anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
## Tradeoffs
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

* There is a small cost incurred by performing hashes before requests, but this
is outweighed by the privacy implications of sending plain-text addresses.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

## Security Considerations

Hashes are still reversible with a rainbow table, but the provided pepper,
which can be rotated by identity servers at will, should help mitigate this.
Phone numbers (with their relatively short possible address space of 12
numbers), short email addresses, and addresses of both type that have been
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
leaked in database dumps are more susceptible to hash reversal.

Mediums and peppers are appended to the address as to prevent a common prefix
for each plain-text string, which prevents attackers from pre-computing bits
turt2live marked this conversation as resolved.
Show resolved Hide resolved
of a stream cipher.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hash functions aren't stream ciphers. I think a more appropriate phrasing would be "pre-computing the internal state of the hash function".

I wonder if there is actually any useful benefit here to appending the medium instead of prepending though, given a pepper is also appended.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hash functions aren't stream ciphers. I think a more appropriate phrasing would be "pre-computing the internal state of the hash function".

Sounds good, thanks for the clarification.

I wonder if there is actually any useful benefit here to appending the medium instead of prepending though, given a pepper is also appended.

It doesn't hurt, right?


Additionally, this proposal does not stop an identity server from storing
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
plain-text 3PIDs. There is a GDPR argument in keeping email addresses, such
that if a breach happens, users must be notified of such. Ideally this would be
done over Matrix, but people may've stuck their email in an identity server and
then left Matrix forever. Perhaps if only hashes were being stored on the
identity server then that isn't considered personal information? In any case, a
discussion for another MSC.

## Other considered solutions

Ideally identity servers would never receive plain-text addresses, however it
is necessary for the identity server to send email/sms messages during a
bind, as it cannot trust a homeserver to do so as the homeserver may be lying.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

Bloom filters are an alternative method of providing private contact discovery.
However, they do not scale well due to requiring clients to download a large
filter that needs updating every time a new bind is made. Further considered
solutions are explored in https://signal.org/blog/contact-discovery/. Signal's
eventual solution of using Software Guard Extensions (detailed in
https://signal.org/blog/private-contact-discovery/) is considered impractical
for a federated network, as it requires specialized hardware.

k-anonymity was considered as an alternative, in which the identity server
would never receive a full hash of a 3PID that it did not already know about.
While this has been considered plausible, it comes with heightened resource
requirements (much more hashing by the identity server). The conclusion was
that it may not provide more privacy if an identity server decided to be evil,
however it would significantly raise the resource requirements to run an evil
identity server.

Discussion and a walk-through of what a client/identity-server interaction would
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
look like are documented [in this Github
comment](https://github.com/matrix-org/matrix-doc/pull/2134#discussion_r298691748).

anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
Additionally, a radical model was also considered where the first portion of
the above scheme was done with an identity server, and the second would be done
with various homeservers who originally reported the 3PID to the identity
server. While interesting and a more decentralised model, some attacks are
still possible if the identity server is running an evil homeserver which it
can direct the client to send its hashes to. Discussion on this matter has
taken place in the MSC-specific room [starting at this
message](https://matrix.to/#/!LlraCeVuFgMaxvRySN:amorgan.xyz/$4wzTSsspbLVa6Lx5cBq6toh6P3TY3YnoxALZuO8n9gk?via=amorgan.xyz&via=matrix.org&via=matrix.vgorcum.com).

## Conclusion

This proposal outlines a simple method to stop bulk collection of user's
contact lists and their social graphs without any disastrous side effects. All
turt2live marked this conversation as resolved.
Show resolved Hide resolved
functionality which depends on the lookup service should continue to function
unhindered by the use of hashes.