Severity:

CRITICAL RISK

(9.8)

OS Command Injection in Totolink A7100RU CGI

CVE-2026-6139

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, CWE-78

Impact:

Remote Code Execution on Router Firmware

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 vulnerability in the UploadOpenVpnCert CGI handler, where the FileName parameter is not safely handled.

A remote attacker can inject arbitrary shell commands via crafted requests to /cgi-bin/cstecgi.cgi, potentially achieving full system compromise of the device.

Affected context

This vulnerability occurs in the web management interface of Totolink A7100RU firmware version 7.4cu.2313_b20191024.

It affects deployments where:

  • The router's HTTP/HTTPS management interface is network-accessible (from LAN or WAN, depending on configuration).
  • The /cgi-bin/cstecgi.cgi endpoint is reachable and processes the UploadOpenVpnCert action.
  • User-supplied FileName parameters are passed through to underlying shell or system utilities without strict sanitization or safe API usage.

Exploit preconditions

  • Attack surface: HTTP(S) interface on the Totolink A7100RU router.
  • Required access: Ability to reach the management port; depending on configuration, this might require LAN access or, if remote management is enabled or exposed, Internet access.
  • Trigger point: A crafted request invoking the UploadOpenVpnCert function via /cgi-bin/cstecgi.cgi with a malicious FileName parameter.
  • Why exploitation is possible: The CGI handler constructs or forwards shell commands that directly interpolate the FileName argument, allowing attackers to break out of expected input and execute arbitrary commands in the router's OS context.

Why this happens

The underlying issue is improper construction of shell commands using untrusted input within the CGI handler.

Instead of passing the FileName parameter through a safe API (such as fixed-argument exec/execve calls or file-handling functions), the code likely concatenates it into a shell command string or passes it through a command interpreter.

This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where meta-characters (such as ;, &, |) and other shell syntax are not neutralized.

It is closely related to CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), reflecting the broader pattern of treating user input as part of executable command text.

Potential impact

  • 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 routed through the device.
  • Use of the router as a platform for further attacks within the local network or against external targets.
  • Disruption of network connectivity by altering firewall, routing, or DNS settings.

General mitigation guidance

Effective mitigation focuses on eliminating direct command interpretation of user input and minimizing the router's attack surface:

  • Replace shell-based command construction with parameterized system calls or native library functions that do not invoke a shell.
  • Strictly validate the FileName parameter using a positive (allowlist) pattern, limiting it to expected characters (e.g., alphanumerics, dots, and underscores) and known file extensions.
  • Enforce canonicalization and path constraints to prevent directory traversal or unintended file paths.
  • Run web and CGI components with least-privilege accounts and, where possible, with restricted access to system utilities.
  • Disable or limit remote management and restrict access to the management interface to trusted networks only, reducing exposure even if a bug exists.

How teams detect issues like this

Detection typically involves both code-centric and environment-centric approaches:

  • Static analysis: Look for CGI handlers or web modules that build shell command strings via string concatenation involving user-controlled parameters (e.g., FileName, filename, path, cmd).
  • Code review: Flag any use of system(), popen(), exec* with shell strings, or equivalent wrappers, especially where arguments come from HTTP parameters without strict validation and encoding.
  • Configuration review: Identify routers or appliances with exposed management interfaces accessible from untrusted networks (e.g., WAN exposure, UPnP misconfigurations).
  • Runtime monitoring: Use network intrusion detection or web application firewalls to spot suspicious patterns in FileName or related parameters, such as shell metacharacters or chained commands.
  • Automated security scanning tools can be configured with rules to detect OS command injection patterns in CGI handlers during firmware or source code assessment.

Sources

SourceLink
github.comgithub.com/Litengzheng/vuldb_new/blob/main/A7100RU/vul_192/README.md
vuldb.comvuldb.com/submit/792982
vuldb.comvuldb.com/vuln/357003
vuldb.comvuldb.com/vuln/357003/cti
totolink.nettotolink.net/

Frequently asked

questions

It can be, depending on how the router is configured. If the management interface or the /cgi-bin/cstecgi.cgi endpoint is exposed to the Internet (for example, through remote management or port forwarding), an attacker on the Internet may exploit it. If management access is restricted to the local network, an attacker would need LAN access.

Public advisories do not always specify the authentication state, but command injection in such CGI endpoints is often exploitable with minimal or no authentication. Organizations should assume that lowering access controls or exposing management to untrusted networks significantly increases risk.

The most robust fix is to avoid invoking a shell with user-controlled text. Use dedicated system APIs that accept arguments as separate parameters (rather than a single command string) and apply strict allowlist validation to inputs like FileName. Additionally, reduce privileges of the component executing the command so that a compromise has limited impact.

Adopt a secure coding standard that forbids shell command construction from HTTP parameters, enforce rigorous input validation and encoding, and integrate static analysis checks for command execution APIs into the build pipeline. Combine this with architectural controls—such as isolating management services, minimizing exposed endpoints, and following least privilege—to reduce the blast radius of any remaining defects.

Find out what's already
exploitable in your codebase.