Severity:

CRITICAL RISK

(9.8)

OS Command Injection in Totolink A7100RU CGI Password

CVE-2026-6195

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 firmware 7.4cu.2313_b20191024 contains an OS command injection vulnerability in the setPasswordCfg functionality of /cgi-bin/cstecgi.cgi, affecting the router's administrative password configuration.

By sending crafted input in the admpass parameter, a remote attacker can execute arbitrary system commands on the device with high privilege, potentially taking full control of the router.

Affected context

This vulnerability affects Totolink A7100RU routers running firmware version 7.4cu.2313_b20191024 where the web management interface is reachable (e.g., over LAN or, in some deployments, exposed to the internet).

The issue resides in the CGI handler /cgi-bin/cstecgi.cgi, specifically in the setPasswordCfg function that processes the admpass parameter when changing the administrator password.

The vulnerable behavior occurs when user-supplied password data is passed into system-level command execution without proper sanitization or safe API usage.

Exploit preconditions

  • Attack surface: HTTP(S) interface on the router exposing /cgi-bin/cstecgi.cgi
  • Required access: Network-level access to the web management port (LAN or WAN depending on configuration); exploitation can be unauthenticated or weakly authenticated depending on how the endpoint is protected
  • Trigger point: A crafted HTTP request invoking the setPasswordCfg logic with a malicious admpass value
  • Why exploitation is possible: The admpass parameter is incorporated into an operating system command or shell construct without robust escaping, validation, or use of command-safe APIs, allowing attacker-controlled data to alter the command's structure

Why this happens

The root cause is the use of unsafe command construction patterns when handling web input in the router's CGI component.

Instead of treating the administrator password as opaque data, the setPasswordCfg implementation appears to concatenate the admpass value directly into a shell command or system call.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, where meta-characters (such as ;, &&, |, backticks, or similar) in user-controlled input are not neutralized.

In some cases, the broader class CWE-77: Command Injection also applies, covering the pattern of embedding untrusted input into command execution without using parameterized or API-level isolation.

Potential impact

  • Remote execution of arbitrary OS commands on the router
  • Complete compromise of the router's configuration and firmware integrity
  • Interception, modification, or redirection of network traffic passing through the device
  • Deployment of persistent malware or use of the router as part of a botnet
  • Lateral movement into internal network segments behind the router
  • Disruption of service, including denial-of-service against local users

General mitigation guidance

This vulnerability class is mitigated by eliminating unsafe command construction and reducing trust in all user-controllable fields:

  • Prefer high-level configuration APIs or system libraries over spawning shell commands to manipulate device settings.
  • Where command execution is unavoidable, separate data from commands by using parameterized interfaces or constructs that do not invoke a shell.
  • Apply strict input validation on fields like passwords: enforce length limits, character whitelists, and structural constraints that exclude shell meta-characters entirely.
  • Run web management components with the least privileges necessary so that, even if a command injection occurs, the blast radius is limited.
  • Restrict external exposure of the management interface (e.g., disable remote WAN management by default, require strong authentication and TLS where available).
  • Adopt a secure coding guideline for embedded web interfaces that forbids assembling shell commands from raw HTTP parameters.

How teams detect issues like this

Effective detection combines code-level analysis with behavioral monitoring:

  • Static analysis: Use rules or custom patterns to flag instances where CGI handlers or web code:
  • Call system, popen, exec*, or similar APIs with string concatenation that includes HTTP parameters (such as admpass).
  • Build shell command lines using untrusted data without escaping or validation.
  • Code review signals: During review, treat any shell invocation from web handlers as high risk and verify:
  • That user input is either not involved or is strictly validated and encoded.
  • That safer system APIs could replace shell execution.
  • Dynamic/black-box testing: Use web security scanners and fuzzers tuned for command injection to send payloads in parameters like admpass and monitor for anomalous device behavior or responses.
  • Runtime monitoring: Where feasible, inspect command execution logs or process spawning patterns on the firmware to detect unexpected shell commands originating from the web server process.
  • Tooling such as SAST and embedded firmware analyzers can be integrated into the development pipeline to automatically highlight command injection patterns before release.

Sources

SourceLink
github.comgithub.com/Litengzheng/vuldb_new/blob/main/A7100RU/vul_198/README.md
vuldb.comvuldb.com/submit/797460
vuldb.comvuldb.com/vuln/357117
vuldb.comvuldb.com/vuln/357117/cti
totolink.nettotolink.net/

Frequently asked

questions

Exploitability depends on how accessible the router's web management interface is. If the management port is reachable from untrusted networks (such as the internet or guest Wi-Fi), attackers can remotely exploit the flaw without physical access to the device.

The core requirement is the ability to reach the vulnerable CGI endpoint with crafted requests. Some deployments may require authentication, while others may expose the endpoint more openly; in any case, the vulnerability allows an attacker who can trigger the setPasswordCfg logic to inject commands via admpass.

Replace shell-based command composition with direct system APIs or configuration libraries, keep user input strictly separate from any command execution context, and enforce strong validation on all HTTP parameters processed by management interfaces.

Adopt a secure-by-design approach: ban dynamic shell command construction from coding standards, run automated static analysis focused on injection risks, design management operations as structured API calls rather than shell wrappers, and regularly conduct security reviews and penetration tests on administrative endpoints.

Find out what's already
exploitable in your codebase.