CVE-2023-47390

7.5 HIGH

📋 TL;DR

Headscale versions through 0.22.3 write bearer tokens to info-level logs, exposing authentication credentials. This affects all Headscale deployments using the vulnerable versions. Attackers with access to logs could steal tokens and impersonate users or administrators.

💻 Affected Systems

Products:
  • Headscale
Versions: All versions through 0.22.3
Operating Systems: All platforms running Headscale
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments using affected versions are vulnerable regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full compromise of the Headscale control plane allowing attackers to join unauthorized devices to the network, intercept traffic, or gain administrative access to connected systems.

🟠

Likely Case

Unauthorized access to the Tailscale network, allowing attackers to join malicious devices and potentially access internal resources.

🟢

If Mitigated

Limited impact if logs are properly secured with restricted access and monitoring, though token exposure still creates risk.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires access to logs containing the bearer tokens. No authentication bypass is needed once logs are accessed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.22.4 and later

Vendor Advisory: https://github.com/juanfont/headscale/issues/1259

Restart Required: Yes

Instructions:

1. Update Headscale to version 0.22.4 or later. 2. Restart the Headscale service. 3. Rotate all existing bearer tokens as previously logged tokens remain valid.

🔧 Temporary Workarounds

Restrict Log Access

linux

Limit access to Headscale log files to only authorized personnel and systems.

chmod 600 /var/log/headscale/*
setfacl -m u:headscale:r /var/log/headscale/*

Change Log Level

all

Temporarily increase log level to reduce info-level logging, though this may affect debugging.

Edit Headscale config to set log_level: "warn" or higher

🧯 If You Can't Patch

  • Rotate all bearer tokens immediately and monitor for unauthorized usage
  • Implement strict access controls on log storage and transmission

🔍 How to Verify

Check if Vulnerable:

Check Headscale version: if version ≤ 0.22.3, system is vulnerable

Check Version:

headscale version

Verify Fix Applied:

Confirm Headscale version is ≥ 0.22.4 and check logs no longer contain bearer tokens

📡 Detection & Monitoring

Log Indicators:

  • Bearer tokens appearing in info-level logs
  • Unauthorized authentication attempts with logged tokens

Network Indicators:

  • Unexpected devices joining Tailscale network
  • Unusual authentication patterns

SIEM Query:

source="headscale" AND "bearer" AND "token"

🔗 References

📤 Share & Export