[GH-ISSUE #759] DNS Rebinding protection? #511

Closed
opened 2026-05-05 06:01:20 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @TobiX on GitHub (Sep 2, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/759

Since it came up again recently (http://bouk.co/blog/hacking-developers/), would it be possible to provide DNS rebinding protection (basically deny access to 127.0.0.1 or kill "suspicious" DNS responses) by default in the browser profiles? Or would that break too many legitimate usecases?

Originally created by @TobiX on GitHub (Sep 2, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/759 Since it came up again recently (http://bouk.co/blog/hacking-developers/), would it be possible to provide DNS rebinding protection (basically deny access to 127.0.0.1 or kill "suspicious" DNS responses) by default in the browser profiles? Or would that break too many legitimate usecases?
gitea-mirror 2026-05-05 06:01:20 -06:00
Author
Owner

@manevich commented on GitHub (Sep 2, 2016):

I think --net=eth0 option is what you need.

<!-- gh-comment-id:244449656 --> @manevich commented on GitHub (Sep 2, 2016): I think `--net=eth0` option is what you need.
Author
Owner

@manevich commented on GitHub (Sep 2, 2016):

Adding this by as default may be difficult, though.
Local proxies, DNS servers, CUPS web interface, etc will be affected.

<!-- gh-comment-id:244450742 --> @manevich commented on GitHub (Sep 2, 2016): Adding this by as default may be difficult, though. Local proxies, DNS servers, CUPS web interface, etc will be affected.
Author
Owner

@TobiX commented on GitHub (Sep 2, 2016):

I just realized that dnsmasq has --stop-dns-rebind, which rejects "local" IPs from upstream name servers. Basically my second idea... Now how to get this into default resolvers?

I just realized that DNSBL return 127.0.0.x too, so blocking DNS responses for that will break DNSBL :(

<!-- gh-comment-id:244462702 --> @TobiX commented on GitHub (Sep 2, 2016): I just realized that dnsmasq has --stop-dns-rebind, which rejects "local" IPs from upstream name servers. Basically my second idea... Now how to get this into default resolvers? I just realized that DNSBL return 127.0.0.x too, so blocking DNS responses for that will break DNSBL :(
Author
Owner

@manevich commented on GitHub (Sep 2, 2016):

--netfilter option of firejail can be used to selectively block access to local IPs/ports.
Block ports browser never need connect to, leaving access to local services user may want access from browser.
While this is not complete protection this can reduce exposure, and may be acceptable in default profile.

I am wrong here, --netfilter is only for new network namespaces.

<!-- gh-comment-id:244468956 --> @manevich commented on GitHub (Sep 2, 2016): ~~`--netfilter` option of firejail can be used to selectively block access to local IPs/ports. Block ports browser never need connect to, leaving access to local services user may want access from browser. While this is not complete protection this can reduce exposure, and may be acceptable in default profile.~~ I am wrong here, `--netfilter` is only for new network namespaces.
Author
Owner

@netblue30 commented on GitHub (Sep 3, 2016):

What happens if you pin down the DNS setting, something like "firejail --dns=8.8.8.8 firefox". In this case 8.8.8.8 goes directly in /etc/resolv.conf. Will firefox still do the rebinding?

<!-- gh-comment-id:244549714 --> @netblue30 commented on GitHub (Sep 3, 2016): What happens if you pin down the DNS setting, something like "firejail --dns=8.8.8.8 firefox". In this case 8.8.8.8 goes directly in /etc/resolv.conf. Will firefox still do the rebinding?
Author
Owner

@manevich commented on GitHub (Sep 3, 2016):

This depends on configuration of DNS server.
Server may be configured to block private addresses (see comment of @TobiX on dnsmasq, for example).
But as 127.0.0.0/8 addresses are returned by DNSBL servers, it seems very unlikely that mainstream DNS servers will employ such protection.

<!-- gh-comment-id:244552499 --> @manevich commented on GitHub (Sep 3, 2016): This depends on configuration of DNS server. Server may be configured to block private addresses (see [comment](https://github.com/netblue30/firejail/issues/759#issuecomment-244462702) of @TobiX on dnsmasq, for example). But as 127.0.0.0/8 addresses are returned by DNSBL servers, it seems very unlikely that mainstream DNS servers will employ such protection.
Author
Owner

@chiraag-nataraj commented on GitHub (Sep 30, 2018):

This seems like something that should be addressed on the DNS server end, not firejail? On the firejail end, I think using a new network namespace is the right way to do this, but as @manevich said, this will break too many usecases. A proper solution should be implemented on the DNS server end, so I'm going to close this.

<!-- gh-comment-id:425685454 --> @chiraag-nataraj commented on GitHub (Sep 30, 2018): This seems like something that should be addressed on the DNS server end, not firejail? On the `firejail` end, I think using a new network namespace is the right way to do this, but as @manevich said, this will break too many usecases. A proper solution should be implemented on the DNS server end, so I'm going to close this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#511
No description provided.