Skip to content

netbird on macOS exposes port 53 to the public #608

Closed

Description

@theoriginalgri

Describe the problem
Netbird recently introduced the DNS feature. It seems there's a bug on macOS that port 53 is not only accessible from the local host or netbird's network but on any address.

Due to macOS's firewall only being able to control applications and not ports, this requires and additional firewall in front of macOS machines with public ip addresses - otherwise netbird gets completely blocked by the OS. In our case, a we got notified by the BSI (https://www.bsi.bund.de/) that one of our macOS machines in the Hetzner datacenter acts as public DNS resolver.

To Reproduce
Install and start netbird 0.11.3 on macOS (only tried Ventura).

You can already see netbird lists to port 53 on all addresses:

➜  ~ sudo lsof -nP -iUDP | grep ':53'
mDNSRespo   228 _mdnsresponder    6u  IPv4 0x2f4cb6f67acb43d1      0t0  UDP *:5353
mDNSRespo   228 _mdnsresponder    7u  IPv6 0x2f4cb6f67acb4701      0t0  UDP *:5353
netbird     377           root   23u  IPv4 0x2f4cb6f67a72f711      0t0  UDP *:53
netbird     377           root   30u  IPv4 0x2f4cb6f67a73bd71      0t0  UDP *:53063

Use the macOS host to resolve DNS requests from an non-netbird host:

root@grafana:~# dig +short @$MACOS_HOST_PUBLIC_IP netbird.io
54.155.53.106

Expected behavior
DNS resolution is restricted to localhost or hosts from the netbird network.

Additional context
@mlsmaycon assumed on Slack this might be related to miekg/dns#941

Activity

  1. self-assigned this
    on Dec 8, 2022
  2. nazarewk commented on Apr 17, 2025

    @nazarewk
    Contributor

    @theoriginalgri is it still an issue or you in the latest version?

  3. theoriginalgri commented on Apr 22, 2025

    @theoriginalgri
    Author

    @nazarewk To me it looks like this has been solved (running 0.41.3).

    Running the lsof from above, I don't see netbird in the list anymore.

    Also when trying dig with any ip of my local machine, I do not get a response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions