mirror of
https://github.com/tailscale/tailscale.git
synced 2026-10-31 07:29:36 -04:00
tailscale serve --tcp=<port> unix:<path> dialed the target socket with no check, so pointing it at tailscaled's own LocalAPI socket proxied a tailnet peer straight into the LocalAPI. The LocalAPI authorizes a unix-socket caller by the peer credentials of the dialing process -- tailscaled itself, as root -- so the peer got a write-capable LocalAPI and could change the node's settings. The HTTP proxy path already refused this via isTailscaledSocket; the TCP-forward path, added later, did not. Reject it at config-set time in setServeConfigLocked so "tailscale serve" fails up front, and keep a dial-site guard returning ErrProxyToTailscaledSocket as a backstop for configs set by other means. RELNOTE: tailscale serve no longer proxies to tailscaled's own socket Fixes tailscale/corp#50425 Change-Id: I5ed02e83d32bdfb09c8164907bf38cabcc406169 Signed-off-by: Sam Jean <samj@tailscale.com>