/

CVE-2026-57999

Severity:

HIGH RISK

(8.8)

Command Injection (CWE-78) in luci-app-tailscale Login RPC

CVE-2026-57999

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution with Root Privileges

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

luci-app-tailscale-community contains a command injection flaw in the tailscale.do_login RPC endpoint that lets authenticated users run arbitrary shell commands as root.

The issue occurs when user-controlled loginserver and loginserver_authkey values are embedded in a double-quoted shell command without proper escaping, enabling shell substitutions such as $() to be evaluated.

Affected context

This vulnerability appears in environments using luci-app-tailscale-community to manage Tailscale through LuCI RPC calls.

It is relevant when:

  • The tailscale.do_login RPC method is exposed to authenticated LuCI users or API clients
  • User-supplied loginserver or loginserver_authkey values are passed directly into shell commands
  • The underlying system executes these commands with elevated (root) privileges

Exploit preconditions

  • Attack surface: LuCI RPC interface (tailscale.do_login method)
  • Required access: Authenticated access to the LuCI interface or the corresponding RPC endpoint
  • Trigger point: Submission of crafted loginserver or loginserver_authkey parameters that include shell substitution syntax (e.g., $() or backticks)
  • Why exploitation is possible: User-controlled data is interpolated into a double-quoted shell command without proper quoting or sanitization, allowing the outer shell to interpret and execute embedded commands before argument parsing

Why this happens

The root cause is the construction of shell commands by concatenating untrusted input directly into a command string executed by a shell.

Within the tailscale.do_login implementation, user-controlled parameters (loginserver and loginserver_authkey) are placed inside double quotes but not escaped, which does not prevent command substitution or other shell expansions.

This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where user input is treated as part of executable shell syntax instead of as opaque data.

Potential impact

  • Authenticated users can execute arbitrary OS commands as root on the device
  • Complete compromise of the affected system, including configuration and stored credentials
  • Ability to install persistent malware or backdoors
  • Lateral movement to other systems reachable from the compromised device
  • Disruption of network services managed via Tailscale or LuCI

General mitigation guidance

Effective mitigation typically focuses on removing shell interpretation of untrusted data and reducing privilege of command execution.

Common defensive patterns include:

  • Avoid building shell command strings from user input; instead, use parameterized process execution APIs that do not invoke a shell
  • If shell usage is unavoidable, strictly escape or neutralize special characters and disallow command substitution syntax in user-supplied fields
  • Validate loginserver and loginserver_authkey against expected formats (e.g., hostnames, URLs, key patterns) before use
  • Run auxiliary command-executing components with least privilege and minimize the commands they are permitted to invoke
  • Separate configuration handling from command execution so user input cannot directly affect shell syntax

How teams detect issues like this

Organizations can detect similar command injection risks by:

  • Using static analysis rules that flag string concatenation or interpolation of user input into shell-executing APIs (e.g., system, popen, os.execute)
  • Reviewing RPC and web handler code for patterns where parameters are passed directly into command lines, especially within quoted shell strings
  • Enforcing coding guidelines that prohibit shell-based command construction with untrusted data and require safe process execution wrappers
  • Applying automated security testing or fuzzing that injects command substitution patterns (like $() or ...) into parameters and monitors for unexpected behavior

Sources

SourceLink
github.comgithub.com/openwrt/luci/security/advisories/GHSA-xwc5-mx58-rh35
vulncheck.comvulncheck.com/advisories/luci-app-tailscale-community-command-injection-via-tailscale-do-login-rpc

Frequently asked

questions

Exploitation is limited to environments where users can reach the tailscale.do_login RPC method, but any authenticated user with such access can potentially leverage it for full system compromise.

Not necessarily. The key requirement is authenticated access to the LuCI or RPC interface that exposes tailscale.do_login; if non-admin users can invoke it, they may also be able to exploit the bug.

The most robust fix is to eliminate shell command construction with untrusted data and instead call Tailscale or system utilities through parameterized process execution APIs that treat user input as data, not shell syntax.

Adopt secure coding practices that forbid shell-based concatenation of user input, enforce strict input validation for RPC parameters, review management interfaces for command execution patterns, and integrate automated checks for OS command injection into the development and CI pipeline.

Find out what's already
exploitable in your codebase.