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

mitmweb: protect against dns rebinding #3243

Merged
merged 2 commits into from
Jul 17, 2018
Merged

Conversation

mhils
Copy link
Member

@mhils mhils commented Jul 11, 2018

This PR attempts to guard mitmweb against DNS rebinding attacks.

See also:

@atx: My understanding is that enforcing the hostname to match '(localhost|\d+\.\d+\.\d+\.\d+)' should effectively mitigate this while still enabling users to access mitmweb from other hosts if they so desire. Do you see errors in my thinking?

In the long term we should probably adopt a jupyter-style solution, but it's more important to get this fixed quickly now.

@Kriechi
Copy link
Member

Kriechi commented Jul 11, 2018

@mhils: do you want to allow IPv6 addresses too?

@atx
Copy link

atx commented Jul 11, 2018

My understanding is that enforcing the hostname to match '(localhost|\d+.\d+.\d+.\d+)' should effectively mitigate this ...

Yes, that should be sufficient.

@mhils
Copy link
Member Author

mhils commented Jul 12, 2018

Thanks @atx! I added support for IPv6 and included an error message for other hostnames, this is ready for final review.

@mhils mhils requested review from Kriechi and cortesi July 12, 2018 02:42
Copy link
Member

@Kriechi Kriechi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the regex - but otherwise fine.

@mhils mhils merged commit 7f464b8 into mitmproxy:master Jul 17, 2018
@mhils mhils deleted the dns-rebinding branch July 17, 2018 12:20
@russell russell mentioned this pull request Jul 30, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants