Zebra attempts new peer connections in a fixed, predictable order #1875
Open
6 tasks
Labels
A-network
Area: Network protocol updates or fixes
C-security
Category: Security issues
I-invalid-data
Zebra relies on invalid or untrusted data, or sends invalid data
I-remote-trigger
Remote nodes can make Zebra do something bad
I-slow
Problems with performance or responsiveness
P-Low ❄️
Motivation
Zebra attempts new peer connections in a fixed, predictable order, based on the
untrusted_last_seen_time
gossiped by other peers, and the locallast_success_time
andlast_failure_time
.This design is vulnerable to attacks that take advantage of this specific retry order to starve the local node, replace all the peers of the local node, or target remote nodes.
This design is also vulnerable to issues after a network connection failure, where every peer is in a failed state. It can also get into a failure mode where it cycles through disconnected successful peers, but never tries failed previously successful peers.
This issue is mitigated by:
Due to the large number of mitigations, this is a low-priority issue.
Solution
This fix depends on #1848, #1849 and #1871.
Zebra should choose the next peer to connect to using the "power of two choices" algorithm.
In the following functions:
CandidateSet::next()
Use the "power of two choices" algorithm:
None
This change risks connecting to slightly worse peers, or skipping some peers that would otherwise have been chosen for reconnection.
Ideally, the algorithm should be implemented by the address book. This improves modularity and performance.
Alternatives
We could do nothing, and trust the other fixes to mitigate the worst impacts of this issue.
Context
zcashd
does not have this issue.The text was updated successfully, but these errors were encountered: