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

DoS protection in PeerHandler #383

Open
Tracked by #707
ariard opened this issue Oct 23, 2019 · 3 comments
Open
Tracked by #707

DoS protection in PeerHandler #383

ariard opened this issue Oct 23, 2019 · 3 comments

Comments

@ariard
Copy link

ariard commented Oct 23, 2019

Was thinking we may need some DoS protection at the PeerHandler, like some noisy peer sending too much ping msgs or unknown message types. May need to take some Duration in do_read_event.

@TheBlueMatt
Copy link
Collaborator

TheBlueMatt commented Oct 24, 2019 via email

@ariard
Copy link
Author

ariard commented Oct 24, 2019

  • make sure all responses to trivial-to-generate messages are roughly smaller than the original message,

What's about me sending you a never-stopping flow of ping messages ? Beyond ensuring responses to be smaller, shouldn't we check also the frequency ? Do we already have check like that in PeerHandler ?

Seems to be an advice in BOLT 1 at least: "SHOULD fail the channels if it has received significantly in excess of one ping per 30 seconds."

@TheBlueMatt
Copy link
Collaborator

For mobile it may make sense to measure bytes received / utility gained (ie how many bytes are they sending us per htlc-addition/-removal/routing graph update) and disconnect if the peer is being too chatty, but, in general, trying to play whack-a-mole with "DoS" issues where someone is just sending you a lot of stuff is error-prone and also not really all that useful. If we want to go down that route, however, we should have some API to limit bandwidth consumption, because that's really what we're talking about (eg on mobile devices where you don't want to use more bandwidth than the user is willing to pay for).

@julianknutsen julianknutsen mentioned this issue Sep 16, 2020
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants