Open aeyakovenko opened 4 years ago
@behzadnouri are we still vulnerable to this after the ping pong protocols?
@behzadnouri are we still vulnerable to this after the ping pong protocols?
I think there are different attack scenarios:
Message from a
to b
is replayed on a different node c
: Then including destination pubkey in the payload and including that in the signature would prevent this. For example prune has to do so (otherwise an attacker can completely exclude a node from push messages):
https://github.com/solana-labs/solana/blob/d4ffd909a/core/src/cluster_info.rs#L233-L245
Message from a
to b
is replayed on the same node b
: Then including a nonce in the requests and returning that nonce in the response can help. So that b
can verify if it was still expecting a response from a
for that nonce token, and otherwise discard the message. https://github.com/solana-labs/solana/pull/16512 verifies nonce in repair. cc @sakridge to confirm if that is all done for repair.
https://github.com/solana-labs/solana/blob/d4ffd909a/core/src/serve_repair.rs#L95-L97
a
can keep track of recent (nonce, wallclock)
of requests it has received from b
and discard requests with duplicate nonce token as replayed, and not respond to them.The network receives pull-requests from a spoofed ip address a.b.c.d
. Then the cluster can be hijacked to run a ddos against an ip address outside of the solana cluster. Neither of (1) signing destination pubkey nor (2) including nonce token can help here, as the attacker can include them as well. But ping/pong would prevent this by sending (rate limited) ping packets first to that ip address and only responding to ip addresses which have responded to pings.
So ping/pong wouldn't really do anything for replay attacks. Instead we need both (1) and (2). I will work on adding those to gossip messages. Repair might also need to include and sign the destination pubkey in the message.
cc @sakridge @carllin
AFAICT, repair responses are also not signed. This could be an another spam vector
Problem
Nodes can maliciously replay messages and spam the network
Proposed Solution
it doesn't need to be sent with the message, the receiver and sender can just assume the message ends or starts (whatever is simpler) with the receiver pubkey.
tag: @sakridge @carllin