• docs/v322_new.md src/sbbs3/websrvr.cpp

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Wed Sep 30 19:08:47 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/aadcf82e0660f29d0b7afc10
    Modified Files:
    docs/v322_new.md src/sbbs3/websrvr.cpp
    Log Message:
    Web Server: log script errors, don't send them to the client

    Fixes #1203

    js_ErrorReporter() wrote every uncaught JavaScript error, with the script's absolute path and line number, into the HTTP response body as well as the
    log, and the request still completed with a 200 and the page's content
    type. That disclosed the server's layout to any visitor who could make a
    script throw, and any error message that interpolated request data (a query parameter, header or cookie) was a reflected script-injection vector in the BBS's own origin.

    Log the error only. A reported error (a warning does not count, nor does exit(), which reports nothing) marks the session, and exec_ssjs() then
    fails the request instead of sending what the script produced before
    failing, so the normal 500 error path answers it. An error after the
    script has already sent its headers can only be logged, as before.

    Verified on a scratch web server: a page that throws with a query
    parameter in the message returns 500 with an empty body and the error is
    in the log; a page that ends with exit() still returns 200.

    Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Fri Nov 20 15:25:23 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/30e82b9600a154489f0fef85
    Modified Files:
    docs/v322_new.md src/sbbs3/websrvr.cpp
    Log Message:
    websrvr: file-area downloads are sent sandboxed and not sniffed

    A file requested from a file area (FileVPathPrefix) was sent with a Content-Type taken from its extension and nothing else. An uploaded
    .html or .svg file, opened through its link, was a page of whatever
    host name the link used: script in it ran with that site's origin and
    could act as the signed-in visitor there.

    Every file-area download now carries

    X-Content-Type-Options: nosniff
    Content-Security-Policy: sandbox

    The sandbox makes the browser treat the file as a document of its own:
    no script, and no access to the site's cookies, storage or pages. The
    file still displays. PDFs get nosniff only, because a browser's built-in
    PDF viewer does not start inside a sandbox. Listings (the index script),
    the rest of the web root and scripts are unchanged.

    Checked on a scratch web server on loopback with an .html, .svg, .pdf
    and .txt file in a file area: without the change none had either
    header; with it the first, second and fourth have both and the PDF has
    nosniff. In headless Firefox the test page's script did not run and the document's origin was "null". Built with GCC only.

    Fixes #1363

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sat Nov 21 19:18:28 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/380c33adbf3f1a62e24ab3b9
    Modified Files:
    docs/v322_new.md src/sbbs3/websrvr.cpp
    Log Message:
    Web Server: refuse HTTP authentication for a deleted or inactive account

    check_ars() looked up the user named in an HTTP Basic or Digest
    Authorization header and checked the password, but never the account's
    status, so the right password logged in a deleted or inactive account.
    An inactive account keeps its name, so it could log in by name; a
    deleted one has its name removed from the name index, but with logins by
    user number allowed (LOGIN_USERNUM) it could still log in by number.
    Every other login path refuses such an account: the terminal server,
    FTP, POP3, SMTP AUTH, and the JavaScript login() of the web server and Services.

    Now such a login is refused like one with an unknown user, logged as
    !DELETED or INACTIVE user, and counted as a failed login attempt against
    the request's client. The password recorded with a failed HTTP
    authentication (the Basic password, or "<digest>") comes from one
    helper.

    Tested on Linux against an isolated test server: HTTP Basic logins with
    the right password for a deleted account and for an inactive one were
    refused (401) and logged, and an active user's login still succeeded.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sat Nov 21 23:54:10 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/c2cb2a487863524951f4e2ef
    Modified Files:
    docs/v322_new.md src/sbbs3/websrvr.cpp
    Log Message:
    Web Server: exempt ipfilter_exempt.cfg clients from the connection limiter

    The connection rate limiter (MaxConnectsPerPeriod, SCFG Limit Rate of Connections), applied when a connection is accepted, did not check ipfilter_exempt.cfg, unlike the request rate limiter and the concurrent-connection limit. Behind a reverse proxy that passes the
    client's address in a request header, every connection comes from the
    proxy, so once the proxy exceeded the limit, all visitors were refused
    for the rest of the period, even with the proxy listed as exempt. The
    limiter's auto-filter already skipped an exempt address (filter_ip()
    checks the list), but the connection was still refused.

    Tested on Linux against an isolated Web Server with a limit of 3
    connections per 10 minutes: five connections from the exempt loopback
    proxy were all served; with loopback not exempt, the fourth was refused.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)