-
Notifications
You must be signed in to change notification settings - Fork 2
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
Too easy to avoid hostname blocklist in safe_requests
#14
Comments
There's actually a large number of ways to express 192.168.1.1 as a valid IPv4 address. Here's a small sample of IP addresses that all resolve to 192.168.1.1:
https://linux.die.net/man/3/inet_aton
|
safe_requests
@tjs-intel thanks this is also extremely helpful feedback. It would be good to see whether there's some prior art for this kind of thing or whether we should just build it ourselves. |
The C implementation of But you could also enforce that the IPv4 address conforms to the 4-part dotted decimal format, and raise some kind of exception if it doesn't. |
That seems reasonable to me; @matt- any thoughts? |
For your consideration https://github.com/stripe/smokescreen |
@tjs-intel this is pretty interesting! It would be cool if there were Python bindings or if a similar project existed for native Python. In either case maybe we can use it for inspiration here. |
Need to harden against all possible permutations allowed by inet_aton https://linux.die.net/man/3/inet_aton. Should be easiest to attempt to parse the host with inet_aton and check the resulting integer.
The text was updated successfully, but these errors were encountered: