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

Protect against making HTTP requests to private IPs #11

Open
LLFourn opened this issue Apr 19, 2023 · 0 comments
Open

Protect against making HTTP requests to private IPs #11

LLFourn opened this issue Apr 19, 2023 · 0 comments

Comments

@LLFourn
Copy link
Collaborator

LLFourn commented Apr 19, 2023

And other addresses where it doesn't make sense. There are a few appraoches:

  1. Make using a HTTP proxy mandatory and ask the user to firewall the shit out of it
  2. Use a lower level library like hyper to do HTTP requests instead of reqwest and just deny these IPs in software. This might be handy because it gives us fine grained control over the connections establishment including PKI stuff. But it does mean we'd have to re-implement a lot of stuff that reqwest already gets right.
  3. Use reqwest but parse the URI first, and manually check whether the host is an IP or a hostname. If it's an IP check it then, otherwise build the reqwest client with a custom DNS resolver which refuses to resolve to private IPs.

I think approach (3) is what I would try first.

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

1 participant