Unauthenticated access to dashboard control endpoints, API, and live access-log streams under the documented default deployment
Description
In the documented default deployment of tsdproxy (the docker-compose.yaml snippet shown in docs/content/docs/getting-started.md publishes the management port with ports: "8080:8080", and the generated default tsdproxy.yaml ships with http.hostname: 0.0.0.0 and no admins: entries), any user on the same network as the host can:
- Pause, resume, restart, or force a Tailscale re-auth of every proxy without authentication.
- Enumerate all proxies, their target container IDs, target images, Tailscale URLs, tags, ephemerality, ports, and target URLs without authentication.
- Subscribe to a live Server-Sent-Events log stream for every proxy whose
tsdproxy.dashboard.visiblelabel is the default (true), receiving the URL path of every request made by authenticated Tailscale users to internal services proxied via tsdproxy.
The access-log stream is never wrapped in the admin middleware (internal/dashboard/dash.go:51), so even on a hardened install with a populated admins: allowlist the log streams remain unauthenticated.
The control endpoints (/api/proxy/{name}/restart|pause|resume|reauth, /api/webhook/test) are wrapped in core.AdminMiddleware() (internal/dashboard/dash.go:54-57, internal/api/api.go:45), but AdminMiddleware() is a no-op when config.Config.Admins is empty:
// internal/core/admin.go
func AdminMiddleware() Middleware {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
admins := config.Config.Admins
if len(admins) == 0 {
next.ServeHTTP(w, r) // <-- bypass
return
}
...The shipped default for Admins is empty (internal/config/config.go:62-68), so this branch is taken on first run.
When Admins is non-empty, identities from the loopback range (127.0.0.0/8 and ::1) are trusted to declare themselves via the x-tsdproxy-id / x-tsdproxy-username headers (internal/core/admin.go:69-84). Any process able to reach the management port from the host's loopback can therefore impersonate any allowlisted admin.
Impact
- LAN-adjacent attacker can pause / restart / reauth all proxies, causing denial-of-service or forcing operators to re-enter Tailscale auth flows.
- LAN-adjacent attacker can enumerate the entire tsdproxy fleet (
GET /api/v1/proxies,GET /api/v1/proxies/{name}/ports), leaking internal hostnames, target container IDs, target URLs, and Tailscale tags. - LAN-adjacent attacker can stream live URL paths for every authenticated Tailscale user hitting internal services (
GET /stream/{name}/logs); this commonly leaks API tokens / session IDs in query strings, file names, internal API structure, etc. - Localhost-adjacent attacker (any other container on the same bridge, any local user) bypasses a hardened
admins:allowlist via spoofed identity headers.
Affected versions
Reproduced against master (commit 6a394045c9fa, post-v2.1.0, 2026-05-16). The vulnerability is present at least from the introduction of AdminMiddleware.
Proof of concept
Unit tests added in internal/core/admin_security_test.go:
TestAdminMiddleware_NoOpWhenAdminsEmpty— proves aPOST /api/proxy/{name}/restartfrom192.168.1.50:54321with no Tailscale identity reaches the protected handler whenAdmins == nil.TestAdminMiddleware_BypassViaSpoofedHeadersFromLocalhost— proves that withAdmins = ["alice"], an attacker on127.0.0.1:54321settingx-tsdproxy-id: alicereaches the protected handler.TestIsLocalhost_AcceptsIPv4LoopbackRange— confirms the helper accepts the full 127.0.0.0/8 range (and ::1), widening the localhost-spoof surface.
All three tests PASS against latest master:
=== RUN TestAdminMiddleware_NoOpWhenAdminsEmpty
admin_security_test.go:49: CONFIRMED: AdminMiddleware is a no-op when Admins is empty;
unauthenticated 192.168.1.50:54321 reached the protected handler
--- PASS: TestAdminMiddleware_NoOpWhenAdminsEmpty (0.00s)
=== RUN TestAdminMiddleware_BypassViaSpoofedHeadersFromLocalhost
admin_security_test.go:93: CONFIRMED: spoofed x-tsdproxy-id header from 127.0.0.1:54321
bypasses the admin allowlist
--- PASS: TestAdminMiddleware_BypassViaSpoofedHeadersFromLocalhost (0.00s)
=== RUN TestIsLocalhost_AcceptsIPv4LoopbackRange
--- PASS: TestIsLocalhost_AcceptsIPv4LoopbackRange (0.00s)
PASS
ok github.com/almeidapaulopt/tsdproxy/internal/core 0.651sThe log-stream route is unguarded by static inspection of internal/dashboard/dash.go:51 (no adminMW wrapper, contrast with lines 54–57).
Suggested remediation
- In
AdminMiddleware(), treat an emptyAdminslist as deny-by-default for write endpoints when the request is not over a Tailscale identity, or refuse to start with a populated config that includes an HTTP listener bound to a non-loopback address and an emptyAdminsslice. - Wrap
/stream/{name}/logs(and/stream) in the admin middleware, or in a less privileged Tailscale-identity middleware (ProviderUserMiddleware), since these streams reveal request paths of authenticated end-users. - Stop trusting
x-tsdproxy-*headers based onIsLocalhost(r.RemoteAddr). Either authenticate the trusted reverse-proxy hop with a per-process shared secret, or refuse to honour these headers on the management listener entirely. - Change the default
http.hostnameto127.0.0.1and update the getting-started docs to require an explicit override before publishing the port. - Document — and enforce in code — that
tsdproxy.dashboard.visiblecontrols log-stream visibility too.
CVSS
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H — 8.8 High.
Attack vector is Adjacent (LAN). Privileges Required is None. Confidentiality, Integrity, and Availability of the management surface are all compromised.
Credit
Reported by an external security researcher under the project's responsible-disclosure policy.
---
Reported by AI Agent sechub.dev and Vishal Shukla (@shukla304)
Support
If this disclosure was useful and you would like to support continued open-source security research and responsible-disclosure work, you can sponsor at github.com/