Severity:

CRITICAL RISK

(9.8)

OS Command Injection in Totolink A7100RU Telnet

CVE-2026-5994

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, CWE-78

Impact:

Remote Code Execution on Network Router

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 7.4cu.2313_b20191024 contains an OS command injection flaw in the setTelnetCfg function of /cgi-bin/cstecgi.cgi, where the telnet_enabled parameter is unsafely used in command execution.

A remote attacker can send crafted HTTP requests to inject arbitrary shell commands, potentially taking full control of the affected router.

Affected context

The vulnerability appears in the embedded web management interface of the Totolink A7100RU router, specifically in the CGI handler responsible for configuring Telnet access.

When the router's HTTP management service is reachable (for example, from the local network or if remote management is exposed to the internet), user-controlled parameters from web requests are incorporated into system-level commands without adequate sanitization or isolation.

Under these conditions, the telnet_enabled argument becomes a conduit for injecting arbitrary shell fragments into the underlying operating system.

Exploit preconditions

  • Attack surface: HTTP-based management interface at /cgi-bin/cstecgi.cgi on the router.
  • Required access: Network reachability to the router's web interface; authentication requirements depend on how the device is configured (e.g., default or weak credentials increase risk).
  • Trigger point: Invocation of the setTelnetCfg functionality with a crafted telnet_enabled parameter.
  • Why exploitation is possible: The handler constructs or passes shell commands that directly interpolate the telnet_enabled argument without robust quoting, validation, or use of a safe API, enabling arbitrary command execution in the router's OS context.

Why this happens

This issue stems from using user-supplied data as part of shell command construction in the router firmware's CGI handler.

The setTelnetCfg routine appears to pass the telnet_enabled parameter into a command string or shell call without enforcing strict input constraints or separating data from control, matching the OS command injection pattern described in CWE-78.

Instead of using parameterized, non-shell system APIs or a fixed command set, the code path likely concatenates or embeds the parameter directly into a shell invocation, allowing attack-controlled metacharacters (such as separators, redirection, or subshell syntax) to alter the intended command.

This pattern represents an unsafe design where configuration values received over HTTP are trusted and executed, rather than being treated as untrusted input.

Potential impact

  • Remote execution of arbitrary commands with the router's system privileges.
  • Complete takeover of the router, including configuration changes and persistent backdoor installation.
  • Interception, modification, or redirection of network traffic passing through the device.
  • Use of the compromised router as a pivot point for attacks against internal network hosts.
  • Enrollment of the router into botnets for DDoS attacks or other malicious campaigns.
  • Exfiltration of sensitive configuration data, such as Wi-Fi credentials and admin passwords.

General mitigation guidance

Effective mitigation focuses on removing the ability for user input to influence shell command structure and reducing the attack surface of management interfaces.

Recommended defensive patterns include:

  • Replace shell-based configuration calls with dedicated system APIs or library calls that accept parameters without invoking a shell.
  • Restrict input to strict, whitelisted values (e.g., boolean flags for enabling/disabling Telnet) and reject anything outside a narrow, validated set.
  • Avoid building command strings through concatenation; when command execution is unavoidable, use APIs that pass arguments as arrays without shell interpretation.
  • Run the web management process with the least privileges required, and separate duties to limit the blast radius of any compromise.
  • Disable or tightly restrict external exposure of administrative interfaces, placing them behind VPNs or management VLANs where possible.
  • Apply secure-by-default settings that disable Telnet and favor encrypted management protocols, reducing dependence on this configuration path.

How teams detect issues like this

Identifying this class of vulnerability typically involves both code-centric and behavior-centric approaches:

  • Static analysis: Scan CGI handlers and router firmware code for patterns where HTTP parameters (such as telnet_enabled) flow directly into system(), popen(), exec*(), or shell command wrappers, especially when concatenated into strings.
  • Code review: During manual review, flag any logic that:
  • Constructs shell command strings using user-controlled values.
  • Lacks explicit input validation, canonicalization, and strict whitelisting on configuration parameters.
  • Uses general-purpose shell interpreters instead of purpose-built APIs for enabling/disabling services.
  • Dynamic testing: Use black-box testing tools or fuzzers against the management interface to detect anomalous behavior when special shell metacharacters are supplied in parameters.
  • Policy enforcement: Introduce secure coding guidelines for embedded web interfaces that prohibit direct shell invocation with untrusted input, and enforce those guidelines in CI using linting and SAST tools.

Sources

SourceLink
github.comgithub.com/Litengzheng/vuldb_new/blob/main/A7100RU/vul_166/README.md
vuldb.comvuldb.com/submit/792042
vuldb.comvuldb.com/vuln/356548
vuldb.comvuldb.com/vuln/356548/cti
totolink.nettotolink.net/

Frequently asked

questions

It can be exploited remotely by any attacker who can reach the router's management interface and successfully trigger the setTelnetCfg endpoint, making exposure over the internet or insecure local networks particularly risky.

That depends on the router's configuration and any authentication flaws that might also be present. If authentication is weak, disabled, or bypassable, exploitation may be possible without valid credentials; otherwise, an attacker would first need to obtain administrative access.

Refactor the Telnet configuration logic to eliminate shell command construction entirely, using fixed, parameterized system APIs and strict whitelisting of configuration values so that user input cannot influence command structure.

Adopt a design principle that treats all external input as untrusted, forbids passing it into shells, enforces centralized validation/whitelisting for configuration parameters, and integrates static analysis plus security-focused code review into the firmware development lifecycle.

Find out what's already
exploitable in your codebase.