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 #383

Open
leoliu opened this issue Aug 8, 2019 · 2 comments
Open

DoS #383

leoliu opened this issue Aug 8, 2019 · 2 comments

Comments

@leoliu
Copy link
Contributor

leoliu commented Aug 8, 2019

Make a HEAD or GET request using curl:

curl -I -H "transfer-encoding: chunked" url_to_yaws_server

which should tie up an acceptor for minutes. Start a few more such requests to tie up all acceptors.

@vinoski
Copy link
Collaborator

vinoski commented Aug 9, 2019

I'll look into it. It's likely that some streaming process needs a timeout.

@leoliu
Copy link
Contributor Author

leoliu commented Aug 9, 2019

Replace transfer-encoding with content-length to get a similar issue. Post data with mismatching content-length also ties up an acceptor.

curl -H "content-length: 5" --data "abc" URL_YAWS_SERVER

There is also the case of a slow client for example one that connects and then sends one byte every 10 seconds (See Slowloris).

All these code paths eventually reach yaws:cli_recv/3 which do a recv on the socket with a default timeout #gconf.keepalive_timeout.

nginx seems to handle these cases safely and sensibly.

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