/

CVE-2026-18686

Severity:

CRITICAL RISK

(9.8)

Command Injection (CWE-77) in GL.iNet GL-MT3000 Router

CVE-2026-18686

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-74, CWE-77

Impact:

Remote Code Execution on Network Device

Severity:

CRITICAL RISK

(9.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 vulnerability in the nas-web RPC Wrapper of GL.iNet GL-MT3000 allows attackers to inject arbitrary system commands via the nas-web.add_user function exposed through /cgi-bin/glc.

When user-controlled parameters are passed unsafely into shell commands, a remote attacker can leverage this flaw to execute code on the device, especially in deployments that expose the web or RPC interface to untrusted networks.

Affected context

This issue arises in GL.iNet GL-MT3000 devices running firmware up to version 4.4.5, specifically in environments where:

  • The nas-web RPC Wrapper is enabled and accessible
  • The /cgi-bin/glc endpoint is reachable over the network
  • User-supplied input to nas-web.add_user is processed without robust sanitization or neutralization

Risk is elevated when the management or RPC interface is exposed beyond a trusted administrative network or is reachable by untrusted clients.

Exploit preconditions

  • Attack surface: HTTP/RPC interface on the GL-MT3000 (/cgi-bin/glc endpoint)
  • Required access: Network reachability to the device's management or RPC port; authentication requirements depend on specific configuration
  • Trigger point: Invocation of the nas-web.add_user function with crafted parameters that pass through to shell command execution
  • Why exploitation is possible: User-controlled data is concatenated or embedded into system command lines without proper command or argument neutralization, enabling injection of additional shell metacharacters and commands

Why this happens

The underlying flaw is an instance of command injection (CWE-77) due to improper neutralization of special elements used in OS command strings. Within the nas-web RPC Wrapper, the nas-web.add_user handler appears to build shell commands from request parameters and execute them in the underlying operating system.

Instead of treating input strictly as data (e.g., validated arguments or structured parameters), the implementation allows attacker-controlled content to influence the command structure itself. This behavior aligns with CWE-74 and CWE-77, where failure to sanitize or constrain metacharacters and reserved syntax in inputs leads to unintended command execution.

Potential impact

  • Remote execution of arbitrary system commands on the GL-MT3000 device
  • Complete compromise of the router, including configuration and stored credentials
  • Traffic interception, manipulation, or redirection through the compromised device
  • Use of the router as a pivot point for attacks against internal network hosts
  • Deployment of persistent malware or participation in botnets

General mitigation guidance

Effective mitigation focuses on eliminating direct string-based command construction and enforcing strict separation between data and executable logic. Common secure patterns include:

  • Avoiding shell invocation for user management operations; instead use dedicated system APIs or libraries that do not interpret shell metacharacters
  • Applying rigorous input validation for all RPC parameters, restricting values to well-defined formats (e.g., usernames with whitelists of allowed characters)
  • Using parameterized command execution mechanisms or argument arrays where shell parsing is bypassed entirely
  • Running management and RPC components with least privilege so that, even if misbehavior occurs, the blast radius is limited
  • Restricting exposure of the management and RPC interfaces to trusted administrative networks, reducing opportunities for untrusted input to reach the vulnerable path

How teams detect issues like this

Organizations can identify similar command injection risks through a combination of static and dynamic techniques:

  • Static analysis rules that flag uses of system(), popen(), exec*, or shell invocation APIs where user input influences command strings
  • Code review practices that scrutinize RPC and web handlers for direct concatenation of request parameters into OS command lines
  • Policy-based checks that require non-shell mechanisms for administrative operations like user management and configuration changes
  • Runtime security monitoring on embedded devices, looking for anomalous command executions or unexpected process trees originating from web/RPC daemons

Automated code scanning and firmware security review tools can help surface these patterns before deployment or during regular security assessments.

Sources

SourceLink
github.comgithub.com/coconut652-7/IOT_Vul_Public/tree/main/Glinet/MT3000/nas-web/ADD_USER_ADD_SHARE
vuldb.comvuldb.com/cve/CVE-2026-18686
vuldb.comvuldb.com/submit/856139
vuldb.comvuldb.com/vuln/385612
vuldb.comvuldb.com/vuln/385612/cti

Frequently asked

questions

Yes. If the nas-web RPC Wrapper and /cgi-bin/glc endpoint are exposed over the network, an attacker with reachability can attempt exploitation remotely. The practical scope depends on how the management interface is published and protected.

The attacker must be able to send requests to the device's RPC or web interface. Whether authentication is required depends on the deployment configuration; weak or absent authentication significantly increases risk.

The most robust fix is to remove shell-based command construction from the affected functionality and instead rely on safe, parameterized system APIs that treat all input as data. Alongside this, enforce strict input validation and reject any parameters that do not conform to tightly defined formats.

Design administrative services so they never build shell commands from user input, adopt secure coding standards that prohibit direct use of shell interpreters for handling RPC parameters, and integrate static analysis plus targeted security reviews for any code that interacts with OS-level commands or system utilities.

Find out what's already
exploitable in your codebase.