/

CVE-2026-46368

Severity:

HIGH RISK

(8.8)

Command Injection in luci-app-https-dns-proxy setInitAction

CVE-2026-46368

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-77

Impact:

Authenticated Remote Code Execution as Root

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

An authenticated command injection vulnerability in luci-app-https-dns-proxy allows users with the luci.https-dns-proxy ACL permission to inject shell metacharacters into the name parameter of a ubus RPC call.

When triggered, this can lead to arbitrary command execution as root on devices where the optional luci-app-https-dns-proxy package is installed and exposed.

Affected context

This vulnerability affects OpenWrt devices where:

  • The optional https-dns-proxy backend is installed, and
  • The luci-app-https-dns-proxy LuCI web UI add-on is explicitly installed and enabled, and
  • Users or services are granted the luci.https-dns-proxy ACL permission to invoke ubus RPC methods.

Core OpenWrt firmware remains unaffected; only deployments that have opted in to this specific LuCI add-on and expose its RPC interface are impacted.

Exploit preconditions

  • Attack surface: The ubus RPC endpoint for luci.https-dns-proxy setInitAction, typically reachable via:
  • The LuCI web interface, or
  • Programmatic ubus calls on the device.
  • Required access: Valid authenticated session or credentials with the luci.https-dns-proxy ACL permission, or equivalent ubus access.
  • Trigger point: Supplying a crafted name parameter containing shell metacharacters to the setInitAction ubus method, which is subsequently passed into a shell context.
  • Why exploitation is possible: The name parameter is incorporated into a shell command without sufficient validation, sanitization, or safe argument handling, allowing shell metacharacters to alter command structure and inject attacker-controlled commands.

Why this happens

The underlying issue is an unsafe construction of shell commands using user-controlled data.

In the setInitAction function, the name parameter supplied via ubus is treated as a trusted string and concatenated or interpolated into a command that is executed by a shell.

Because there is no robust validation or encoding, shell metacharacters (such as ;, |, &&, redirections, or command substitutions) can break out of the intended argument context and introduce additional commands.

This behavior aligns with CWE-77: Command Injection, where untrusted input is used in OS command execution without proper neutralization, allowing attackers to influence the command interpreter.

Potential impact

  • Arbitrary command execution as root on the affected OpenWrt device
  • Installation of persistent malware or backdoors on the router
  • Modification of DNS and network traffic routing, potentially enabling traffic interception or redirection
  • Extraction of sensitive configuration data, including Wi‑Fi credentials, VPN keys, or other secrets stored on the device
  • Use of the compromised device as a pivot for attacks against internal networks or as part of a botnet

General mitigation guidance

Mitigation typically focuses on removing direct shell interpretation of user-controlled values and reducing trust in RPC parameters:

  • Refactor command execution paths to use APIs or system calls that accept structured arguments (e.g., exec-like functions) instead of passing concatenated strings to a shell.
  • Treat all ubus and LuCI input as untrusted; apply strict allowlists on expected name values and reject values that do not match known identifiers.
  • Normalize and validate parameters using conservative patterns (e.g., limiting to specific characters, lengths, or enumerated options) before they reach any command execution layer.
  • Run web and RPC components with the least privilege necessary, avoiding root-level execution paths where feasible, and isolate sensitive operations in dedicated, constrained processes.
  • Disable or restrict access to optional UI components like luci-app-https-dns-proxy when not needed, and minimize assignment of the luci.https-dns-proxy ACL permission.

How teams detect issues like this

Organizations can detect and monitor for this class of issue using a combination of code-level and runtime approaches:

  • Static analysis: Configure rules to flag direct use of shell command construction with user-controlled data (e.g., calls that invoke /bin/sh, os.system, popen, or equivalent helpers in LuCI code paths where request parameters are involved).
  • Code review: During manual review, pay close attention to ubus handlers and LuCI controllers that execute system commands; ensure all parameters pass through validation or are mapped to controlled values rather than interpolated directly.
  • Configuration and policy checks: Enforce development policies that prohibit executing shell commands with concatenated strings and require argument-based or API-based execution patterns.
  • Runtime monitoring: Where feasible, log and monitor ubus RPC calls to luci.https-dns-proxy and alert on unusual name values containing shell metacharacters or unexpected patterns.

Sources

SourceLink
github.comgithub.com/stangri/luci-app-https-dns-proxy
exploit-db.comexploit-db.com/exploits/52521
vulncheck.comvulncheck.com/advisories/luci-app-https-dns-proxy-authenticated-command-injection-via-setinitaction

Frequently asked

questions

Exploitation is limited to environments where luci-app-https-dns-proxy is installed and accessible, and where an attacker can obtain authenticated access with the luci.https-dns-proxy ACL permission (or equivalent ubus rights). It is not exploitable on devices that have not installed this specific LuCI package.

Yes. The vulnerable setInitAction ubus method requires authentication and appropriate LuCI ACL permissions. An attacker must either compromise a valid account, abuse misconfigured permissions, or otherwise gain access to a session that can call this method.

Replace any shell-based command construction that includes user-controlled values with APIs that pass arguments as structured parameters, and strictly map incoming values (like name) to predefined, validated options. Avoid running command interpreters when the same functionality can be achieved via system libraries or controlled service interfaces.

Adopt a development practice that treats all external input—including RPC parameters—as untrusted, enforce strict validation and allowlists, and prohibit direct concatenation of such input into shell commands. Combine secure coding guidelines with automated static analysis and targeted code review of any area that executes system commands or runs with elevated privileges.

Find out what's already
exploitable in your codebase.