-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
deny injection of custom http headers #4818
Comments
Sounds good. |
@xppt this sounds like a security issue. Posting such things on public forums is considered a bad tone security-wise: https://github.com/aio-libs/aiohttp/security/policy. Please consider practicing responsible disclosure next time. |
Not such bad I think. |
A new version of aiohttp has been released, with [an important fix preventing header injection](aio-libs/aiohttp#4818). I looked through the aiohttp changelog and wasn't able to find any breaking changes, so I believe it should be safe to use with gql.
Hello!
I've noticed, that aiohttp is simply concatenating server-response (or client-request) header like this, w/o any validation:
Which may be not okay, if some of the header values were based on user input.
Consider this example:
This code seems to be fine. Unfortunately it is not, since an attacker can craft urls that will force this handler to return any custom http-headers, or skip some of the existing ones, or broke http payload:
and so on.
I think that aiohttp should raise an exception for any http-reason, header-name or header-value that contains \r or \n characters, instead of breaking http payload silently.
Actually this is what flask/werkzeug do for header-value:
The text was updated successfully, but these errors were encountered: