{"answers":{"affected":"3 open source packages ship an affected version, including github.com/almeidapaulopt/tsdproxy.","exploited":"There is no known exploitation of GHSA-g936-7jqj-mwv8 in the wild and no public exploit code.","fix":"Upgrade github.com/almeidapaulopt/tsdproxy to 1.4.4-0.20260603142855-434819b4421e or later.","what":"GHSA-g936-7jqj-mwv8 is an authentication bypass vulnerability in github.com/almeidapaulopt/tsdproxy, published on 10 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-g936-7jqj-mwv8 and fix it if it is affected.\n\nWhat it is: GHSA-g936-7jqj-mwv8 is an authentication bypass vulnerability in github.com/almeidapaulopt/tsdproxy, published on 10 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-g936-7jqj-mwv8 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/almeidapaulopt/tsdproxy (Go): affected all versions; fixed in 1.4.4-0.20260603142855-434819b4421e\n- github.com/almeidapaulopt/tsdproxy (Go): affected all versions; fixed in 1.4.4-0.20260603142855-434819b4421e\n- github.com/almeidapaulopt/tsdproxy (Go): affected all versions; fixed in 1.4.4-0.20260603142855-434819b4421e\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-g936-7jqj-mwv8/ (Markdown: https://insights.sbomify.com/GHSA-g936-7jqj-mwv8/index.md)","id":"GHSA-g936-7jqj-mwv8","markdown":"https://insights.sbomify.com/GHSA-g936-7jqj-mwv8/index.md","name":"GHSA-g936-7jqj-mwv8","record":{"aliases":["GO-2026-5969"],"analysis":{"component_type":"server_software","fix_type":"patch","impacts":["privilege_escalation","security_bypass"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Tailscale proxy server","requires_auth":"low_privilege","summary":"TSDProxy leaks its internal auth token to backends, allowing local attackers to bypass Tailscale authentication and escalate privileges via the management API.","user_interaction":"not_required","vuln_class":"auth_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## Description\n\nA vulnerability was discovered in TSDProxy where it forwards its internal per-process authentication token to all proxied backend services. When `identityHeaders` is enabled (the default), tsdproxy injects `x-tsdproxy-auth-token` into every upstream HTTP request alongside user identity headers. This token is the same secret used by the management HTTP server to trust forwarded Tailscale identity claims. A backend that receives this token can replay it from localhost to the management port with an arbitrary `x-tsdproxy-id` value, bypassing Tailscale authentication entirely.\n\nThe token is forwarded unconditionally: `ProviderUserMiddleware` always calls `WhoisNewContext` regardless of whether the user is authenticated. In the `ReverseProxy.Rewrite` function, `WhoisFromContext` returns `ok=true` even for zero-value `Whois{}` (unauthenticated or Funnel requests). The `HeaderAuthToken` is set for every request when `identityHeaders=true`.\n\nThe attack requires the backend to reach `127.0.0.1:8080`. This holds in: (1) non-Docker deployments where tsdproxy and a backend run on the same host, (2) Docker host-network-mode containers, (3) containers sharing tsdproxy's network namespace.\n\n## Affected files\n\n- `internal/proxymanager/port.go:123-132`\n- `internal/core/admin.go:160-182`\n\n```go\n// port.go: auth token forwarded regardless of user authentication state\nif identityHeaders {\n    if user, ok := model.WhoisFromContext(r.In.Context()); ok {\n        // ok=true even for empty Whois{} stored by ProviderUserMiddleware\n        r.Out.Header.Set(consts.HeaderAuthToken, core.ProxyAuthToken()) // token sent to backend\n    }\n}\n\n// admin.go: management port trusts x-tsdproxy-id from localhost when token is valid\nfunc ResolveWhois(r *http.Request) model.Whois {\n    if IsLocalhost(r.RemoteAddr) {\n        return model.Whois{\n            ID: r.Header.Get(consts.HeaderID), // attacker-controlled after stealing token\n        }\n    }\n    return model.Whois{}\n}\n```\n\n## Steps to reproduce\n\n1. Deploy tsdproxy on a host (non-Docker) with a backend at `http://localhost:3000`.\n2. Make a request through the Tailscale proxy. The backend receives `x-tsdproxy-auth-token` in the request headers.\n3. From the host, replay the token to the management API:\n\n```bash\n# Capture token from backend headers (e.g., via a header-reflection endpoint)\nTOKEN=$(curl -s http://localhost:3000/debug/headers | python3 -c \"import sys,json; d=json.load(sys.stdin); print(d['headers'].get('X-Tsdproxy-Auth-Token',''))\")\n\n# Replay from localhost to gain admin access\ncurl -H \"x-tsdproxy-auth-token: $TOKEN\" \\\n     -H \"x-tsdproxy-id: attacker\" \\\n     http://127.0.0.1:8080/api/v1/proxies\n# Returns full proxy list with admin access\n```\n\n## Fix\n\nRemove `HeaderAuthToken` from the outgoing backend request, and guard identity-header injection on `user.ID != \"\"`:\n\n```go\n// port.go: only inject headers for actually authenticated users\nif identityHeaders {\n    if user, ok := model.WhoisFromContext(r.In.Context()); ok \u0026\u0026 user.ID != \"\" {\n        r.Out.Header.Set(consts.HeaderID, user.ID)\n        // HeaderAuthToken should NOT be forwarded to backends\n    }\n}\n```\n\n## Impact\n\nAn attacker with code execution in any backend proxied by tsdproxy (on the same host) gains full management API control: restart or pause all proxied services (DoS), enumerate all proxy configurations and backend network topology, and trigger webhook deliveries (SSRF via configured webhook URLs).\n\n## Credits\n\nReported by Vishal Shukla (@shukla304 / @therawdev).\n\n## Sponsorship\n\nThis audit is from an AI-assisted research agent at [sechub.dev](https://sechub.dev). Running it on OSS projects is free for maintainers.","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"TSDProxy: Internal proxy auth token forwarded to backend services enables management API escalation","id":"GHSA-g936-7jqj-mwv8","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"auth_bypass","year":"2026"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"Go","fixed":["1.4.4-0.20260603142855-434819b4421e"],"introduced":["0"],"last_affected":[],"package":"github.com/almeidapaulopt/tsdproxy","purl":null,"source":"GHSA-g936-7jqj-mwv8"},{"ecosystem":"Go","fixed":["1.4.4-0.20260603142855-434819b4421e"],"introduced":["0"],"last_affected":[],"package":"github.com/almeidapaulopt/tsdproxy","purl":"pkg:golang/github.com/almeidapaulopt/tsdproxy","source":"GHSA-g936-7jqj-mwv8"},{"ecosystem":"Go","fixed":["1.4.4-0.20260603142855-434819b4421e"],"introduced":["0"],"last_affected":[],"package":"github.com/almeidapaulopt/tsdproxy","purl":"pkg:golang/github.com/almeidapaulopt/tsdproxy","source":"GO-2026-5969"}],"products":null,"published":"2026-07-10","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"TSDProxy leaks its internal auth token to backends, allowing local attackers to bypass Tailscale authentication and escalate privileges via the management API.","url":"https://insights.sbomify.com/GHSA-g936-7jqj-mwv8/"}