-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Default Aiohttp request parser HttpRequestParserC
fails, parsing URLs of allowed size.
#2311
Comments
Basically, this is because nginx parser can feed data in chunks, but Excerpt from parser sources:
By the way, it looks like the same is true even for status field. Basically, I recommend not to use C parser until this issue is fixed as it can be a security issue. |
Let me explain more, how it breaks, in this code firstly callback receives the first part of url, which is fine. Then it receives next part of the url, and instead of appending, it tries to parse this chunk as a full URL and fails. |
Should be relatevly easy to fix |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Long story short
Default Aiohttp request parser
HttpRequestParserC
fails, parsing URLs of allowed size (up to 8190 bytes allowed).Expected behaviour
URL parser should not raise unexpected errors, working with URLs of allowed size and length.
Actual behaviour
Invalid URL is actually a last truncated part of original.
Steps to reproduce
Leave environment variable
AIOHTTP_NO_EXTENSIONS
unchanged,False
by default.That makes aiohttp app use default
HttpRequestParser = HttpRequestParserC
.Run your application
Try to access your API endpoint from remote (important - not from same localhost)
response = await client.get('http://<host_ip>:8000/api?ids=uuid1&ids=...&ids=uuid100'
Raised error, described above.
Your environment
Python 3.6.3
Aiohttp 2.2.5
Ubuntu 14.04 LTS
The text was updated successfully, but these errors were encountered: