Severity:

CRITICAL RISK

(9.8)

OS Command Injection in Totolink A7100RU CGI Handler

CVE-2026-5850

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 a command injection flaw in the setVpnPassCfg function of /cgi-bin/cstecgi.cgi, where the pptpPassThru parameter is unsafely passed to the operating system shell.

A remote attacker can send crafted HTTP requests to execute arbitrary OS commands on the device, potentially taking full control of the router whenever the vulnerable CGI endpoint is reachable.

Affected context

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

It specifically affects the CGI handler cstecgi.cgi, in the setVpnPassCfg function, when processing the pptpPassThru argument used for VPN pass-through configuration.

The risk is present when the router's HTTP/HTTPS management interface is exposed to untrusted networks or when an attacker can reach it from the local network.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the Totolink A7100RU router (/cgi-bin/cstecgi.cgi endpoint)
  • Required access: Network access to the router's web management service (LAN or WAN, depending on configuration)
  • User interaction: None; exploitation can be performed via direct HTTP requests
  • Trigger point: Invocation of setVpnPassCfg with a specially crafted pptpPassThru parameter
  • Why exploitation is possible: The value of pptpPassThru is concatenated or interpolated into an OS command without proper sanitization or use of safe process execution APIs, allowing shell metacharacters to alter command behavior

Why this happens

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

The setVpnPassCfg handler appears to construct and execute shell commands using user-provided input (the pptpPassThru parameter) in an unsafe way, such as string concatenation or direct shell invocation.

Without strict validation and escaping of shell metacharacters, or without using parameterized process execution APIs, the application effectively treats attacker-controlled input as part of the command line, allowing arbitrary command execution with the privileges of the web server process.

Potential impact

  • Remote execution of arbitrary OS commands on the router
  • Full compromise of the device, including configuration and traffic routing
  • Installation of persistent malware or backdoors on the router
  • Traffic interception, redirection, or DNS tampering for connected clients
  • Use of the router as a pivot point for further attacks in the local network
  • Enrollment of the device into botnets for DDoS or other malicious activities

General mitigation guidance

Mitigation should focus on eliminating direct shell invocation with untrusted input and reducing the exposure of the management interface:

  • Replace shell-based command construction with safer, parameterized APIs (e.g., exec-style calls that avoid invoking a shell).
  • Enforce strict server-side validation of pptpPassThru and related parameters (whitelisting expected values instead of attempting to blacklist dangerous characters).
  • Avoid passing user-controlled data into command interpreters; map configuration options to predefined, static command templates or internal APIs.
  • Run the web management process with the least privileges required and isolate it from sensitive system components where feasible.
  • Limit access to the management interface to trusted networks only and disable remote administration when not strictly necessary.

How teams detect issues like this

Detection and prevention strategies typically include:

  • Static analysis rules that flag uses of shell execution functions (e.g., system, popen, exec*, backticks) where HTTP parameters or CGI variables flow into command strings.
  • Code review checklists that explicitly require reviewers to identify and question any OS command execution in request handlers, especially CGI scripts.
  • Security testing (SAST/DAST) targeting CGI endpoints with fuzzing for shell metacharacters and typical command injection patterns.
  • Runtime monitoring and logging of unusual command invocations or processes spawned by the web server user on the router firmware.
  • Integration of automated secure coding checks in the firmware build pipeline to block unsafe patterns before release.

Sources

SourceLink
github.comgithub.com/Litengzheng/vuldb_new/blob/main/A7100RU/vul_156/README.md
vuldb.comvuldb.com/submit/791266
vuldb.comvuldb.com/vuln/356376
vuldb.comvuldb.com/vuln/356376/cti
totolink.nettotolink.net/

Frequently asked

questions

It can be, if the router's web management interface is exposed to the internet (remote administration enabled or misconfigured port forwarding). Otherwise, attackers typically need access to the local network.

Public reports often show that such CGI handlers may be reachable without strong authentication or are protected only by weak defaults. However, the precise requirement depends on how the web interface and access control are configured on a given device.

Refactor any code that builds shell commands from request parameters to use safe, parameterized system APIs or internal configuration functions. Combine this with strict, whitelist-based validation of all configuration inputs and removal of unnecessary shell dependencies.

Adopt a secure coding standard that forbids direct shell execution with user input, integrate static analysis to catch command construction patterns early, design management interfaces to operate through internal APIs rather than shell commands, and restrict exposure of administrative services to trusted networks only.

Find out what's already
exploitable in your codebase.