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

refuse empty request-target in HTTP request #3255

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

pajod
Copy link
Contributor

@pajod pajod commented Jul 31, 2024

The shortest origin-form is a single slash, not empty. So refuse request lines that have two consecutive spaces where the URI should be. There should be something there.

Python stdlib explicitly tells us it will not perform validation - and neither does this patch! This patch merely closes the one trivial hole that is of special interest, as it might confuse setups involving proxies and pipe-lining.

A single slash is valid, but nothing at all can be safely refused.

Python stdlib explicitly tells us it will not perform validation.
https://docs.python.org/3/library/urllib.parse.html#url-parsing-security
There are *four* `request-target` forms in rfc9112, none of them can be empty.
@benoitc benoitc merged commit 5c0e157 into benoitc:master Aug 6, 2024
23 checks passed
@benoitc
Copy link
Owner

benoitc commented Aug 6, 2024

LFTM. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gunicorn accepts requests with empty URIs
2 participants