-
Notifications
You must be signed in to change notification settings - Fork 28
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
Denial of Service #1
Comments
Correction: The |
It would certainly be good to prevent this. First steps could include limiting the request body size with warp::filters::body::content_length_limit and throttling client's read stream with tokio::time::throttle. |
I think the biggest problem at the moment is that the feed has an unlimited size. This probably also the reason why joining the chat doesn't work reliably in this scenario, because the client has problems receiving such a large response. Another thing to look at: https://docs.rs/tungstenite/0.10.0/tungstenite/protocol/struct.WebSocketConfig.html (also used by |
max_frame_size was added in |
Small proof of concept of a Denial of Service Attack:
My first thought was that I could just stop reading the responses from the server (
websocket.read_message()
) but then it seems liketokio-tungstenite
detects that and closes the connection:[2020-05-21T09:01:59Z ERROR rusty_chat::server] Client connection error: system error: channel lagged by 351
.Not reading the response and constantly trying to reconnect though is already enough to prevent other clients from joining.
When I start reading the responses as seen in the example above, the Feed will still fill up with messages until at some point the server will be killed because it uses too much memory.
The text was updated successfully, but these errors were encountered: