• Web server: a login with an unknown user name is not counted as a fail

    From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Saturday, November 21, 2026 19:00:19
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1390
    2026-11-21 19:00:19 -0800

    The web server does not count a login with an unknown user name as a failed login attempt. Every other server that authenticates does, so through the web server a client can guess user names without ever reaching the temporary-ban or auto-filter thresholds (`LoginAttemptTempBanThreshold`, `LoginAttemptFilterThreshold`) or the hack log.

    ## Web server

    Both login paths log the unknown name and return without calling `badlogin()`:

    - **HTTP authentication**, `check_ars()`: `find_login_id()` returns 0, `!UNKNOWN USER: '<name>'` is logged, and the request is refused (401).
    - **The JavaScript `login()` method** (`js_login()`): `getuserdat()` fails for user number 0, `!USER NOT FOUND: '<name>'` is logged, and `login()` returns false.

    Failed attempts are counted only for a wrong password, a failed Digest check, or a user who does not meet the server's login requirements.

    ## Other servers (all count an unknown name)

    - **Terminal server**: `sbbs_t::login()` (`login.cpp`) calls `badlogin()` for an unknown login ID, with or without the password prompt; RLogin and SSH in `answer.cpp` call it for an unknown name.
    - **FTP server**: `PASS` for an unknown user (`ftpsrvr.cpp`).
    - **Mail server**: POP3 `USER`/`PASS` and SMTP AUTH (`mailsrvr.cpp`).
    - **Services**: the JavaScript `login()` method (`services.cpp`), where `getuserdat()` fails for an unknown name.

    ## Proposed fix

    Call `badlogin()` (via the request's client, which is the forwarded address behind a trusted reverse proxy) in both unknown-user branches of the web server, passing the name and, for HTTP Basic, the password, as the other servers do.

    Keep #1307's distinction: a lookup that could not run (`find_login_id()` < 0) is a system error and must not be counted, only a lookup that found no such user.

    Related, smaller: a deleted or inactive account is also not counted by the web server's `login()` (nor by the Services `login()`), while the terminal server counts one on Telnet auto-login. Worth making consistent at the same time.

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Saturday, November 21, 2026 19:18:30
    close https://gitlab.synchro.net/main/sbbs/-/work_items/1390
    2026-11-21 19:18:28 -0800
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)