Skip to content

DNS Rebinding Protection #350

@benmmurphy

Description

@benmmurphy

Browsing the web will allow an attacker to execute arbitrary code on your machine if you are running better errors.

The attack is performed by having the user visit a page like randomid.dnsrebinder.com:3000 (likely embedded in an iframe) then the DNS entry from randomid.dnsrebinder.com is updated to point to 127.0.0.1. Then the page performs XHR requests which will now be sent to 127.0.0.1. The attacker can then interact with the debug functionality to run code.

The fix is to check the host header in the gem to check that it is a safe host like localhost that we know won't be running bad code or an ip address.

This was my proposed patch to the web_console gem if you need some ideas:

dns_rebinding.patch.txt

More information and a POC for the webconsole attack are available here:

http://benmmurphy.github.io/blog/2016/07/11/rails-webconsole-dns-rebinding/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions