philippemnoel / whist-whist

Whist Browser
https://whist.com
Apache License 2.0
8 stars 3 forks source link

Prevent replay attacks #4787

Open npip99 opened 2 years ago

npip99 commented 2 years ago

Feature Description

Example Proposal (Though there could be other ways of doing this):

This resolves any possible attack created by replaying packets sniffed by an attacker, either by feeding the server packets previously signed by the client, or feeding the server packets previously signed by the server. Since the attacker can't sign packets, these two situations are the only possible replay attacks available to the attacker.

~~

The same algorithm should be used in the reverse direction, so the client can't be replayed signed packets either, since that could also disturb the stream.

~~

NOTICE OF LOW PRIORITY

We do not currently wish to support protecting clients who are communicating over unencrypted channels and who have malicious actors physically near them or their network, trying to packet sniff / MITM / DNS poison that particular individual.

MITM fundamentally DOS's that user anyway, even for non-Whist users, as SEQ number attacks can trivially be used to shutdown TCP access entirely. Even TLS/SSL doesn't resolve this.

So, this GH issue is strongly low-priority.

Replay attacks can currently do weird things like cause the user to type things they didn't mean to type, or resend clipboard events, or DDOS, or intercept the handshake, or even force a disconnect or total loss of communication. These are known issues. Note however that it fundamentally does not allow a packet sniffer to decrypt a packet, since we do not send the private key over the network. Recall also that we generate a random IV for every packet, so a packet sniffer additionally cannot engage in frequency analysis to figure out which keyboard packets refer to what letter for example.

npip99 commented 2 years ago

Re #5114, this GH issue it open to address replay attacks entirely, not just some subset of replay attacks.

wangyu- commented 2 years ago

See also the comment in #4785.

npip99 commented 2 years ago

Moving a comment from Yancey over here:

~ We may want to consider using a different key for client and server, potentially using hkdf based off of SHA256, to address the situation where a computer running Whist is fed its own packet.

The description has an additional bullet point now to address this issue.