Skip to main content
HighSecretsOWASP A07:2021CWE-798

How to fix: Tailscale auth key in source

tskey-* values allow joining your tailnet. Rotate immediately if exposed.

Why it matters

An exposed Tailscale auth key allows an attacker to join your private tailnet, giving them full network-level access to every machine in your VPN, including databases, internal services, and admin panels that are not otherwise internet-accessible.

tskey-* values allow joining your tailnet. Rotate immediately if exposed.

How to fix it

  1. 1Revoke the key immediately in the Tailscale admin console under Settings → Keys
  2. 2Check for any unauthorized devices added to your tailnet
  3. 3Use ephemeral keys with short TTLs for automated systems; store them in a secrets manager

Code examples

Revoke Tailscale key via API

bash
# List auth keys to find the compromised one
curl -H 'Authorization: Bearer TAILSCALE_API_KEY' \
  'https://api.tailscale.com/api/v2/tailnet/YOUR_TAILNET/keys'

# Delete the compromised key (replace KEY_ID)
curl -X DELETE \
  -H 'Authorization: Bearer TAILSCALE_API_KEY' \
  'https://api.tailscale.com/api/v2/tailnet/YOUR_TAILNET/keys/KEY_ID'

Store auth key as a secret (never in source)

bash
# Store in environment / secrets manager
export TS_AUTHKEY="tskey-auth-..."

# Use in Docker or systemd, not in code:
docker run -e TS_AUTHKEY="$TS_AUTHKEY" tailscale/tailscale

References

Detected automatically by VulnRadar. The check id is secret-tailscale-key, stable across every scan so you can filter or diff on it.

See every secrets check

Questions

How severe is Tailscale auth key in source?
VulnRadar rates this high severity in the secrets category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id secret-tailscale-key, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Tailscale auth key in source map to?
It maps to CWE-798. In the OWASP Top 10 it falls under A07:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for tailscale auth key in source

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Tailscale auth key in source | VulnRadar