You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[6. Cryptography and ID-Certs](#6-cryptography-and-id-certs)
56
57
-[6.1 Home server signed certificates for public client identity keys (ID-Cert)](#61-home-server-signed-certificates-for-public-client-identity-keys-id-cert)
@@ -134,6 +135,8 @@ polyproto operates under the following trust assumptions:
134
135
mostly out of the scope of this specification.
135
136
6. Users rely on their home server for identity key certification, without the home server
136
137
possessing the identity.
138
+
7. Communication with home servers happens through TLS protected communication channels, such as
139
+
`https` for HTTP and `wss` for WebSockets.
137
140
138
141
## 3. APIs and underlying communication protocols
139
142
@@ -934,17 +937,6 @@ token. This verification must be done by proving the following facts:
934
937
935
938
#### 4.1.2 Sensitive actions
936
939
937
-
!!! bug
938
-
939
-
# Outdated: Challenge strings are not used for this.
940
-
941
-
"Sensitive solutions" are set to replace challenge strings as an authenticator for sensitive actions.
942
-
943
-
The API documentation already reflects this change; expect the protocol specification to reflect
944
-
these changes in upcoming beta versions of polyproto.
Sensitive actions require a second factor of authentication, apart from the actor's
@@ -967,11 +959,25 @@ Sensitive actions include, but are not limited to:
967
959
HTTP API routes marked as sensitive actions require a header `X-P2-Sensitive-Solution`, where the
968
960
header value represents the second factor of authentication chosen.
969
961
962
+
#### 4.1.1 Sensitive Solutions
963
+
964
+
Sensitive actions are authorized using so-called "Sensitive solutions". The concrete way to derive a
965
+
sensitive solution depends on the authentication (authn)/authorization (authz) standard used in
966
+
tandem with polyproto. Deriving a valid sensitive solution through the use of an actors private identity
967
+
keys must not be possible, as sensitive solutions act as a second layer of authentication to prevent
968
+
identity takeover if a private identity key were to be leaked.
969
+
970
970
!!! example
971
971
972
-
If the chosen second factor of authentication is TOTP, the value of this header is the current
973
-
TOTP verification code. If the chosen second factor of authentication is a password, then the
974
-
value of this header is to be that password.
972
+
If the chosen second factor of authentication is TOTP, the value of this header is to be the
973
+
current TOTP verification code, or to be derived from the current TOTP verification code.
974
+
If the chosen second factor of authentication is a password, then the value of this header is
975
+
to be that passwords' hash value. Client and server must of course agree on how the sensitive
976
+
solution is to be generated and validated.
977
+
978
+
Sensitive solutions are only used in actor ⇄ actor home-server communications, never in actor ⇄
979
+
foreign server communications. It is unsafe to use sensitive solutions as described in this chapter for
980
+
actor ⇄ foreign server communications.
975
981
976
982
### 4.2 Key trials
977
983
@@ -988,7 +994,7 @@ in preventing replay attacks.
988
994
Challenge strings provide a different set of security guarantees than [sensitive actions](#412-sensitive-actions)
989
995
do. They are not to be used interchangeably.
990
996
991
-
All challenge strings and their responses created must be made
997
+
All key trials and their responses created must be made
992
998
public to ensure that a chain of trust can be maintained. A third party should be able to verify that
993
999
the challenge string, which authorized a specific change in data, was signed by the
994
1000
correct private key. The API routes needed to verify challenges as an outsider are documented in the
@@ -1004,32 +1010,10 @@ correct private key. The API routes needed to verify challenges as an outsider a
1004
1010
Challenge strings can counteract replay attacks. Their uniqueness ensures that even identical requests
1005
1011
have different signatures, preventing malicious servers from successfully replaying requests.
1006
1012
1007
-
Accessing a challenge string protected route is done as follows:
1008
-
1009
-
```mermaid
1010
-
sequenceDiagram
1011
-
autonumber
1012
-
1013
-
actor a as Client A
1014
-
participant s as Server
1015
-
1016
-
note over a: Clients have to provide session<br/>token to request challenge string
1017
-
a->>s: Request challenge string
1018
-
s->>s: Note, that Client A requests challenge<br/>string for given session identified by token
1019
-
s->>a: Challenge string
1020
-
a->>a: Complete challenge by signing<br/>string with private key associated<br/>with pubkey of this session
1021
-
a->>s: Call challenge string protected route with<br/>`X-P2-Challenge-String-Solution` header,<br/>where the value is equal to the challenge string solution
1022
-
s->>s: Verify challenge
1023
-
alt
1024
-
note over s: Challenge string solution is valid
1025
-
s->>s: Let Client A perform the challenge string protected action
1026
-
else
1027
-
note over s: Challenge string solution is invalid
1028
-
s->>s: Return 403, indicating that<br/>the challenge string solution is invalid,<br/>with optional RetryAfter header to indicate how<br/>long the client should wait before making a<br/>follow-up request.
1029
-
end
1030
-
```
1013
+
Accessing a key-trial protected route is done by supplying the key trial solution(s) in the `X-P2-core-keytrial`
1014
+
HTTP header. The value of this header is a JSON-Array, containing the key-trial solution object or objects.
1031
1015
1032
-
### 4.3 Protection against misuse by malicious home servers
1016
+
### 4.4 Protection against misuse by malicious home servers
1033
1017
1034
1018
To protect users from misuse by malicious home servers, a mechanism is needed to prevent home
1035
1019
servers from generating federation tokens for users without their consent and knowledge.
0 commit comments