/

CVE-2026-18598

Severity:

HIGH RISK

(8.8)

Command Injection (CWE-77) in GL.iNet Logread RPC

CVE-2026-18598

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-74, CWE-77

Impact:

Remote Command Execution on Network Device

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

A command injection issue in GL.iNet GL-MT3000's Logread Lua RPC plugin allows crafted input to the module parameter to be interpreted as shell commands.

When exposed over the network, a remote attacker can leverage this flaw to execute arbitrary commands on the device with the privileges of the web or system service.

Affected context

This vulnerability occurs in GL.iNet GL-MT3000 devices running firmware up to version 4.4.5, specifically within the Logread Lua RPC plugin used for retrieving system logs.

It manifests when the logread.get_system_log function processes the module argument and passes it into underlying shell or system log utilities without robust sanitization.

The risk is highest in deployments where the administrative web interface or RPC endpoint is reachable from untrusted networks or shared environments.

Exploit preconditions

  • Attack surface: HTTP/Lua RPC interface for log retrieval (logread RPC plugin).
  • Required access: Ability to send requests to the vulnerable RPC endpoint (typically network access to the device's management interface; authentication requirements may vary by configuration).
  • Trigger point: Supplying a crafted module argument that is concatenated or interpolated into a shell command executed by the system.
  • Why exploitation is possible: User-supplied data is incorporated into command execution logic without proper escaping, validation, or use of safe APIs, enabling attackers to break out of intended parameters and inject additional commands.

Why this happens

The underlying bug aligns with CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') and is closely related to CWE-74: Improper Neutralization of Special Elements in Output.

In the Logread Lua RPC plugin, the module argument is treated as a trustworthy value and passed to shell or command-line utilities, likely via string concatenation or templating.

Because meta-characters, separators, or control operators are not stripped or constrained, an attacker can craft input that alters the command structure, appending arbitrary instructions.

Abstractly, this pattern reflects a broader class of issues where untrusted input is mixed with command syntax instead of being handled as opaque data through parameterized or API-based execution.

Potential impact

  • Remote execution of arbitrary shell commands on the GL-MT3000 device.
  • Unauthorized access to system logs and sensitive diagnostic information.
  • Modification of device configuration, firewall rules, or routing behavior.
  • Deployment of malware or backdoors on the router, impacting all connected clients.
  • Use of the compromised device as a pivot point for attacks on internal networks.

General mitigation guidance

Effective mitigation focuses on breaking the link between untrusted input and command syntax.

Common patterns include:

  • Replacing shell-based command construction with high-level, parameterized APIs that treat arguments as data, not executable text.
  • Strictly validating the module parameter against an allowlist of expected values or log sources, rejecting anything outside the defined set.
  • Neutralizing or rejecting input containing command separators, metacharacters, or unexpected whitespace that could alter execution flow.
  • Running the web/RPC service with least-privilege accounts, limiting the impact of any command that is executed.
  • Minimizing exposure of administrative interfaces to untrusted networks and isolating management traffic with segmentation or VPN access.

How teams detect issues like this

Detection typically relies on a combination of code-centric and operational approaches:

  • Static analysis rules that flag patterns where user-controlled variables are passed to os.execute, shell calls, or similar command APIs without sanitization.
  • Manual code reviews focused on RPC handlers and log utilities, checking for string concatenation into commands or direct shell invocation from Lua or other languages.
  • Security testing that exercises RPC endpoints with payloads containing common command injection markers to observe unexpected behavior.
  • Policy enforcement in CI/CD pipelines requiring safe execution primitives, input validation, and explicit review for any command construction logic.
  • Runtime monitoring for anomalous command executions or processes spawned by the web or RPC service, which may indicate active exploitation attempts.

Sources

SourceLink
github.comgithub.com/StrTzz123/iot_vul/blob/main/GL-iNet/MT3000/4.4.5/logread_get_system_log_rpc_rce/CVE.md
vuldb.comvuldb.com/cve/CVE-2026-18598
vuldb.comvuldb.com/submit/851535
vuldb.comvuldb.com/vuln/385513
vuldb.comvuldb.com/vuln/385513/cti

Frequently asked

questions

Exploitability depends on whether the vulnerable RPC interface is reachable from an attacker's network vantage point. If the management or API endpoint is exposed to the internet or untrusted segments, the vulnerability can be exploited remotely.

An attacker needs network access to the Logread RPC interface and the ability to send requests that set the module parameter. Whether authentication is required depends on device configuration, but misconfigured or default setups may increase exposure.

The safest approach is to remove shell-based command construction entirely. Use strongly typed, parameterized APIs for log retrieval, and constrain module to a fixed set of known-safe options, rejecting any unrecognized or malformed values.

Preventive strategies include adopting secure coding guidelines that prohibit mixing untrusted input with command syntax, enforcing input validation and allowlists for RPC parameters, mandating code review for any command execution logic, and integrating static analysis tools that detect command injection patterns before deployment.

Find out what's already
exploitable in your codebase.