-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
The federation public key system is insecure #383
Comments
Yup, the perspectives setup in synapse is broken. Speccing a fix is on the overdue hitlist for s2s r0; this bug can be the basis for publicly tracking that. |
whilst it's true that this is a problem, I don't think it's quite as bad as this issue makes out. There are a number of mitigations:
|
Presumably this is fixed by |
@cyphar It is not. This is about the federation signing keys, not TLS. Signing the signing keys with valid TLS certs was just one potential solution mentioned, but no solution has been implemented so far. matrix.org is still the default trusted key server and most people don't change that. |
The best way to obtain the identity (federation ed25519 public key) of a server is to contact it and ask. This process derives its security from the web's established TLS certificate system; like it or not this is the best way.
When the server is not online the key is not obtained under those assumptions. The key is instead obtained from another server. Other servers can fiction any key for the offline sever. Other servers can then (re)create messages, rewrite and take over, or crash rooms.
Querying multiple online servers to establish some agreement about the offline server (perspectives) is insufficient: ignoring the minority adversary to trust the majority in agreement is the foundation of a sybil attack; inversely, ignoring the majority in agreement merely because any minority exists is a denial of service. Thus the current system trusts some specific server to query: at present, all matrix implementations ship their software to trust matrix.org by default and have no realistic choice in refusing to do so. This is adequate for a centralized service, but is inadequate for a decentralized federation.
The solution proffered in #234 is insufficient. Storing keys in the room is insecure because the room with the keys might itself be fictitiously presented by an attacker faking keys.
Solution
Matrix is an internet based system already relying on domain names and the associated TLS certificate infrastructure. The security of that system must be leveraged for federation identities. When a server (domain based identity) is offline, proof of a message originating from that domain must be obtained. This can be done by using the TLS private key associated with a certificate signed by a certificate authority. The TLS private key must be used to sign the ed25519 federation public key which can then be obtained from any server regardless of it being online.
This solution involves adding that signature as another field in the
verify_keys
structure. The difficulty of implementing this solution is low, and can be shipped very quickly. Even if existing implementations are unaware of this new signature, and even if up to date implementations accept this signature not being present from old implementations: it is still imperative (and trivial) to add it now to the spec and implementations.The text was updated successfully, but these errors were encountered: