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

Websocket chat example prone to DOS. #446

Closed
illisit opened this issue Feb 15, 2020 · 2 comments
Closed

Websocket chat example prone to DOS. #446

illisit opened this issue Feb 15, 2020 · 2 comments

Comments

@illisit
Copy link

illisit commented Feb 15, 2020

If I use the web socket chat example verbatim.
and then open a web-socket using curl.
curl --include --no-buffer --header "Connection: Upgrade" --header "Upgrade: websocket" --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" --header "Sec-WebSocket-Version: 13" http://127.0.0.1:3030/chat
The server becomes completely unresponsive, and the logs spam with
DEBUG warp::filters::ws > websocket poll error: Trying to work with closed connection
indefinitely. I'm not exactly sure why this occurs. Something with curl opening and closing the connection too quickly perhaps?

@illisit illisit closed this as completed Feb 15, 2020
@asonix
Copy link
Sponsor

asonix commented Feb 16, 2020

@Bohdan77 if you solved this issue, could you tell us how?

@illisit
Copy link
Author

illisit commented Feb 16, 2020

@asonix Sorry I didn't think the fix was worth responding, as it's just an example.

The problem is here.
If you simply change the continue to a break, the issue is eliminated.
I'm not sure if there could be errors that should be ignored, instead of closing, however.

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