Severity:

CRITICAL RISK

(9.8)

OS Command Injection in Totolink A7100RU CGI Handler

CVE-2026-6112

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

A command injection vulnerability in the Totolink A7100RU router allows arbitrary OS commands to be executed via the maxRtrAdvInterval parameter handled by /cgi-bin/cstecgi.cgi in the setRadvdCfg function.

When exposed to the internet or an untrusted network, a remote attacker can abuse this CGI endpoint to run system commands on the device with high privileges, potentially taking full control of the router.

Affected context

This vulnerability appears in Totolink A7100RU firmware version 7.4cu.2313_b20191024 within the web management interface's CGI handler.

The affected setRadvdCfg function processes router advertisement configuration, including the maxRtrAdvInterval argument, and passes its value into underlying system commands without robust sanitization or safe command construction.

The risk is most significant when the router's management interface is reachable from untrusted networks (e.g., WAN exposure, guest networks, or compromised internal hosts).

Exploit preconditions

  • Attack surface: HTTP/HTTPS access to the router's web management interface, specifically the /cgi-bin/cstecgi.cgi endpoint.
  • Required access: Ability to send crafted requests to the vulnerable CGI handler; whether authentication is required depends on the router's configuration and default settings.
  • Trigger point: Invocation of the setRadvdCfg functionality with a maliciously crafted maxRtrAdvInterval parameter.
  • Why exploitation is possible: The handler appears to incorporate user-supplied input directly into shell commands or system utilities without proper escaping, validation, or use of parameterized APIs, which enables injection of arbitrary command sequences.

Why this happens

The root cause aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

The setRadvdCfg logic likely constructs command strings that include maxRtrAdvInterval (e.g., for configuring router advertisement daemons) and then executes them via shell or equivalent APIs.

Because the implementation does not robustly neutralize shell metacharacters or separate data from control instructions, an attacker can embed additional commands or modify the command line structure.

This represents a broader insecure pattern where network-facing configuration parameters are passed directly into shell commands instead of using safer system-level APIs or strict input handling.

Potential impact

  • Remote execution of arbitrary OS commands on the router.
  • Complete takeover of the device, including configuration changes and credential theft.
  • Use of the router as a pivot point for attacks against internal network hosts.
  • Installation of persistent malware or participation in botnets and DDoS campaigns.
  • Disruption of network services, including denial of service for connected users.

General mitigation guidance

Effective mitigation centers on eliminating unsafe command construction and reducing the trust placed in network-facing inputs.

General defensive patterns include:

  • Avoiding shell command concatenation for configuration changes; instead, use direct system APIs, libraries, or tightly scoped wrappers that accept structured arguments.
  • Applying strict input validation to all CGI parameters, especially those that feed into system-level operations, using whitelists for expected formats (e.g., numeric ranges, fixed enums).
  • Ensuring any remaining command execution uses APIs that separate arguments from the command (e.g., exec-style calls with argument arrays) and never passes user data through a shell interpreter.
  • Running web management components with least-privilege accounts and limiting their ability to invoke powerful system utilities.
  • Restricting remote access to the management interface (e.g., disabling WAN admin access, enforcing strong authentication and network segmentation).

How teams detect issues like this

Detection efforts can focus both on code and runtime behavior:

  • Static analysis: Scan firmware or source code for patterns indicating shell usage with interpolated user input (e.g., system(), popen(), backticks, or equivalent APIs that build commands from CGI parameters).
  • Code review: Flag any CGI handler or router configuration endpoint that constructs command strings from HTTP parameters without strict validation or parameterization.
  • Configuration and policy checks: Enforce internal development policies that prohibit direct shell invocation from network-exposed handlers, and require security review for any exception.
  • Runtime monitoring: Where feasible, monitor for unusual command execution from web server processes or anomalous outbound connections from routers that might indicate compromise.

Automated security testing tools, including firmware static analyzers and web application scanners configured for embedded devices, can help surface these injection patterns early.

Sources

SourceLink
github.comgithub.com/Litengzheng/vuldb_new/blob/main/A7100RU/vul_177/README.md
vuldb.comvuldb.com/submit/792245
vuldb.comvuldb.com/vuln/356972
vuldb.comvuldb.com/vuln/356972/cti
totolink.nettotolink.net/

Frequently asked

questions

Yes, it can be remotely exploitable if the router's management interface or the vulnerable CGI endpoint is reachable from the internet or any untrusted network segment. If access is limited to a local LAN and protected by strong controls, exposure is reduced but not eliminated.

That depends on how the router is configured. If the vulnerable endpoint is behind authentication, an attacker would need to obtain or bypass credentials. However, if the interface is misconfigured, exposed without authentication, or affected by other auth bypass flaws, exploitation may require no prior authentication.

Replace any shell-based configuration calls with direct system APIs or carefully designed helpers that do not invoke a shell. Combine this with strict input validation (e.g., numeric ranges for timing intervals, fixed patterns for configuration values) and enforce the principle that network-sourced data must never be used as part of command strings.

Adopt a secure coding standard that bans command concatenation with user input, enforce code review for all network-facing handlers, and integrate static analysis for injection patterns into the build pipeline. Additionally, design management interfaces with least privilege, minimal exposed surface, and strong authentication and segmentation so that even if a bug exists, its exploitability and impact are significantly constrained.

Find out what's already
exploitable in your codebase.