MITM attack #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Consider encrypting authorization token payload to mitigate man-in-the-middle attack.
Currently
Initial communication
Client -> Server:
/login [password]Server -> Client: Use this authorization token in future:
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffLater
Server -> Client: Requesting authorization token for UUID
00000000-0000-0000-0000-000000000000Client -> MITM -> Server: Authorization token is
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffMITM intercepted the authorization token and can now impersonate Client
Proposal
Add public/private key encryption with local cache
Initial communication
Server -> Client: My public key is
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaClient: Caches public key locally for the first time
Client -> Server: [Encrypted payload using server's public key: My public key is
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee]Client -> Server
/login [password]Server -> MITM -> Client: [Encrypted payload using client's public key: Use this authorization token in future:
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff]Result: MITM intercepted encrypted payload from server to client that cannot be decrypted without client's private key
Later
Server -> Client: My public key is
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaClient: public key matches local cache, all good
Server -> Client: Requesting authorization token for UUID
00000000-0000-0000-0000-000000000000. [Signature of the message using public key]Client: Checks signature using public key
Client -> MITM -> Server: [Encrypted payload using server's public key: Authorization token is
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff]Result: MITM intercepted encrypted payload that cannot be decrypted without server's private key
MITM attack
Server -> MITM -> Client: My public key is
[MITM replaces it with their own key:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]Client: The key does not match cached key. Aborting all communications.
Problems
In the proposal the only vulnerable place is the initial key exchange. MITM can intercept the first server's message and replace the public key with their own.
The solution would be to either somehow tie server's address to public key for client's local verification or to provide fingerprint.
To clear public key cache user can authorize with /login command again — the mod then trusts the new public key.