-
-
Notifications
You must be signed in to change notification settings - Fork 578
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
Security: Bypass proxy authentication with HTTP/1.0 requests #1267
Comments
@larsks Unsure if this has started happening after any recent commit or has this been always the case. Nevertheless, thanks for reporting this. Really appreciate it. I'll get this out fixed soon. Best. |
I encountered the same problem and easily reproduced it. Tracking https://github.com/abhinavsingh/proxy.py/blob/develop/proxy/http/proxy/auth.py#L30 The variables here, The value of request.headers was found to be None, so the entire validation logic was skipped if self.flags.auth_code and request.headers: I'm not sure why the Boolean value of request.headers is determined here. My guess is to avoid causing errors in the next line of code A simple repair solution is to determine whether to perform authentication checks if the headers are not involved. Example: https://github.com/dongfangtianyu/proxy.py/blob/develop/proxy/http/proxy/auth.py#L30 |
Thank you @dongfangtianyu for bringing my attention back to this. Do you want to send a PR for the same? Will be happy to review/merge. Best |
Sure, I'm happy to do it. |
* test: Add test case to reproduce bug #1267 * fix: Bypass proxy authentication with HTTP/1.0 requests #1267 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>
Thank you folks, closing this now |
I'll cut a 2.4.4 soon, so that 2.4.3 is no longer the default install which contains this vulnerability. |
Describe the bug
It is possible to bypass proxy authentication by sending an HTTP/1.0 request with no request headers.
To Reproduce
Steps to reproduce the behavior:
proxy.py
asproxy --basic-auth user:secret
content.
You can reproduce this yourself like this:
Expected behavior
proxy.py should return a
407 Proxy Authentication Required
result.Version information
curl
, Pythonrequests
This problem also reproduces with the current
develop
branch (5e02436).The text was updated successfully, but these errors were encountered: