-
Notifications
You must be signed in to change notification settings - Fork 43
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
Panic in server when sending non-ASCII header value #187
Comments
We should not accept non-ASCII characters in headers (it is against the http spec as fare as I am aware), but it should be checked before we do things which make this assumption. This is a bug. |
Hi 👋, I can check the spec and try to draft a pr to fix is non-ascii aren't allowed. Thx! |
I believe the point about the spec is correct but that means we should respond with an error code, not panic. We should never panic regardless of the spec |
I believe #172 represents the same issue |
The spec currently recommends against non-ASCII header values but the only requirement is that the value is in an encoding that is a superset of ASCII and doesn't contain null, so UTF-8 values are completely valid just discouraged. It's not unreasonable to handle it by explicitly returning an error though. |
Found via fuzzing.
Steps to reproduce:
cargo run --example=server
)cat crash | nc localhost 8080
)crash
isand as base64 (to avoid encoding issues)
Full backtrace is long, I put it in the below gist.
https://gist.github.com/5225225/dd931721233609b6e6ce39d0705b0119
The text was updated successfully, but these errors were encountered: