[GH-ISSUE #5846] [Security] homebrew/macOS LPE incorrect netbird permissions #11829

Open
opened 2026-08-05 01:31:13 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @x13a on GitHub (Apr 10, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5846

Installed netbird-ui via homebrew. What we have..

❯ netbird version
0.68.1

First of all lets look at the binary:

❯ which netbird
/opt/homebrew/bin/netbird

❯ ls -la /opt/homebrew/bin/netbird
lrwxr-xr-x  1 lucky  admin  36 Apr  9 16:36 /opt/homebrew/bin/netbird -> ../Cellar/netbird/0.68.1/bin/netbird

❯ ls -la /opt/homebrew/Cellar/netbird/0.68.1/bin/netbird
-r-xr-xr-x  1 lucky  admin  31778626 Apr  8 22:08 /opt/homebrew/Cellar/netbird/0.68.1/bin/netbird

As we can see the binary is owned by the user:admin. Then lets look at the service:

❯ ls -la /Library/LaunchDaemons/netbird.plist 
-rw-r--r--  1 root  wheel  862 Apr  9 16:36 /Library/LaunchDaemons/netbird.plist

❯ cat /Library/LaunchDaemons/netbird.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Disabled</key>
	<false/>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>netbird</string>
	<key>ProgramArguments</key>
	<array>
		<string>/opt/homebrew/bin/netbird</string>
		<string>service</string>
		<string>run</string>
		<string>--log-level</string>
		<string>info</string>
		<string>--daemon-addr</string>
		<string>unix:///var/run/netbird.sock</string>
		<string>--log-file</string>
		<string>/var/log/netbird/client.log</string>
	</array>
	<key>RunAtLoad</key>
	<false/>
	<key>SessionCreate</key>
	<false/>
	<key>StandardErrorPath</key>
	<string>/var/log/netbird.err.log</string>
	<key>StandardOutPath</key>
	<string>/var/log/netbird.out.log</string>
</dict>
</plist>

As we can see the plist is owned by root:wheel. The launch daemon will load /opt/homebrew/bin/netbird as root.

❯ ps aux | grep netbird
root              2627   0.0  0.4 418799232  59200   ??  Ss    7:51PM   0:00.44 /opt/homebrew/bin/netbird service run --log-level info --daemon-addr unix:///var/run/netbird.sock --log-file /var/log/netbird/client.log

Changing /opt/homebrew/bin/netbird or /opt/homebrew/Cellar/netbird/0.68.1/bin/netbird to malicious file will result in loading it with root privileges.

Files that has to be run as root has to be owned by root:wheel.

Originally created by @x13a on GitHub (Apr 10, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5846 Installed `netbird-ui` via `homebrew`. What we have.. ```sh ❯ netbird version 0.68.1 ``` First of all lets look at the binary: ```sh ❯ which netbird /opt/homebrew/bin/netbird ❯ ls -la /opt/homebrew/bin/netbird lrwxr-xr-x 1 lucky admin 36 Apr 9 16:36 /opt/homebrew/bin/netbird -> ../Cellar/netbird/0.68.1/bin/netbird ❯ ls -la /opt/homebrew/Cellar/netbird/0.68.1/bin/netbird -r-xr-xr-x 1 lucky admin 31778626 Apr 8 22:08 /opt/homebrew/Cellar/netbird/0.68.1/bin/netbird ``` As we can see the binary is owned by the `user:admin`. Then lets look at the service: ```sh ❯ ls -la /Library/LaunchDaemons/netbird.plist -rw-r--r-- 1 root wheel 862 Apr 9 16:36 /Library/LaunchDaemons/netbird.plist ❯ cat /Library/LaunchDaemons/netbird.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Disabled</key> <false/> <key>KeepAlive</key> <true/> <key>Label</key> <string>netbird</string> <key>ProgramArguments</key> <array> <string>/opt/homebrew/bin/netbird</string> <string>service</string> <string>run</string> <string>--log-level</string> <string>info</string> <string>--daemon-addr</string> <string>unix:///var/run/netbird.sock</string> <string>--log-file</string> <string>/var/log/netbird/client.log</string> </array> <key>RunAtLoad</key> <false/> <key>SessionCreate</key> <false/> <key>StandardErrorPath</key> <string>/var/log/netbird.err.log</string> <key>StandardOutPath</key> <string>/var/log/netbird.out.log</string> </dict> </plist> ``` As we can see the plist is owned by `root:wheel`. The launch daemon will load `/opt/homebrew/bin/netbird` as `root`. ```sh ❯ ps aux | grep netbird root 2627 0.0 0.4 418799232 59200 ?? Ss 7:51PM 0:00.44 /opt/homebrew/bin/netbird service run --log-level info --daemon-addr unix:///var/run/netbird.sock --log-file /var/log/netbird/client.log ``` Changing `/opt/homebrew/bin/netbird` or `/opt/homebrew/Cellar/netbird/0.68.1/bin/netbird` to malicious file will result in loading it with `root` privileges. Files that has to be run as `root` has to be owned by `root:wheel`.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#11829