admin: bind to loopback by default, guard public unauthenticated bind (#11185)

admin: bind to loopback by default, refuse public unauthenticated bind

The admin HTTP server (port 23646) defaulted to binding 0.0.0.0 with
authentication disabled when -adminPassword was not supplied, exposing
the full admin REST API (user creation, credential issuance, bucket
deletion, filer deletion) unauthenticated on the network. This is the
footgun described in GHSA-m3m8-mrgq-hf9h.

Keep the no-auth mode for local dev, but remove the network exposure:

- Add -ip flag (default 127.0.0.1) so the server binds loopback only
  unless the operator explicitly chooses a public address.
- Refuse to start when binding a non-loopback address with no
  -adminPassword and no [https.admin] mTLS. The operator must enable
  auth or use loopback.
- weed mini sets -ip from its existing -ip.bind; the guard does not
  apply because mini calls startAdminServer directly, not runAdmin.

Addresses GHSA-m3m8-mrgq-hf9h.
This commit is contained in:
Chris Lu authored and GitHub committed 2026-09-05 12:48:50 -07:00
1 parent f35e2ccf21
commit 3e85d9ec8e
2 files changed
+51 -5

No files matched your search

+4
View File
@@ -1272,6 +1272,10 @@ func runMini(cmd *Command, args []string) bool {
miniOptions.v.bindIp = miniBindIp
miniOptions.v.masters = pb.ServerAddresses(actualPeersForComponents).ToAddresses()
miniOptions.v.idleConnectionTimeout = miniTimeout
// Admin server binds to the same address as the other mini services.
// The public-bind-without-auth guard in `weed admin` does not apply here
// because mini calls startAdminServer directly, not runAdmin.
miniAdminOptions.ip = miniBindIp
miniOptions.v.dataCenter = miniDataCenter
miniOptions.v.rack = miniRack