-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zebra should limit the number of addresses it uses from a single Addrs response, to avoid address book takeover #1869
Comments
This doesn't affect remote nodes, so it's not a critical security issue. |
Instead, we could eventually implement the DNS seeder retries in #1892. For the moment, our current peer prioritisation should be good enough to avoid most of these issues, particularly after we limit the address book size in #1873. |
Might be needed for #7824 |
Motivation
Zebra accepts up to 1000 addresses from each peer address request. But the Zcash mainnet only has around 200 peers, and the
peerset_initial_target_size
defaults to 75.These limits will be particularly important once we limit the size of the address book (#1873), so that peers can't flood or replace our entire address book.
Solution
Zebra should limit the number of peers it accepts in response to each peer request.
Zebra should choose peers from each peer request using the following algorithm:
peerset_initial_target_size / 2
peers at random, and leave the rest in the connection peer cacheThese designs have security implications, so we shouldn't do them:
remove addresses that are already in the address bookthis can be exploited to fill the address book with new malicious addressessort peers by theirchoosing peers based on untrusted data makes it easier to add new malicious addressesuntrusted_last_seen_time
, newest firstIncrease the defaultwe already crawl in response to unmet demand, so this isn't neededcrawl_and_dial
interval, to compensate for the peers we're discardingThis algorithm makes it much less likely that a majority of Zebra's peers will come from a single peer request, while also limiting the number of extra peer requests that Zebra makes.
Context
zcashd
does not have this issue.The text was updated successfully, but these errors were encountered: