-
Notifications
You must be signed in to change notification settings - Fork 474
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
SSL DOS vulnarability #138
Comments
Thanks for the report. We always used a load balancer that did SSL so this code wasn't battle tested by us. Could you submit it as a pull request? |
It looks like a more general way to mitigate this issue may be to separate out transport_accept and ssl_accept into two phases, such that the acceptor is recycled after the first phase. Any sort of backoff in the emfile scenario should likely apply to any configuration, not really related to SSL specifically. |
mitigate SSL and emfile related conditions per #138
Thanks. Btw, this fix also prevents mochiweb to run out of acceptors when you have slow ssl clients connected to your server. |
It is easy to DOS a mochiweb server with by sending it 10 adapted ssl requests per second.
Mochiweb sleeps 100 ms if a request fails in the accept phase. This is very easy to do when setting up a ssl connection. It can timeout, can have record overflows and what not.
The
timer:sleep(100)
is there to lower the accept rate when the server is out of fds, but it should not be used for other errors.I have patched zotonic's branch of mochiweb like this:
zotonic/mochiweb@2afa95c
The text was updated successfully, but these errors were encountered: