/

CVE-2026-12187

Severity:

HIGH RISK

(8.8)

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

CVE-2026-12187

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-74, CWE-77

Impact:

Remote Code Execution on Embedded Router

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

GL.iNet GL-MT3000 routers contain a command injection flaw in the Online Firmware Upgrade Handler, allowing crafted input to be executed as system commands via /usr/bin/one_click_upgrade.

When exposed to remote attacker-controlled parameters, this weakness can be used to run arbitrary commands on the device, potentially leading to full router compromise.

Affected context

The vulnerability occurs within the GL.iNet GL-MT3000 router's online firmware upgrade mechanism, specifically in the /usr/bin/one_click_upgrade handler.

It is relevant in deployments where:

  • The web or API interface exposes the "one-click" online firmware update feature
  • User-supplied or remotely retrieved data is passed to the upgrade handler
  • Input is not robustly sanitized or constrained before being incorporated into shell commands

Actual exploitability depends on network exposure of the management interface and how authentication is configured.

Exploit preconditions

  • Attack surface: Router management plane (web UI/API or related upgrade endpoint)
  • Required access: Ability to trigger the Online Firmware Upgrade Handler with attacker-controlled input; may require access to the administrative interface depending on configuration
  • Trigger point: Invocation of /usr/bin/one_click_upgrade when processing firmware upgrade parameters or URLs
  • Why exploitation is possible: Untrusted data is incorporated into a command execution context without strict validation, quoting, or use of safe process spawning APIs, enabling an attacker to inject additional shell metacharacters or commands.

Why this happens

The underlying issue is improper neutralization of special elements used in command contexts, aligning with CWE-77: Command Injection and CWE-74: Improper Neutralization of Special Elements in Output.

The upgrade handler likely constructs shell commands by concatenating user-controlled values (such as firmware URLs or parameters) into a command string executed by a shell.

Without strict validation, escaping, or a move to parameterized, non-shell-based process spawning, the input can break out of its intended bounds and introduce arbitrary commands.

Potential impact

  • Remote attackers may execute arbitrary OS commands on the router.
  • Complete takeover of the device, including persistence of malicious configuration.
  • Interception, modification, or redirection of network traffic routed through the device.
  • Use of the router as a pivot point for attacks on internal network hosts.
  • Enrollment of devices into botnets or use in distributed denial-of-service campaigns.

General mitigation guidance

Effective mitigation focuses on eliminating direct command construction from untrusted input and constraining the upgrade surface.

Recommended patterns include:

  • Refactoring firmware upgrade logic to use safe process execution APIs (e.g., exec-style calls without shell) and strongly-typed parameters instead of shell command strings.
  • Introducing strict allowlists for all user-controlled firmware parameters (e.g., URLs, filenames), rejecting or normalizing any input containing shell metacharacters or unexpected formats.
  • Separating duties in the upgrade component so that parsing, validation, and command execution are distinct steps with clear contracts and no implicit string concatenation.
  • Running the upgrade handler with least-privilege accounts and minimal capabilities, reducing blast radius if any command execution occurs.
  • Restricting remote access to the management interface via network segmentation, VPN-only administration, and disabling unnecessary remote administration features.

How teams detect issues like this

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

  • Static analysis: Use patterns that flag shell command constructions involving user-controlled variables (e.g., calls to system, popen, or backticks with concatenated strings), especially in upgrade and update paths.
  • Code review: During manual review, pay special attention to firmware update, backup/restore, and diagnostic features for string-based command building and insufficient input checks.
  • Policy enforcement: Adopt secure coding guidelines that prohibit direct shell invocation with concatenated strings; enforce these rules via pre-commit hooks or CI checks.
  • Runtime monitoring: On deployed devices, where possible, monitor for unusual command executions or outbound connections initiated by the upgrade process that deviate from normal patterns.

Sources

SourceLink
fw.gl-inet.comfw.gl-inet.com/firmware/mt3000/release/mt3000-4.8.1-0819-1755615825.tar
github.comgithub.com/StrTzz123/iot_vul/tree/main/GL-iNet/MT3000/4.4.5/upgrade_online_url
vuldb.comvuldb.com/cve/CVE-2026-12187
vuldb.comvuldb.com/submit/815654
vuldb.comvuldb.com/vuln/370833
vuldb.comvuldb.com/vuln/370833/cti

Frequently asked

questions

It can be, depending on how the router's management interface is exposed. If remote administration or cloud-based upgrade triggers are reachable by an attacker and the vulnerable handler is accessible, the issue may be remotely exploitable.

In many deployments, exploiting the upgrade handler will require access to the administrative interface; however, misconfigurations, weak credentials, or secondary bugs could remove or lower this barrier. The precise requirement depends on how the device is configured in the field.

Replace any shell-based command construction with parameterized, non-shell process execution, and strictly validate all incoming parameters against well-defined formats and allowlists before use. Treat firmware upgrade inputs as untrusted data, regardless of source.

Adopt a defensive design approach where untrusted input is never directly fed into interpreters (shell, SQL, templating engines). Establish coding standards that forbid dynamic shell command building, enforce rigorous input validation, and subject high-risk components like upgrade and diagnostic handlers to focused security review and automated analysis.

Find out what's already
exploitable in your codebase.