Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
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. |
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: