Skip to content
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: Rate-limit inbound peer connection attempts #2901

Closed
Tracked by #2867
teor2345 opened this issue Oct 18, 2021 · 1 comment · Fixed by #2928
Closed
Tracked by #2867

Security: Rate-limit inbound peer connection attempts #2901

teor2345 opened this issue Oct 18, 2021 · 1 comment · Fixed by #2928
Assignees
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

Comments

@teor2345
Copy link
Contributor

teor2345 commented Oct 18, 2021

Motivation

Zebra doesn't rate-limit inbound peer connection attempts.

This makes it easier for an attacker to overwhelm a node with handshake attempts.

It also makes it possible for an attacker to trigger a large number of connections from other nodes, and use Zebra as the target of those connections.

Suggested Design

In accept_inbound_connections, make sure only one connection is accepted per MIN_PEER_CONNECTION_INTERVAL. This applies the rate limit as soon as Zebra gets control of the connection from tokio.

MIN_PEER_CONNECTION_INTERVAL is the existing rate-limit for outbound CandidateSet connections.

Edge Cases

Once a connection has been accepted, we want to spawn it without any delays. Otherwise, Zebra will be slower to respond to peers. And it will disconnect from invalid peers more slowly.

Related Work

These tickets modify the same functions as this ticket:

@teor2345 teor2345 added C-bug Category: This is a bug A-rust Area: Updates to Rust code S-needs-triage Status: A bug report needs triage P-High C-security Category: Security issues I-heavy Problems with excessive memory, disk, or CPU usage I-slow Problems with performance or responsiveness I-unbounded-growth Zebra keeps using resources, without any limit I-remote-node-overload Zebra can overload other nodes on the network A-network Area: Network protocol updates or fixes labels Oct 18, 2021
@teor2345 teor2345 added this to the 2021 Sprint 21 milestone Oct 18, 2021
@teor2345 teor2345 added P-Medium and removed P-High labels Oct 19, 2021
@teor2345
Copy link
Contributor Author

Marking this task as medium-priority, because it is simple, and nothing depends on it.
(Except the beta release.)

@teor2345 teor2345 removed C-bug Category: This is a bug A-rust Area: Updates to Rust code I-heavy Problems with excessive memory, disk, or CPU usage I-slow Problems with performance or responsiveness I-unbounded-growth Zebra keeps using resources, without any limit labels Oct 19, 2021
@oxarbitrage oxarbitrage self-assigned this Oct 20, 2021
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants