• exec/webfileindex.ssjs

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Thu Nov 19 09:20:50 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/87101559123c80dfa9c3e542
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    webfileindex.ssjs: escape file descriptions in the listing

    A file's description and extended description were written into the
    directory listing page as they are stored. Both are text the uploader
    types, so markup in one was rendered by the browser of anyone viewing
    that listing. They now go through html_encode() first, as the archive
    contents on the view page already do. File names were not affected:
    the characters that matter are not allowed in them.

    Part of #1363; the download headers described there are a separate
    change in the web server.

    Checked: the escaping on sample text under jsexec (markup shown as
    text, CP437 line drawing and the extended description's line breaks
    kept), and a live directory listing viewed by the sysop.

    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 Sun Nov 22 13:58:56 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/4f87bfacac4527955c8f1f32
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    webfileindex: view only a file of the directory, and escape its name

    The ?view= parameter was used as given: it was written unescaped into
    the page title, heading and "non-viewable file type" message (so a
    crafted link ran script on the site's own host, where it could read the
    webv4 session cookie), and appended to the directory's path to find the
    archive or image to show (so a "../" name listed the contents of any
    archive the web server could read, outside the file areas).

    The name is now accepted only if it is exactly one of the directory's
    file names; any other gets a 404 that does not repeat it. The name is HTML-escaped where it is written, and the previous/next links are
    URL-encoded (names with spaces, '&' or '#' broke them).

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