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

Header DoS (surf#298) #186

Open
jbr opened this issue Apr 7, 2021 · 0 comments
Open

Header DoS (surf#298) #186

jbr opened this issue Apr 7, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@jbr
Copy link
Member

jbr commented Apr 7, 2021

this is a mirror issue for http-rs/surf#298

surf will use an unbounded amount of memory if the server sends a single infinitely large header. surf has some DoS prevention (see #289) but it only protects from an infinite amount of headers, not from a single infinitely large header.

You can reproduce the issue by running the following in Linux console and then connecting to localhost:8080 with surf:

( echo -e "HTTP/1.1 200 OK\r"; echo -n "Huge-header: "; yes A | tr -d '\n' ) | nc -l localhost 8080

Tested using this code for surf. You can inspect the Cargo.lock to know the exact dependency versions.

I've only tested the async-h1 backend; I don't know if the other backends are affected.

@Fishrock123 Fishrock123 added the bug Something isn't working label Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants