/

CVE-2026-58000

Severity:

HIGH RISK

(8.8)

Command Injection (CWE-78) in LuCI OpenVPN generateKey

CVE-2026-58000

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command 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

A command injection flaw in luci-proto-openvpn's generateKey ubus method allows user-controlled data to be embedded directly into a shell command without proper quoting or escaping.

An authenticated LuCI user with access to OpenVPN protocol configuration can abuse the cl_meta parameter to execute arbitrary commands as root via popen, making deployments highly sensitive to misconfigured access controls.

Affected context

This vulnerability manifests in OpenWrt systems using the luci-proto-openvpn package where key generation is exposed via the generateKey ubus method.

It becomes relevant when LuCI users are granted permissions to configure OpenVPN profiles and can supply the cl_meta parameter.

In environments where administrative access is broadly shared or delegated, the risk increases because ubus operations may be invoked with elevated privileges tied to system configuration workflows.

Exploit preconditions

  • Attack surface: Web-based LuCI OpenVPN configuration interface and associated ubus methods.
  • Required access: Authenticated LuCI user with OpenVPN protocol configuration rights or equivalent ubus invocation permissions.
  • Trigger point: Invocation of the generateKey ubus method where cl_meta is passed into a shell command executed via popen.
  • Why exploitation is possible: The cl_meta parameter is interpolated into a shell command without proper quoting, escaping, or validation, allowing shell metacharacters to alter command execution flow.

Why this happens

The underlying bug is a classic command injection pattern where untrusted input is concatenated into a shell command string and executed via a function such as popen.

Instead of treating cl_meta as data, the implementation allows it to participate in shell parsing, so special characters (e.g., pipes, semicolons, redirections) are interpreted as control sequences.

This behavior aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where lack of input neutralization combined with shell-based execution enables attackers to extend or replace the intended command.

Potential impact

  • Arbitrary command execution with root privileges on the affected OpenWrt device.
  • Installation of persistent backdoors or modification of system startup scripts.
  • Exfiltration or tampering of configuration files, VPN keys, and logs.
  • Disruption of network services, including VPN connectivity and routing behavior.
  • Pivoting to other internal devices via the compromised router or gateway.

General mitigation guidance

Effective mitigation focuses on removing direct shell interpretation of user-controlled data and reducing trust in configuration inputs.

Common defensive patterns include:

  • Replacing shell-based command construction with direct system calls or library APIs that treat parameters as data rather than command text.
  • Applying strict validation and allowlists to configuration parameters like cl_meta, limiting accepted values to safe, well-defined formats.
  • Ensuring any remaining command-line invocations use proper escaping or safe argument passing mechanisms to avoid shell parsing of untrusted content.
  • Running web configuration components with least-privilege and separating key-generation logic from high-privilege contexts where practical.
  • Restricting configuration capabilities to trusted administrators and auditing access policies for ubus and LuCI operations.

How teams detect issues like this

High-level detection approaches typically aim to identify unsafe command construction patterns and privilege misuse:

  • Static analysis rules that flag use of popen, system, or similar APIs when they are fed concatenated or formatted strings containing user-supplied data.
  • Code review checklists that call out any shell command assembly and require reviewers to verify parameter handling, quoting, and validation logic.
  • Policy-based controls that prohibit direct shell invocation for sensitive operations like key generation and enforce library-based alternatives.
  • Automated security scanning tools integrated into CI pipelines to surface CWE-78 patterns and track remediation over time.

Sources

SourceLink
github.comgithub.com/openwrt/luci/commit/e4ff45ecbc6ad212951815c8c99b2749fbd7de6b
github.comgithub.com/openwrt/luci/security/advisories/GHSA-pm9w-522m-8rrh
vulncheck.comvulncheck.com/advisories/luci-proto-openvpn-command-injection-via-cl-meta-parameter-in-generatekey

Frequently asked

questions

Yes, if the LuCI interface or equivalent ubus access is exposed over the network and an attacker can authenticate as a user with OpenVPN configuration rights; exploitation then occurs via crafted cl_meta values.

The attacker must have authenticated access to the LuCI interface (or an API client using ubus) with permissions to invoke the generateKey method or manage OpenVPN protocol settings.

The most robust fix is to eliminate shell-based command construction and instead use safe library functions or APIs that accept structured parameters, combined with strict validation of all configuration inputs.

Design code so that user-controlled data is never passed through shell interpreters; enforce input validation and allowlists, adopt secure coding guidelines for command execution, and use static analysis plus peer review to flag CWE-78 patterns early.

Find out what's already
exploitable in your codebase.