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 check for Host Authorization middleware #1633

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

p8
Copy link

@p8 p8 commented Aug 23, 2021

The Host Authorization middleware protects against DNS rebinding.
This middleware is primarily targeted at the development environment:

It is included in the development environment by default ... In other
environments Rails.application.config.hosts is empty and no Host header
checks will be done.
rails/rails#33145

If someone decides to call config.hosts.clear because it's "only
development", we should warn them they are vulnerable to DNS rebinding.

The Host Authorization middleware protects against DNS rebinding.
This middleware is primarily targeted at the development environment:

> It is included in the development environment by default ... In other
environments Rails.application.config.hosts is empty and no Host header
checks will be done.
rails/rails#33145

If someone decides to call `config.hosts.clear` because it's "only
development", we should warn them they are vulnerable to DNS rebinding.
@p8 p8 force-pushed the add-check-for-config-hosts-clear branch from b9d6803 to 95f66bb Compare August 23, 2021 11:18
@presidentbeef
Copy link
Owner

Hi @p8, thank you for putting this together!

I am pretty sure Brakeman doesn't even look at config/development.rb, though. Only config/production.rb. 🤔

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

2 participants