Security: Rate-limit inbound peer connection attempts #2901
Labels
A-network
Area: Network protocol updates or fixes
C-security
Category: Security issues
I-remote-node-overload
Zebra can overload other nodes on the network
Milestone
Motivation
Zebra doesn't rate-limit inbound peer connection attempts.
This makes it easier for an attacker to overwhelm a node with handshake attempts.
It also makes it possible for an attacker to trigger a large number of connections from other nodes, and use Zebra as the target of those connections.
Suggested Design
In
accept_inbound_connections
, make sure only one connection is accepted perMIN_PEER_CONNECTION_INTERVAL
. This applies the rate limit as soon as Zebra gets control of the connection fromtokio
.MIN_PEER_CONNECTION_INTERVAL
is the existing rate-limit for outboundCandidateSet
connections.Edge Cases
Once a connection has been accepted, we want to spawn it without any delays. Otherwise, Zebra will be slower to respond to peers. And it will disconnect from invalid peers more slowly.
Related Work
These tickets modify the same functions as this ticket:
The text was updated successfully, but these errors were encountered: