Security: Limit the number of initial connection attempts to seed peers #2900
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
Sometimes, Zebra can get over a hundred IP addresses from the DNS seeders.
Then Zebra attempts to connect to each of these IP addresses.
If Zebra gets caught in a restart loop, this is a denial of service risk.
This might also fix bugs like #2905, if the hang happens because a channel is full.
Suggested Design
Limit the number of initial seed IP addresses to
peerset_initial_target_size
inadd_initial_peers
. This applies the rate limit before Zebra does any work.peerset_initial_target_size
is an existingzebra-network
config. It's used to initialise theCandidateSet
's outbound peer connection demand.Edge Cases
The limit shouldn't favour IPv4 or IPv6 addresses.
We should impose the limit before we connect to any peers. That way, we do as little work as possible on dropped addresses.
Rejected Alternatives
We could use the channel mechanism from #2904, but it's more complicated. It might also be more fragile while Zebra is starting up, because some channels block until Zebra has done its first crawl.
Related Work
These tickets modify the same functions as this ticket:
The text was updated successfully, but these errors were encountered: