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

Add a note about default filters potentially blocking #7157

Merged
merged 1 commit into from
Mar 30, 2017

Conversation

wsargent
Copy link
Member

With regards to #7154 there isn't an explicit warning that default filters may impact sites that are upgrading.

I'll make the logs more explicit as well, so a security failure results in a log with SECURITY marker.

Copy link
Member

@gmethvin gmethvin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@schmitch schmitch left a comment

Choose a reason for hiding this comment

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

LGTM.

However I'm still not sure if it was the best idea, to actually set a default set of filters, maybe it would've been better to have filters defined as [] and only change all templates.
Well on the other side people who are familiar with play, can actually just set play.http.filters.

@gmethvin gmethvin merged commit 1309808 into master Mar 30, 2017
@gmethvin gmethvin deleted the doc-add-filters-note branch March 30, 2017 08:15
@PromanSEW
Copy link
Contributor

I think AllowedHostsFilter must be excluded from DefaultHttpFilters in release. It is not needed in most cases.

@fmeriaux
Copy link
Contributor

I agree with @PromanSEW

@wsargent
Copy link
Member Author

AllowedHostsFilter is there because it protects against DNS rebinding attacks. See https://benmmurphy.github.io/blog/2016/07/11/rails-webconsole-dns-rebinding/ for the attack.

This is actually a real thing, and while Play doesn't execute runnables, there's still a fair bit you can do with DNS rebinding. See for example:

So the issue isn't "this isn't needed in most cases" because in general, most security features aren't needed in most cases. It's trivial for users to disable, but now it's something that has to be disabled explicitly, rather than added in.

@wsargent
Copy link
Member Author

@fmeriaux
Copy link
Contributor

Thank you for these interesting articles @wsargent, I understand better.

Would it not be wise to inform the documentation in a few lines of the rather important role of this protection?

I think that knowingly, developers would be less discouraged when problems arise.

@wsargent
Copy link
Member Author

@fmeriaux if you read the documentation on the AllowedHostsFilter page https://playframework.com/documentation/2.6.x/AllowedHostsFilter#Allowed-hosts-filter it says

Play provides a filter that lets you configure which hosts can access your application. This is useful to prevent cache poisoning attacks. For a detailed description of how this attack works, see this blog post. The filter introduces a whitelist of allowed hosts and sends a 400 (Bad Request) response to all requests with a host that do not match the whitelist.
This is an important filter to use even in development, because DNS rebinding attacks can be used against a developer’s instance of Play: see Rails Webconsole DNS Rebinding for an example of how short lived DNS rebinding can attack a server running on localhost.

I think that effectively communicates the role of the filter.

wsargent added a commit to wsargent/playframework that referenced this pull request Apr 6, 2017
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.

5 participants