-
Notifications
You must be signed in to change notification settings - Fork 108
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
fix(net): Rate-limit MetaAddrChange::Responded from peers #6738
Conversation
@mpguerra this seems serious enough to block the stable release, but it's a small change so it should be easy to review. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6738 +/- ##
==========================================
+ Coverage 77.92% 78.11% +0.19%
==========================================
Files 308 308
Lines 40874 40879 +5
==========================================
+ Hits 31851 31933 +82
+ Misses 9023 8946 -77 |
Temporary network failure:
https://github.com/ZcashFoundation/zebra/actions/runs/5039819774/jobs/9038203151?pr=6738#step:10:926 |
Is there a corresponding issue for it? It's ok if not, I just want to make sure we track it somehow. |
I didn't open a separate ticket. This is related to #6672, because it was one of the ways that remote peers could easily manipulate their address state inside Zebra. (If we'd fixed this bug earlier, the audit finding might have been low severity, because peer state changes would all have been rate-limited or triggered by the local Zebra node.) Also happy to call it a separate bug if you want. |
Nope, I see I already linked it to the relevant audit issue, it's all I need :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Motivation
There is no limit to the amount of
MetaAddrChange::Responded
updates a peer can send to the shared address book updater channel.This is a remotely-triggerable security issue, likely resulting in a hang or very slow network performance.
Complex Code or Requirements
This code runs concurrently for every peer, then writes to a channel shared between all peers. Writing on the channel blocks if it is full.
Solution
Ping
orPong
message to generate aMetaAddrChange::Responded
MetaAddrChange::Responded
after every successful heartbeat, which is already rate-limited by ZebraReview
This is a security fix that we might want to block the stable release for.
Reviewer Checklist