Severity:

CRITICAL RISK

(9.8)

OS Command Injection in Totolink A7100RU CGI Handler

CVE-2026-6115

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

A command injection flaw in the setAppCfg function of /cgi-bin/cstecgi.cgi on Totolink A7100RU routers allows crafted input in the enable parameter to break out of expected command context and execute arbitrary OS commands.

When exposed to untrusted networks, a remote attacker can leverage this vulnerability to run system-level commands on the device, potentially taking full control of the router.

Affected context

This vulnerability occurs in the CGI handler of Totolink A7100RU firmware 7.4cu.2313_b20191024, specifically in the setAppCfg functionality exposed via /cgi-bin/cstecgi.cgi.

The issue arises when the router's web management interface is reachable (e.g., from the local network or, in some deployments, the WAN) and user-controlled HTTP parameters are passed into shell commands.

It typically manifests when input from the enable argument is processed without adequate validation or escaping before being incorporated into system-level configuration commands.

Exploit preconditions

  • Attack surface: HTTP interface of the router's management CGI endpoint /cgi-bin/cstecgi.cgi
  • Required access: Network-level access to the web management port; authentication requirements depend on specific deployment and configuration
  • Trigger point: Invocation of the setAppCfg action with a specially crafted enable parameter
  • Why exploitation is possible: User input is incorporated into OS command construction without proper sanitization, quoting, or use of safer APIs, allowing metacharacters to alter the intended command structure

Why this happens

The root cause is the construction of shell commands using unsanitized user input from the enable parameter within the setAppCfg handler.

Instead of treating incoming values as data and strictly constraining them to expected formats, the implementation likely concatenates them into a command string executed by a shell (e.g., via system, popen, or equivalent).

This is a classic OS Command Injection pattern mapping to CWE-78, and possibly CWE-77 for improper command delimiter neutralization, where attackers can inject shell metacharacters or additional commands.

Potential impact

  • Full remote code execution on the router as the web or system user
  • Persistent compromise of the device, including installation of backdoors or botnet agents
  • Modification of routing, DNS, or firewall rules to intercept or redirect traffic
  • Use of the compromised router as a pivot point for attacks against internal network hosts
  • Exfiltration or monitoring of network metadata and potentially sensitive traffic passing through the device

General mitigation guidance

Effective mitigation patterns focus on eliminating direct shell command construction from web-exposed handlers and reducing the trust placed in HTTP parameters:

  • Replace ad-hoc shell command execution with parameterized system APIs or dedicated configuration libraries that do not invoke a shell.
  • Constrain input to strict whitelists of allowed values (e.g., boolean flags) and validate type, length, and character set before use.
  • Centralize input validation logic for CGI handlers so that all parameters are normalized and checked before reaching lower-level system routines.
  • Run web and management services with the least privileges necessary and isolate them from sensitive system functions where practical.
  • Disable remote web management from untrusted networks by default and require secure channels and hardened authentication where exposure is unavoidable.

How teams detect issues like this

Organizations and developers can detect similar issues using:

  • Static analysis: Rules that flag string concatenation passed into shell-executing APIs (system, popen, exec*, popen2, etc.), especially when arguments derive from HTTP parameters.
  • Code review: Look for CGI or web handlers that build command strings, lack input validation, or perform only superficial checks (e.g., checking non-empty but not allowed characters).
  • Dynamic testing: Fuzz the CGI endpoints with payloads containing shell metacharacters and observe for anomalous behavior, error messages, or unexpected responses.
  • Policy enforcement: Establish secure coding guidelines that disallow direct shell invocation from request handlers, and integrate automated tools in CI to surface violations.

Sources

SourceLink
github.comgithub.com/Litengzheng/vuldb_new/blob/main/A7100RU/vul_180/README.md
vuldb.comvuldb.com/submit/792248
vuldb.comvuldb.com/vuln/356975
vuldb.comvuldb.com/vuln/356975/cti
totolink.nettotolink.net/

Frequently asked

questions

Yes. As long as the web management interface (and specifically /cgi-bin/cstecgi.cgi) is reachable over the network, an attacker can exploit this issue remotely by sending crafted HTTP requests. Exposure from the WAN side significantly increases risk.

The underlying flaw is independent of authentication, but exploitation may or may not require valid credentials depending on how the endpoint is protected in a given configuration. If setAppCfg is accessible without strong authentication, unauthenticated exploitation becomes possible.

Refactor the affected handler so that it never constructs shell commands with user input. Use high-level configuration APIs or direct system calls that treat each argument as data, combined with strict whitelisting of allowed parameter values and centralized validation.

Adopt a secure coding policy that forbids shell invocation from HTTP handlers, enforce rigorous input validation and canonicalization, perform regular security-focused code reviews and static analysis, and subject management interfaces to targeted penetration testing before release.

Find out what's already
exploitable in your codebase.