| Titel | TOTOLINK CA1200-PoE 5.9c.3994_B20190326 Authentication Bypass in formLoginAuth authCode |
|---|
| Beschreibung | SUMMARY
TOTOLINK CA1200-PoE is a ceiling access point. Its web interface runs a vendor lighttpd build with a form login endpoint. The endpoint /formLoginAuth.htm accepts an integer authCode and creates an administrator session whenever the value is not zero. It never compares that value with anything on the device and never checks the password. An unauthenticated client on the local network sends one GET request with authCode=1 and receives a SESSION_ID cookie that the session gate accepts on the protected administrator pages; the same check covers the CGI paths by code reading. The password check exists only in the separate login handler that builds the redirect to this endpoint.
CLASS: Authentication Bypass (CWE-287, CWE-306)
AFFECTED: TOTOLINK CA1200-PoE, firmware 5.9c.3994_B20190326, the latest public image. Image file TOTOLINK_C8B180A-1G_CA1200-POE_AP0167_8197F_SPI_8M128M_V5.9c.3994_B20190326_ALL.web, sha256 32e7da327263979568ccbe98c23acd530a5387667e18e6bc888613b249cd1c4e. The image is distributed through totolink.vn.
AFFECTED FILES AND PARAMETERS:
- /bin/lighttpd, function Form_Login at 0x40b9c0. Query parameters authCode, userName, password, goURL, flag.
- authCode is converted with atoi at 0x40bc08 and tested at 0x40bdc8 and 0x40bdcc.
- Session creation: form_add_session called at 0x40bff4, ws_set_cookie called at 0x40c034.
- Session gate: checkLoginUser at 0x40c400, called from userloginAuth at 0x40c818, which is called from http_response_write_header at 0x408a88.
CVSS: CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (8.8). The web server listens on the LAN side; one request without credentials creates an administrator session with access to the device configuration.
DETAILS
1. Form_Login parses the query pairs with getNthValueSafe and copies userName, password, goURL and flag into stack buffers. The password buffer is never compared with a stored password or hash.
2. The only test on authCode is at 0x40bdc8 and 0x40bdcc. If the value is zero, the function converts the flag at 0x40bddc and redirects to /mobile/login.asp when flag is 1, otherwise to /login.asp. Any nonzero value branches to 0x40be64. That branch clears the login error flag, reads the clock, and calls form_add_session at 0x40bff4 with userName as the label; on success ws_set_cookie at 0x40c034 sets SESSION_ID.
3. The login handler in lib/cste_modules/global.so checks the password and redirects to /formLoginAuth.htm with authCode from the configuration. The server side never binds that value to the login that produced it. Any nonzero number, including a negative one, is accepted.
4. checkLoginUser at 0x40c400 allows paths that contain index.htm, login.asp or forgot.asp without a session. Every other path requires a SESSION_ID whose session table entry is active. The forged session satisfies that check: on /home.asp the server returned 302 without the cookie and 200 with it. For the other paths this follows from code reading; the CGI dispatcher was not exercised in this proof.
5. The request is a plain GET with no token and no Origin or Host check, and the cookie is set with Path=/ and no SameSite attribute.
PROOF
I ran the vendor /bin/lighttpd under QEMU user-mode with the real web root as the document root and a minimal test configuration with five stock modules (mod_access, mod_accesslog, mod_alias, mod_rewrite and mod_cgi) on a local port. I sent an equivalent request with curl from inside the emulation container:
GET /formLoginAuth.htm?authCode=1&userName=admin&goURL=home.asp&action=login HTTP/1.1
Host: <device>
Connection: close
Observed response: HTTP/1.1 302 Found, Set-Cookie: SESSION_ID=2:<timestamp>:2; Path=/, Location: an absolute URL ending in /home.asp?timestamp=<timestamp>. No password was sent. Repeating with authCode=2, authCode=999 and authCode=-1 produced the same result: a SESSION_ID cookie whose value contains the current timestamp. Requesting /home.asp without a cookie returned 302 to /index.htm; requesting it with the cookie returned 200 and the administrator home page, 2595 bytes.
CONTROL
The same request with authCode=0 returned 302 to /login.asp and no Set-Cookie header. Requesting /home.asp without the cookie returned 302 to /index.htm. In the bypass run the cookie was present and the page was served.
TEST ENVIRONMENT
Tested with the vendor's own binary taken from the public firmware image TOTOLINK_C8B180A-1G_CA1200-POE_AP0167_8197F_SPI_8M128M_V5.9c.3994_B20190326_ALL.web (sha256 32e7da327263979568ccbe98c23acd530a5387667e18e6bc888613b249cd1c4e), run under QEMU user-mode emulation. This proof covers the web server half: the vendor lighttpd handled the login endpoint and the session gate on a static page. The lighttpd-to-CGI spawn was not part of this proof because QEMU user-mode cannot execute a second guest binary in this container, and the web server and the CGI could not be run together. The configuration library was not used in this proof. The device was not tested.
IMPACT
An attacker on the same local network who can reach the web interface gets an administrator session without any password. By design, that session gives access to the device configuration, including the wireless settings and firmware update pages. The local admin password does not prevent it. I exercised the session creation and the gate on the protected home page; the configuration pages were not exercised.
FIX
Issue authCode as a one-time server value when the password check succeeds and reject values that do not match a live entry. Do not create a session when authCode is merely nonzero. As a minimum, require the same password check in Form_Login that the login handler already performs. Separately, add an Origin and Host check and set the cookie with SameSite=Strict.
VENDOR CONTACT
The vendor was notified by email on 2026-11-15, before this submission. No CVE has been assigned or requested elsewhere.
FINDER: Traian Turcu (App Attic) |
|---|
| Quelle | ⚠️ https://www.appattic.com/cyber/advisories/aa-2026-001 |
|---|
| Benutzer | traianturcu (UID 103053) |
|---|
| Einreichung | 15.11.2026 18:34 (vor 19 Tagen) |
|---|
| Moderieren | 04.12.2026 15:34 (19 days later) |
|---|
| Status | Akzeptiert |
|---|
| VulDB Eintrag | 449766 [TOTOLINK CA1200-PoE 5.9c.3994_B20190326 /bin/lighttpd Form_Login authCode schwache Authentisierung] |
|---|
| Punkte | 20 |
|---|