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

IP address with space may not be canonicallzed as intended. #3

Open
jscannell opened this issue Oct 18, 2019 · 1 comment
Open

IP address with space may not be canonicallzed as intended. #3

jscannell opened this issue Oct 18, 2019 · 1 comment

Comments

@jscannell
Copy link

In urls.go there is this comment:

           // The Windows resolver allows a 4-part dotted decimal IP address to have a
           // space followed by any old rubbish, so long as the total length of the
           // string doesn't get above 15 characters. So, "10.192.95.89 xy" is
           // resolved to 10.192.95.89. If the string length is greater than 15
           // characters, e.g. "10.192.95.89 xy.wildcard.example.com", it will be
           // resolved through DNS.

This is really important as it’s yet another way an attacker could potentially bypass the system. There is a test that covers this case by testing the string "10.192.95.89 xy". However, this test only covers the parseIPAddress function. When this same string is passed through the canonicalURL function it fails because the host is escaped and thus the string passed to parseIPAddress is "10.192.95.89%20xy". It might be a good idea to run all test cases through canonicalURL (which is what I did.)

@thatjiaozi
Copy link
Collaborator

Hi! Thanks for your report, I will submit a fix for this ASAP! Please let us know if you find any other issues with this client library.

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

No branches or pull requests

2 participants