Commit afdda56c authored by jan.koester's avatar jan.koester
Browse files

Security fixes: attachment read permission, directory outage grace, HTTPS mail links

- attachments.post_id (schema v4, backfilled): an attachment is as readable as
  the post that shows it; unposted ones only for the uploader and moderators;
  only the author's own attachments get bound (quoting doesn't take them over);
  checked before mediadb is asked; private caching for restricted forums
- Directory::validate is Alive/Gone/Unknown; when fenrirds can't be asked the
  cached rights hold 15 minutes after the last real check, then only reading
  as a member; 60 s backoff; the session is no longer marked as checked
- SITE/URL (FLORIUM_URL, admin field) as public origin for mail links;
  otherwise always https://<requested name>

Co-Authored-By: default avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 2388baa1
Loading
Loading
Loading
Loading
+1
Changes for docker-compose.yml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ services:
      FLORIUM_DB_CONNECTION: "host=mammut port=5433 user=florium password=florium-db-secret dbname=florium sslverify=0"
      FLORIUM_STATIC_USERS: "admin:admin123:admin,mod:mod12345:mod,anna:anna1234:groups=team,ben:ben12345"
      FLORIUM_REGISTER_ENABLE: "true"
      FLORIUM_URL: "${FLORIUM_URL:-}"
      # registration mails (e-mail verification); the tests point this at test/smtpsink.py on the host
      FLORIUM_SMTP_HOST: "${FLORIUM_SMTP_HOST:-}"
      FLORIUM_SMTP_PORT: "${FLORIUM_SMTP_PORT:-587}"
+2
Changes for docker/entrypoint.sh: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#   FLORIUM_PORT                   (default 8080)
#   FLORIUM_TRUSTPROXY             true behind proxyplus
#   FLORIUM_SECURECOOKIES          true when served over https
#   FLORIUM_URL                    public origin for links in mails (default https://<requested name>)
#   FLORIUM_REGISTERURL            external sign up page instead of florium's own
#   FLORIUM_THEME                  default theme: classic | fenriros | forest | graphite (share/themes)
#   FLORIUM_REGISTER_ENABLE        true: own sign up page, creates the fenrirds account
@@ -111,6 +112,7 @@ if [ ! -e "$CONF" ] && [ -n "${FLORIUM_DOMAIN:-}" ]; then
        echo "        BASEPATH: $(q "${FLORIUM_BASEPATH:-}")"
        echo "        LANGUAGE: $(q "${FLORIUM_LANGUAGE:-de}")"
        echo "        THEME: $(q "${FLORIUM_THEME:-classic}")"
        echo "        URL: $(q "${FLORIUM_URL:-}")"
        echo "        REGISTERURL: $(q "${FLORIUM_REGISTERURL:-}")"
        echo "        SECURECOOKIES: ${FLORIUM_SECURECOOKIES:-false}"
        echo "      DATABASE:"
+1
Changes for docker/florium.yaml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ FLORIUM:
        BASEPATH: ""              # e.g. "/forum" behind a proxy prefix
        LANGUAGE: "de"            # de | en
        THEME: "classic"          # share/themes/<name>.css
        URL: ""                   # public origin for links in mails, e.g. https://forum.example.org
        REGISTERURL: ""           # external sign up page instead of florium's own
        SECURECOOKIES: true
        POSTSPERPAGE: 20
+3
Changes for share/i18n/en.tsv: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -453,3 +453,6 @@ Passwort Password
Meine Beiträge	My posts
keine	none
Setup-Code	Setup code
Öffentliche Adresse	Public address
z.B. https://forum.example.org -- für die Links in E-Mails; leer = https:// und der aufgerufene Domainname	e.g. https://forum.example.org -- for the links in mails; empty = https:// and the requested domain name
Die öffentliche Adresse muss http(s)://host[:port] sein (ohne Pfad).	The public address must be http(s)://host[:port] (without a path).
+7
Changes for src/adminserver.cpp: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -312,6 +312,8 @@ code.setup{font-size:1.3em;letter-spacing:.15em}.inline{display:flex;gap:.6em;al
        select(c4, loc("Theme"), "theme", s.theme, themeOptions(shareDir));
        HtmlElement &c5 = el(r2, "div");
        input(c5, loc("Pfad-Präfix"), "basepath", s.basePath, "text", loc("leer oder z.B. /forum hinter einem Proxy"));
        input(fs1, loc("Öffentliche Adresse"), "url", s.url, "url",
              loc("z.B. https://forum.example.org -- für die Links in E-Mails; leer = https:// und der aufgerufene Domainname"));
        input(fs1, loc("Logo"), "logo", s.logo, "text",
              loc("Bild-URL, oder unten auf dieser Seite eine Datei hochladen; leer = kein Logo (das Theme zeigt dann sein Zeichen)"));
        HtmlElement &r3 = el(fs1, "div", {{"class", "row"}});
@@ -425,6 +427,11 @@ code.setup{font-size:1.3em;letter-spacing:.15em}.inline{display:flex;gap:.6em;al
        s.language = a("language") == "en" ? "en" : "de";
        s.theme = a("theme");
        s.basePath = a("basepath");
        s.url = a("url");
        while (!s.url.empty() && s.url.back() == '/')
            s.url.pop_back();
        if (!s.url.empty() && !validPublicUrl(s.url))
            return loc("Die öffentliche Adresse muss http(s)://host[:port] sein (ohne Pfad).");
        s.logo = a("logo");
        s.postsPerPage = toInt(a("postsperpage"), 20);
        s.threadsPerPage = toInt(a("threadsperpage"), 30);
Loading