-
Notifications
You must be signed in to change notification settings - Fork 294
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
CRLF injection via new line characters in URI #237
Labels
Comments
Thanks for the report! I'll look into this and try to get it fixed ASAP. |
mplanchard
added a commit
that referenced
this issue
Jan 24, 2019
Resolves #237 Previously, we were not running any sort of URL escaping on values passed in from the client that were used for redirects. This allowed injection attacks via URL encoded newlines in the original request. This update ensures that all user-supplied paths that are used as components of redirects are passed through `urllib.parse.quote()` (or the python 2 equivalent) prior to being used in a redirect response.
mplanchard
added a commit
that referenced
this issue
Jan 24, 2019
Resolves #237 Previously, we were not running any sort of URL escaping on values passed in from the client that were used for redirects. This allowed injection attacks via URL encoded newlines in the original request. This update ensures that all user-supplied paths that are used as components of redirects are passed through `urllib.parse.quote()` (or the python 2 equivalent) prior to being used in a redirect response. Also specified 127.0.0.1 rather than 0.0.0.0 (the default) in server tests to avoid triggering firewall dialogs when testing on MacOS
#238 I think should resolve this. At least it fixes it when running locally for me, on python 2 and 3. Could you take a look and see what you think, if you've got time? |
Resolved for me! Cheers. |
Pixel quality |
1 similar comment
Pixel quality |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
pypiserver doesn't escape new line characters when redirecting users. I'm not too sure if this is only in the default installation, or that if users used a redirect functionality it would additionally be vulnerable.
Steps to Reproduce
Impact
Create arbitrary HTTP responses, set malicious cookies, potential for XSS depending on implementation (i.e. location header doesn't redirect to a valid host and therefore displays whatever content is available)
The text was updated successfully, but these errors were encountered: