Severity:

CRITICAL RISK

(9.8)

OS Command Injection in Totolink A7100RU CGI DMZ

CVE-2026-5975

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, CWE-78

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

Totolink A7100RU routers contain an OS command injection flaw in the setDmzCfg handler within /cgi-bin/cstecgi.cgi, where the wanIdx parameter is not safely handled before being used in system commands.

A remote attacker can send crafted HTTP requests to this CGI endpoint to execute arbitrary commands on the router, potentially taking full control of the device.

Affected context

The vulnerability appears in the web-based management interface of Totolink A7100RU firmware 7.4cu.2313_b20191024, specifically in the CGI handler that processes DMZ configuration requests.

It affects setups where:

  • The router's HTTP/HTTPS management interface is reachable (LAN or WAN, depending on configuration),
  • The setDmzCfg operation is exposed via /cgi-bin/cstecgi.cgi,
  • User-provided parameters (such as wanIdx) are passed into shell commands without sufficient validation or escaping.

Deployments that expose the admin interface to the internet are particularly at risk.

Exploit preconditions

  • Attack surface: HTTP/HTTPS interface of the router's web management UI.
  • Required access:
  • In many configurations, knowledge of or access to the admin interface path;
  • Authentication may or may not be required depending on how the CGI handler is protected, but command injection occurs at the HTTP layer.
  • Trigger point: A crafted request to /cgi-bin/cstecgi.cgi invoking the setDmzCfg action with a malicious wanIdx parameter.
  • Why exploitation is possible: The wanIdx argument is incorporated into an underlying OS command without sufficient sanitization, escaping, or use of parameterized execution APIs. This allows shell metacharacters or injected fragments to break out of the intended command context.

Why this happens

The root cause is insecure construction of shell commands using untrusted HTTP parameters inside the CGI handler.

The setDmzCfg function appears to concatenate the wanIdx parameter directly into a system-level command string, which is then executed by the shell.

This maps to:

  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), because user-controlled input is not neutralized before being passed to the shell; and
  • CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), covering the broader pattern of embedding unchecked user input into command lines.

Conceptually, the bug class is: "building shell commands from user input instead of using safe APIs or strict validation."

Potential impact

  • Remote execution of arbitrary system commands on the router.
  • Complete takeover of the device, including configuration changes and persistent backdoors.
  • Interception, modification, or redirection of network traffic handled by the router.
  • Use of the compromised router as a pivot point for attacks against internal network hosts.
  • Enrollment of the device into botnets for DDoS or other malicious campaigns.
  • Loss of integrity and confidentiality for traffic traversing the device.

General mitigation guidance

Mitigations should focus on eliminating direct shell command construction from user-controlled data and hardening the management surface:

  • Replace shell-based command execution with safer, parameterized system APIs that do not involve a command interpreter.
  • Apply strict allowlists for configuration parameters like wanIdx, validating that values fall within expected numeric or enumerated ranges.
  • Centralize and standardize input validation in the CGI/router management stack to ensure all parameters are normalized before use.
  • Reduce privileges of the process handling CGI requests so that, if exploited, the attacker's capabilities are constrained.
  • Minimize or disable WAN-side exposure of the router management interface and enforce strong authentication, even though this does not fix the underlying command injection.
  • Prefer secure-by-default designs where configuration changes affect an internal configuration model rather than directly invoking system commands.

How teams detect issues like this

Detection typically involves both code-centric and operational approaches:

  • Static analysis: Search for uses of system, popen, backtick operators, or equivalent command execution functions that concatenate HTTP parameters (such as wanIdx) into command strings.
  • Code review: Flag any CGI handlers or router management functions that build shell commands from request parameters; verify that input passes through strict validation and encoding layers.
  • Policy enforcement: Establish development policies that prohibit direct shell invocation from web handlers, requiring wrappers or service layers with whitelisted arguments.
  • Runtime monitoring: Use logging and network intrusion detection to spot unusual requests to /cgi-bin/cstecgi.cgi, especially those containing shell metacharacters, along with anomalous outbound connections or system command patterns from the router.
  • Automated SAST/DAST tools can be configured with rules specific to command injection patterns and router management endpoints to surface similar vulnerabilities during development and testing.

Sources

SourceLink
github.comgithub.com/Litengzheng/vuldb_new/blob/main/A7100RU/vul_161/README.md
vuldb.comvuldb.com/submit/791821
vuldb.comvuldb.com/vuln/356529
vuldb.comvuldb.com/vuln/356529/cti
totolink.nettotolink.net/

Frequently asked

questions

The issue is remotely exploitable wherever the router's web management interface is reachable. If the management port is exposed to the internet, attackers can target it from anywhere; if it is limited to the LAN, exploitation is constrained to local network access or anyone who can reach that segment.

That depends on how the CGI handler and DMZ configuration endpoint are protected in a given firmware configuration. In some setups, the vulnerable handler may be tied to authenticated sessions, while in others misconfigurations or auxiliary flaws may allow unauthenticated access. Regardless, any context where an attacker can send crafted requests to setDmzCfg is at risk.

Avoid building shell commands from HTTP parameters altogether. Instead, move to structured APIs or system calls that take typed parameters, enforce strict allowlists for configuration values, and ensure the web handler never passes raw user input to a command interpreter.

Adopt secure coding standards that ban direct shell usage in web handlers, mandate centralized input validation, and require security reviews for any component that translates web requests into system actions. Integrating static analysis and security checks into the firmware development pipeline can help catch command injection patterns before release.

Find out what's already
exploitable in your codebase.