/

CVE-2026-58652

Severity:

HIGH RISK

(7.5)

Command Injection (CWE-78) in OpenWrt Travelmate Service

CVE-2026-58652

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Privilege Escalation to Remote Code Execution as root

Severity:

HIGH RISK

(7.5)

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

A command injection flaw in luci-app-travelmate and the travelmate service allows configuration-level write access to be abused to execute arbitrary commands as root.

When an attacker can modify the travelmate UCI configuration, they can set the auto-login script fields to system binaries and arguments, leading to full device compromise during captive-portal handling.

Affected context

This vulnerability affects OpenWrt systems using the travelmate package and its LuCI front-end (luci-app-travelmate) to manage captive portal auto-login.

It is relevant where:

  • LuCI/rpcd sessions are delegated the luci-app-travelmate write ACL, and
  • Users or services with limited administrative rights are expected to only manage travelmate configuration via the UI, and
  • The travelmate backend service runs as root and consumes UCI configuration for auto-login scripts without additional validation.

In such environments, the logical separation between configuration management and privileged execution is weaker than intended.

Exploit preconditions

  • Attack surface: Local or remote LuCI/rpcd API exposed to authenticated users or delegated accounts.
  • Required access: Ability to obtain a LuCI/rpcd session that holds the luci-app-travelmate write ACL, or otherwise modify the travelmate UCI configuration.
  • Trigger point: Execution of the captive-portal auto-login path (f_check() in travelmate-functions.sh), which reads script and script_args from UCI and runs them as root.
  • Why exploitation is possible: The backend trusts raw UCI configuration values and executes them without enforcing the frontend's path restriction or validating that the script target resides under /etc/travelmate/*.login.

Why this happens

The core issue is a trust boundary violation between configuration-level access and privileged command execution.

The LuCI frontend attempts to constrain the auto-login "script picker" to /etc/travelmate/*.login, but this restriction is only enforced in the UI and not in the backend logic that actually runs as root.

The travelmate service reads script and script_args from UCI and directly passes them into an execution context, effectively allowing arbitrary command paths and arguments to be configured.

This pattern maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where unvalidated, attacker-controlled values are used to construct OS-level commands.

Potential impact

  • Arbitrary command execution as root on the affected OpenWrt device.
  • Full takeover of the router, including modification of firewall rules, DNS settings, and routing.
  • Installation of persistent malware or backdoors on the device.
  • Exfiltration or manipulation of network traffic passing through the router.
  • Use of the compromised device as a pivot point to attack internal network systems.

General mitigation guidance

Effective mitigation focuses on hardening the boundary between configuration and execution and constraining what code the privileged service can run.

General defensive patterns include:

  • Enforcing backend validation to only allow script paths within a strict allowlist (e.g., specific directories or named scripts).
  • Avoiding direct execution of arbitrary paths from configuration; instead, map configuration options to a fixed set of predefined, vetted script identifiers.
  • Treating all configuration values as untrusted input and sanitizing or normalizing them before use in command execution.
  • Running privileged helpers with minimal required functionality and, where possible, dropping privileges before executing externally configurable scripts.
  • Minimizing delegation of broad configuration write ACLs; apply principle of least privilege to LuCI/rpcd roles and limit who can modify auto-login parameters.

How teams detect issues like this

Detection efforts can focus on both code-level analysis and runtime monitoring:

  • Static analysis: Flag code paths where UCI or other configuration values are passed into shell commands, process execution APIs, or shell script contexts without validation or allowlisting.
  • Code review: Look for mismatches between frontend UI restrictions and backend enforcement, especially where UI constraints are assumed to be security controls.
  • Configuration audits: Periodically inspect travelmate (and similar) configuration for suspicious script paths (e.g., /bin/sh, unusual binaries) or unexpected arguments.
  • Policy enforcement: Use CI/CD checks or pre-merge hooks to prevent introduction of new patterns that execute configuration-derived values directly.

Sources

SourceLink
github.comgithub.com/openwrt/luci/security/advisories/GHSA-p35r-3323-6g7g
github.comgithub.com/openwrt/packages/commit/0627b412ee3a760cc4bca9fc8a5b73de8f33ac10
github.comgithub.com/openwrt/packages/commit/71d92bcc9edbc8f95858ce82a8ff5d52500005a2
github.comgithub.com/openwrt/packages/commit/d6e457a1a70a9010195edeafdc0b8eb6e3b0f7f1
vulncheck.comvulncheck.com/advisories/luci-app-travelmate-arbitrary-command-execution-via-uci-script-parameter

Frequently asked

questions

It can be remotely exploitable if the LuCI/rpcd interface is exposed over the network and an attacker can authenticate or abuse delegated access to obtain the luci-app-travelmate write ACL. Otherwise, it is typically exploited by already-authenticated or local users.

An attacker needs the ability to modify the travelmate UCI configuration, commonly via a LuCI/rpcd session with the luci-app-travelmate write ACL or equivalent configuration write permissions. No direct shell access is required prior to exploitation.

The safest pattern is to eliminate arbitrary script execution from configuration: backend logic should map configuration options to a fixed set of predefined scripts or actions, enforce strict allowlists on executable paths, and reject any configuration that deviates from those constraints.

Treat configuration as untrusted input, avoid using it directly in command execution, and ensure that any security restrictions visible in the UI are also enforced in the backend. Apply least-privilege access control to configuration APIs and include checks for configuration-driven execution paths in security reviews and automated analysis.

Find out what's already
exploitable in your codebase.