Severity:

HIGH RISK

(7.3)

Command Injection in Ziroom ZHOME A0101 Router API

CVE-2026-1802

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-74, CWE-77

Impact:

Remote Code Execution on Network Device

Severity:

HIGH RISK

(7.3)

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

Ziroom ZHOME A0101 1.0.1.0 contains a command injection vulnerability in the macAddrClone function of luci/controller/api/zrMacClone.lua, where the macType argument is unsafely passed into system commands.

A remote attacker who can reach the device's web API can inject arbitrary shell commands through this parameter, potentially gaining full control over the router.

Affected context

This vulnerability occurs in the web management interface of Ziroom ZHOME A0101 routers running firmware version 1.0.1.0.

The affected code resides in the Lua-based LuCI controller endpoint luci/controller/api/zrMacClone.lua, specifically in the macAddrClone function, which processes the macType parameter.

The issue is exposed when the router's HTTP API is reachable over the LAN or, in some deployments, over the WAN if remote management or port forwarding is enabled.

The flaw is present where user-controlled input is incorporated into shell commands without robust sanitization or argument separation.

Exploit preconditions

  • Attack surface: HTTP(S) API of the router's web interface (LuCI-based endpoints).
  • Required access: Network-level access to the management interface (typically from the local network; possibly from the internet if remote access is enabled or misconfigured).
  • Trigger point: HTTP request invoking the macAddrClone functionality with a crafted macType parameter.
  • Why exploitation is possible:
  • The macType parameter is treated as trusted input.
  • Its value is concatenated or interpolated directly into a shell command or command-line string.
  • No proper input validation, escaping, or use of safe command execution APIs is enforced, enabling injection of shell metacharacters.

Why this happens

The core issue is the unsafe construction of shell commands using untrusted input, aligning with CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') and CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component.

In the affected LuCI controller, the macAddrClone function appears to pass the macType parameter into a system call or shell command context without stringent validation or use of argument-based execution primitives.

When web handlers build command strings via concatenation, user-supplied values can introduce shell metacharacters (such as separators, redirection operators, or subshell syntax), allowing the attacker's input to break out of the intended command structure and execute arbitrary commands.

This pattern stems from mixing data and control instructions in the same string, rather than clearly separating user input as data-only arguments.

Potential impact

  • Remote execution of arbitrary system commands on the router.
  • Complete compromise of the device, including configuration, credentials, and stored data.
  • Use of the router as a pivot point for attacks on internal network hosts.
  • Deployment of persistent malware or botnet agents on the device.
  • Traffic interception, DNS hijacking, or modification of routing rules to facilitate man-in-the-middle attacks.
  • Service disruption or denial-of-service by stopping critical services or overloading the device.

General mitigation guidance

Effective mitigation focuses on eliminating the ability of user-controlled data to influence shell interpretation and on minimizing the trust placed in web inputs:

  • Prefer APIs that execute commands using argument arrays instead of shell-constructed strings, ensuring user input is treated strictly as data.
  • Introduce strict allowlists for parameters like macType, limiting values to a small set of known-safe identifiers and rejecting or ignoring anything else.
  • Apply robust input validation and canonicalization for all web-exposed parameters, rejecting unexpected characters (such as shell metacharacters) where commands are involved.
  • Reduce the privileges of the web management process and underlying command execution context, so that a compromise yields minimal system-level access.
  • Isolate sensitive management endpoints from untrusted networks through network segmentation and access control, reducing exposure even if bugs exist.
  • Adopt secure-by-default configurations that disable remote management over the WAN and require explicit, informed opt-in by administrators.

How teams detect issues like this

Detection typically combines code-centric and behavior-centric approaches:

  • Static analysis and code review:
  • Flag uses of generic command execution functions (os.execute, io.popen, sys.call, or similar abstractions) where arguments originate from HTTP parameters without intervening validation or allowlists.
  • Look for string concatenation or interpolation involving request parameters in files like luci/controller/api/*.lua, especially where the result is passed to a shell.
  • Establish review checklists that explicitly call out command construction and shell escape handling as points of scrutiny.
  • Automated scanning:
  • Use SAST tools configured with rules for command injection patterns in Lua and embedded web frameworks.
  • Employ policy-as-code in CI to block changes that introduce new shell invocations using request-derived data.
  • Runtime monitoring:
  • Enable logging of administrative API calls and correlate with unusual system command patterns or spikes in process creation.
  • Deploy network monitoring or intrusion detection systems tuned to identify anomalous requests to router management endpoints, focusing on parameters containing typical injection characters.

Sources

SourceLink
github.comgithub.com/jinhao118/cve/blob/main/ziru_router_command_injection.md
vuldb.comvuldb.com/?ctiid.343975
vuldb.comvuldb.com/?id.343975
vuldb.comvuldb.com/?submit.741842

Frequently asked

questions

It can be, depending on how the router is deployed. If the management interface or relevant API endpoints are exposed to the internet via remote administration features or port forwarding, attackers on the internet may exploit it. If access is restricted to the local network, the threat is limited to adversaries with LAN access or those who have already breached the internal environment.

An attacker needs network access to the router's web interface and the ability to send requests to the endpoint that invokes macAddrClone. No valid credentials may be required if the endpoint is accessible without authentication or if other flaws or weak credentials allow bypassing authentication.

The safest pattern is to avoid shell-based command composition altogether for operations driven by web input. Use high-level system APIs or libraries that encapsulate the required functionality, or strictly parameterized command execution APIs that never interpret user input as shell syntax. Combine this with strong allowlists for parameters and rigorous input validation.

Teams can prevent recurrences by establishing secure coding standards that forbid direct shell invocation with user-controlled data, mandating allowlists and argument-based APIs. Incorporating static analysis into CI pipelines, enforcing security-focused code reviews on management-plane code, and conducting regular threat modeling of web-exposed endpoints all help catch command injection patterns before release.

Find out what's already
exploitable in your codebase.