/

CVE-2026-18614

Severity:

CRITICAL RISK

(9.8)

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

CVE-2026-18614

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-74, CWE-77

Impact:

Remote Code Execution on Network Router

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 GL-iNet GL-MT3000 router allows attacker-controlled data in the port parameter of the s2s.enable_echo_server function to be executed as system commands.

When the router processes crafted requests to /cgi-bin/glc in the s2s.so native plugin, an unauthenticated remote attacker may execute arbitrary code with the device's privileges.

Affected context

This vulnerability arises in GL-iNet GL-MT3000 devices (firmware up to 4.4.5) within the web management interface that exposes /cgi-bin/glc.

The affected s2s.enable_echo_server function processes a port argument originating from HTTP requests and passes it into backend logic implemented by the s2s.so native plugin.

In deployments where the router's administration interface is reachable over the local network or internet, and where this endpoint is exposed, the vulnerable code path can be reached.

Exploit preconditions

  • Attack surface: HTTP interface on the GL-MT3000 router, specifically the /cgi-bin/glc endpoint.
  • Required access: Network access to the router's management HTTP port; depending on configuration, this may be LAN-only or internet-exposed.
  • Trigger point: Invocation of s2s.enable_echo_server with a crafted port parameter that injects shell metacharacters or additional commands.
  • Why exploitation is possible: The port value is incorporated into a shell or command-line context without strict validation, sanitization, or proper parameterization, allowing the attacker's input to break out of the intended argument boundary.

Why this happens

The root cause is improper handling of externally supplied input that is used to construct operating system commands, matching CWE-77: Command Injection and CWE-74: Improper Neutralization of Data in Output.

Instead of treating the port parameter as untrusted data and strictly constraining it to a validated numeric range or using safe system call interfaces, the implementation appears to interpolate the value directly into a shell command or similar execution context.

This pattern allows attacker-controlled characters (such as shell metacharacters, pipes, or command separators) to alter the structure of the command, resulting in arbitrary command execution under the privileges of the web process on the router.

Potential impact

  • Remote execution of arbitrary commands on the router's operating system.
  • Installation of persistent malware, backdoors, or proxy services on the device.
  • Interception, modification, or redirection of network traffic passing through the router.
  • Retrieval or manipulation of configuration data, including Wi-Fi and VPN credentials.
  • Use of the compromised router as a pivot point for further attacks inside the local network.

General mitigation guidance

Effective mitigation focuses on eliminating direct command construction from user input and reducing the trust boundary of exposed management interfaces.

Pattern-based mitigation strategies include:

  • Constraining parameters such as port to strict, validated formats (e.g., numeric-only, within allowed ranges) before use.
  • Replacing shell-based command execution with safer APIs that perform argument separation (for example, direct system calls, libraries, or framework abstractions that avoid shell interpretation).
  • Encapsulating native plugin functions behind hardened input-validation layers, ensuring all CGI parameters are validated centrally.
  • Applying least-privilege principles to web and plugin processes, so that even if a command is executed, its ability to modify the system is minimized.
  • Limiting exposure of the administrative web interface to trusted networks, and disabling unnecessary remote management features to narrow the attack surface.

How teams detect issues like this

Detection often combines code-level analysis with runtime monitoring.

High-level approaches include:

  • Static analysis rules that flag string concatenation or interpolation of HTTP parameters into command execution APIs (e.g., system, popen, shell calls) within CGI handlers and native plugins.
  • Manual code review focusing on CGI endpoints such as /cgi-bin/glc, ensuring all parameters that reach s2s.so are validated and not used directly in shell contexts.
  • Configuration and policy checks that require all router firmware components to route external inputs through centralized validation frameworks.
  • Runtime monitoring or logging of unusual commands invoked by web-facing processes, correlating them with HTTP requests to identify exploitation attempts.
  • Use of automated firmware analysis tools that scan embedded web interfaces for command injection patterns and unsafe native plugin usage.

Sources

SourceLink
github.comgithub.com/StrTzz123/iot_vul/blob/main/GL-iNet/MT3000/4.4.5/s2s_enable_echo_server_glc_rce/CVE.md
vuldb.comvuldb.com/cve/CVE-2026-18614
vuldb.comvuldb.com/submit/851558
vuldb.comvuldb.com/vuln/385534
vuldb.comvuldb.com/vuln/385534/cti

Frequently asked

questions

It can be, depending on how the router is configured. If the administrative HTTP interface or relevant CGI endpoints are exposed to the internet, remote attackers on the wider internet may exploit it; otherwise, attackers on the local network remain a threat.

The attacker must be able to send HTTP requests to the router's management interface that reach the /cgi-bin/glc endpoint. In many home or small office setups, this means access to the LAN; in misconfigured or intentionally exposed setups, this may be achievable from the internet.

The safest pattern is to avoid constructing shell commands from user-controlled data altogether, instead using APIs that separate code from data and strictly validate all parameters. When command-line tools must be invoked, arguments should be validated against strict whitelists (e.g., numeric-only ports) and passed as discrete parameters rather than via concatenated strings.

Prevention relies on adopting secure coding standards for firmware and web interfaces: centralized input validation for all CGI parameters, prohibition of direct shell invocation with untrusted data, mandatory security reviews for native plugins, and automated static analysis integrated into firmware build pipelines to catch command injection patterns early.

Find out what's already
exploitable in your codebase.