/

CVE-2026-11451

Severity:

HIGH RISK

(7.3)

OS Command Injection via Unsanitized Argument (CWE-77) in GL.iNet GL-MT3000 FTP Protocol Handler

CVE-2026-11451

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-74, CWE-77

Impact:

Remote Command Execution on Network Appliance

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

GL.iNet GL-MT3000 firmware 4.4.5 contains a command injection vulnerability in the FTP Protocol Handler's /cgi-bin/glc endpoint, where the media_dir argument is unsafely embedded into a shell command.

A remote attacker who can reach this interface may inject arbitrary commands via crafted media_dir values, leading to unauthorized command execution on the router under affected configurations.

Affected context

This vulnerability occurs in GL.iNet GL-MT3000 devices running firmware version 4.4.5, specifically within the FTP Protocol Handler exposed by /cgi-bin/glc.

The issue arises when user-supplied media_dir parameters are passed into command construction logic and written into FTP-related configuration without adequate shell-escaping.

It is relevant in deployments where:

  • The web/administration interface is reachable (locally or remotely, depending on network setup)
  • The FTP configuration functionality is enabled or accessible
  • Requests to /cgi-bin/glc or related protocol configuration endpoints are processed with insufficient validation of the media_dir field

Exploit preconditions

  • Attack surface: HTTP/CGI interface on the GL-MT3000 (e.g., /cgi-bin/glc FTP Protocol Handler).
  • Required access: Network access to the device's management/API interface; depending on configuration, this may be from the LAN side or, if exposed, from the WAN/remote side. Authentication requirements depend on how the interface is deployed and protected.
  • Trigger point: Submission of a crafted request where the media_dir parameter is populated with shell metacharacters and additional commands; the vulnerability is triggered when the backend constructs and executes or passes a command line containing this value.
  • Why exploitation is possible: The server-side code previously interpolated the media_dir argument into a command or configuration string without robust quoting or escaping, enabling attackers to break out of the intended argument context and inject additional shell commands (CWE-77/CWE-74).

Why this happens

The root cause is the use of untrusted input inside a shell command or configuration directive without proper neutralization of special characters.

In affected firmware, the media_dir parameter is processed by the FTP Protocol Handler (/cgi-bin/glc) and incorporated into command strings, likely surrounded by single quotes but not consistently escaped before use.

This pattern corresponds to CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), as the input can close existing quoting, append ;-separated commands, and comment out the remainder.

It is also related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because attacker-controlled data is written into a configuration or command channel that another component (shell/FTP server) interprets.

The vendor's fix for later firmware versions—escaping single quotes via escape_single_quote() before embedding media_dir—illustrates that the prior behavior failed to enforce a strict separation between data and executable command syntax.

Potential impact

  • Remote execution of arbitrary shell commands with the privileges of the web/FTP configuration process on the router
  • Unauthorized modification of router configuration, including network, firewall, or FTP settings
  • Extraction or tampering of files stored on attached storage or within the device filesystem
  • Use of the router as a foothold for lateral movement into the internal network
  • Deployment of malware, backdoors, or persistent implants on the device

General mitigation guidance

Effective mitigation focuses on preventing untrusted input from influencing command interpretation and reducing the privileges of any processes that must handle such input.

Recommended defensive patterns include:

  • Avoid invoking shell interpreters with concatenated strings; prefer direct API calls or library functions to configure services (e.g., editing configuration files via structured I/O rather than command-line wrappers).
  • When a shell must be used, pass user-controlled values as arguments to system calls that avoid shell parsing (e.g., exec-style APIs with argument arrays) rather than constructing single command strings.
  • Apply strict input validation for parameters like media_dir, limiting to expected character sets (e.g., alphanumeric, allowed path separators) and rejecting or encoding shell metacharacters (', ;, #, &, |, $, etc.).
  • Use robust escaping/quoting helpers that are specific to the interpreter being used (POSIX shell, configuration syntax, etc.) and ensure these are applied consistently on every code path.
  • Run web/CGI and configuration-handling components with least privilege, isolating them via OS-level sandboxing or containers when possible, to limit impact if a command injection occurs.
  • Minimize exposure of management interfaces: restrict access to trusted networks, segment administration ports, and disable protocol handlers that are not required.

How teams detect issues like this

Detection should aim to identify both the insecure code patterns and any active exploitation attempts.

Code-level detection:

  • Use static analysis or linters to flag direct use of shell-invoking functions (e.g., system, popen, exec* with /bin/sh -c) where untrusted parameters are concatenated into the command string.
  • Review CGI or router management code paths that construct configuration or control commands from HTTP parameters such as media_dir, focusing on missing or inconsistent escaping routines.
  • Enforce secure coding guidelines via CI pipelines that block merges when command construction patterns appear without explicit sanitization or validation.

Runtime and log-based detection:

  • Monitor HTTP logs for suspicious media_dir values containing shell metacharacters, unusual quoting, or sequences like ;, &&, |, #, and backticks.
  • Collect and inspect system logs for anomalous command executions originating from the web/CGI processes, especially commands that are not part of the normal FTP configuration workflow.
  • Employ network intrusion detection systems (NIDS) with signatures for command injection payloads targeting router management endpoints.

Automated security testing tools (e.g., SAST for firmware source, DAST for web interfaces, and fuzzers that mutate parameters like media_dir) can complement manual review and help surface vulnerable endpoints before deployment.

Sources

SourceLink
github.comgithub.com/StrTzz123/iot_vul/blob/main/GL-iNet/MT3000/4.4.5/nas_proto_media_dir_glc_rce/Readme.md
vuldb.comvuldb.com/cve/CVE-2026-11451
vuldb.comvuldb.com/submit/825563
vuldb.comvuldb.com/vuln/369071
vuldb.comvuldb.com/vuln/369071/cti

Frequently asked

questions

Exploitability depends on how the GL-MT3000 management and FTP configuration interfaces are exposed. If the vulnerable endpoint is reachable from untrusted networks and not strongly authenticated, a remote attacker may be able to trigger command injection simply by sending crafted HTTP requests. In more locked-down setups where the interface is only accessible from a trusted LAN and requires authentication, the risk is reduced but still present if an attacker can obtain or bypass those credentials.

The attacker needs network access to the router's web/API interface that processes the media_dir parameter in the FTP Protocol Handler. Whether they also need valid authentication depends on the device's configuration and access controls. No filesystem or shell access is required; the attack is carried out purely via HTTP requests to the susceptible endpoint.

The most robust fix is to eliminate shell-based command construction for configuration tasks and instead use direct APIs or configuration file writes that treat input purely as data. Where a shell must remain in use, all untrusted data should be validated against strict allowlists and passed as arguments to non-shell-executing APIs, or thoroughly escaped with a well-tested routine tailored to the target interpreter. Applying a dedicated escaping function to media_dir, as the vendor describes, is one example of this pattern.

Preventing similar issues requires adopting secure coding practices around command execution: design APIs that never mix control syntax and user data, enforce early and strict validation for all externally supplied parameters, and integrate automated checks for command construction patterns into the development workflow. Regular security reviews of router management and CGI components, combined with limiting exposure of administrative interfaces and running them with least privilege, further reduce both the likelihood and impact of command injection flaws.

Find out what's already
exploitable in your codebase.