-
Notifications
You must be signed in to change notification settings - Fork 106
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
Security: Stop routing inventory requests by peer address #3090
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
teor2345
added
A-dependencies
Area: Dependency file updates
P-Medium
C-security
Category: Security issues
I-remote-node-overload
Zebra can overload other nodes on the network
I-invalid-data
Zebra relies on invalid or untrusted data, or sends invalid data
A-network
Area: Network protocol updates or fixes
labels
Nov 23, 2021
teor2345
changed the title
Peer set addr key
Security: Stop routing inventory requests by peer address
Nov 23, 2021
teor2345
force-pushed
the
peer-set-addr-key
branch
from
November 23, 2021 02:33
45c0946
to
7849ca6
Compare
3 tasks
teor2345
commented
Nov 23, 2021
teor2345
commented
Nov 23, 2021
teor2345
commented
Nov 23, 2021
teor2345
force-pushed
the
peer-set-addr-key
branch
from
November 23, 2021 04:22
8e57d10
to
c53a621
Compare
jvff
previously approved these changes
Nov 23, 2021
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. I just added a few minor optional suggestions.
Also improve documentation and logging.
teor2345
force-pushed
the
peer-set-addr-key
branch
from
November 23, 2021 22:54
f0a0faa
to
827069a
Compare
I applied the suggested minor changes, so I'm going to admin-merge this to unblock #2262. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-dependencies
Area: Dependency file updates
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-node-overload
Zebra can overload other nodes on the network
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The peer set uses integer-based indexing, which makes it harder to drop peers. Using address-based keys will make ticket After network upgrade activation, close existing connections to outdated peers #2262 easier to implement.
The peer set routes inventory requests based on the peer address order in a
HashMap
. This is a security issue, because it allows a single peer to control our inventory responses. It could also overload peers by directing all the requests to them.Solution
indexmap
dependency, which is niceReview
@jvff can review this PR, it blocks #2262.
This PR is based on PR #3091 to avoid unrelated test failures.
Reviewer Checklist
Follow Up Work
We might want to do more refactors on the peer set, but we're focusing on bug fixes at the moment.