Security updates batch 1 (felhom.eu R-1306): security_fix steps rallly 4.16.3, romm 5.4.1, code-server 4.143.1, outline 1.12.0, vikunja 2.7.1 + wishlist v0.69.0 normal step; Rallly and Jellyfin fixtures follow the apps; privileges gate skips steps/*.felhom.yml (decoy, red first)
gates / gates (push) Successful in 38s
gates / gates (push) Successful in 38s
On the operator's yes at the batch STOP (2026-10-27). Each step proven on scratch 9202 by box_walk.py --security (wishlist: bench 9401 + box). Evidence: felhom.eu documentation/audits/security-app-updates-2026-10-27/.
This commit is contained in:
1 parent
9ff723ca4d
commit
06e603e88d
28 files changed
+1813
-37
No files matched your search
@@ -2,7 +2,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""check-privileges.py — no template asks for container rights the box's allow-list does not give (R-971).
|
||||
|
||||
python3 scripts/check-privileges.py # every templates/<app>/docker-compose.yml and steps/*.yml
|
||||
python3 scripts/check-privileges.py # every templates/<app>/docker-compose.yml and steps/*.yml (not steps/*.felhom.yml)
|
||||
python3 scripts/check-privileges.py --root DIR # another checkout (the decoy harness)
|
||||
|
||||
WHY (R-971, operator decision D2 = A, 2026-10-17). A push to this repo's `main` reaches every installed app within
|
||||
@@ -516,7 +516,11 @@ def judge_files(root):
|
||||
for d, _, fs in os.walk(tdir):
|
||||
for f in sorted(fs):
|
||||
p = os.path.join(d, f)
|
||||
if f == "docker-compose.yml" or (os.path.basename(d) == "steps" and f.endswith(".yml")):
|
||||
# a step's own `.felhom.yml` copy (steps/<key>.felhom.yml) is not a compose file: the box reads it with its
|
||||
# metadata reader, never through the allow-list (felhom-controller stacks/image_retention.go excludes it the
|
||||
# same way); judged as compose, a `*word` in a quoted guide line read as a YAML alias (2026-10-27, vikunja)
|
||||
if f == "docker-compose.yml" or (os.path.basename(d) == "steps" and f.endswith(".yml")
|
||||
and not f.endswith(".felhom.yml")):
|
||||
files.append(p)
|
||||
return tdir, sorted(files)
|
||||
|
||||
|
||||
@@ -982,6 +982,9 @@ def privileges_cases():
|
||||
run("DECOY: privileged: false", {"a/docker-compose.yml": compose(" privileged: false\n")}, 0)
|
||||
run("DECOY: no-new-privileges (a hardening)", {"a/docker-compose.yml": compose(" security_opt:\n - no-new-privileges:true\n")}, 0)
|
||||
run("DECOY: the docker socket only in a COMMENT", {"a/docker-compose.yml": compose(vol=" # - /var/run/docker.sock:/var/run/docker.sock\n")}, 0)
|
||||
run("DECOY: a step's .felhom.yml copy with `*word` in a quoted guide line (not a compose file)",
|
||||
{"a/docker-compose.yml": compose(), "a/steps/0123456789abcdef.yml": compose(),
|
||||
"a/steps/0123456789abcdef.felhom.yml": 'guide:\n - "Tej *bolt."\n'}, 0)
|
||||
run("GENUINE: homepage's allow-listed read-only socket", {"homepage/docker-compose.yml": homepage}, 0, list_body=hp_list)
|
||||
print("-- privileges: the facts (each MUST be refused)")
|
||||
run("FACT: privileged true", {"a/docker-compose.yml": compose(" privileged: true\n")}, 1, ("app: privileged true",))
|
||||
@@ -1026,7 +1029,11 @@ def privileges_cases():
|
||||
bad = [p for p in files if m.violations(yaml.safe_load(io.open(p, encoding="utf-8")), m.PLACEHOLDER_ENV)
|
||||
!= m.violations(m.load(io.open(p, encoding="utf-8").read()), m.PLACEHOLDER_ENV)]
|
||||
ran += 1
|
||||
ok = len(files) >= 100 and not bad
|
||||
# scope as a fact, not a count (2026-10-27: steps/*.felhom.yml left the set): EVERY template's compose is read,
|
||||
# and step compose files too
|
||||
composes = {os.path.join(ROOT, "templates", a, "docker-compose.yml") for a in os.listdir(os.path.join(ROOT, "templates"))
|
||||
if os.path.isfile(os.path.join(ROOT, "templates", a, "docker-compose.yml"))}
|
||||
ok = composes <= set(files) and any("/steps/" in p for p in files) and not bad
|
||||
print(" %s %-70s files=%d differ=%d" % ("ok" if ok else "XX", "READER: the stdlib reader equals PyYAML on the catalog", len(files), len(bad)))
|
||||
if not ok:
|
||||
fails.append("privileges reader differs from PyYAML on %s (files=%d)" % (bad[:5], len(files)))
|
||||
|
||||
@@ -1751,6 +1751,11 @@ class Rallly:
|
||||
pw = "Drill-" + secrets.token_hex(10)
|
||||
rc, code, out = self._auth(w, sub, "sign-up/email", {"email": email, "password": pw, "name": "Drill"})
|
||||
say(f" rallly: sign-up http={code}")
|
||||
if code == "400" and "EMAIL_PASSWORD_SIGN_UP_DISABLED" in (out or ""):
|
||||
ck = self._otp_sign_in(w, sub, email, say) # 4.15+: e-mail code only (measured 2026-10-27, 4.15.3)
|
||||
if not ck or not self._setup_space(w, sub, ck, say):
|
||||
return None
|
||||
return self._make_poll(w, sub, ck, say)
|
||||
if code != "200":
|
||||
self.tried = f"POST /api/better-auth/sign-up/email -> {code}"
|
||||
return None
|
||||
@@ -1776,6 +1781,65 @@ class Rallly:
|
||||
if code != "200" or "session_token" not in ck:
|
||||
self.tried = f"POST /api/better-auth/sign-in/email -> {code}"
|
||||
return None
|
||||
return self._make_poll(w, sub, ck, say)
|
||||
|
||||
def _code(self, w, ident):
|
||||
"""The six-digit code Rallly stored for `ident` (a SELECT on its own `verifications` row, never a write)."""
|
||||
for _ in range(10):
|
||||
otp = w.guest("docker exec rallly-postgres psql -U rallly -d rallly -Atc "
|
||||
f"\"select split_part(value,':',1) from verifications where identifier="
|
||||
f"'{ident}' order by created_at desc limit 1\" 2>&1").strip()
|
||||
if re.fullmatch(r"\d{6}", otp):
|
||||
return otp
|
||||
time.sleep(2)
|
||||
return None
|
||||
|
||||
def _otp_sign_in(self, w, sub, email, say):
|
||||
"""Rallly >= 4.15 refuses a password sign-up (EMAIL_PASSWORD_SIGN_UP_DISABLED); the household signs in with an
|
||||
e-mailed code, and the first sign-in makes the account: `email-otp/send-verification-otp` (type sign-in), the
|
||||
code read from the app's own table, then `sign-in/email-otp`."""
|
||||
rc, code, out = self._auth(w, sub, "email-otp/send-verification-otp", {"email": email, "type": "sign-in"})
|
||||
say(f" rallly: e-mail code sign-in requested http={code}")
|
||||
if code != "200":
|
||||
self.tried = f"POST /api/better-auth/email-otp/send-verification-otp -> {code}"
|
||||
return None
|
||||
otp = self._code(w, f"sign-in-otp-{email}")
|
||||
if not otp:
|
||||
self.tried = "the sign-in code was not in the app's own verifications table"
|
||||
say(" rallly: no sign-in code found in the app's own table")
|
||||
return None
|
||||
rc, code, out = self._auth(w, sub, "sign-in/email-otp", {"email": email, "otp": otp})
|
||||
ck = _set_cookies(out)
|
||||
say(f" rallly: sign-in with the code http={code} session={'session_token' in ck}")
|
||||
if code != "200" or "session_token" not in ck:
|
||||
self.tried = f"POST /api/better-auth/sign-in/email-otp -> {code}"
|
||||
return None
|
||||
return ck
|
||||
|
||||
def _setup_space(self, w, sub, ck, say):
|
||||
"""Rallly >= 4.15: a poll needs a space (`polls.make` -> 403 „You must be a member of a space"), which the new
|
||||
user makes on the /setup page with the „Personal" choice. That page posts a Next.js server action whose id is
|
||||
build-specific, so the id is READ from the app's own server-reference-manifest (a file read, never a write) and
|
||||
the action is posted to /setup exactly as the page posts it: `[{"spaceType": "personal"}]`. Measured on 9202
|
||||
2026-10-27 (4.15.3): 200 `1:{}`, then `polls.make` 200."""
|
||||
man = w.guest("docker exec rallly cat /app/apps/web/.next/server/server-reference-manifest.json 2>/dev/null")
|
||||
try:
|
||||
aid = [k for k, v in json.loads(man).get("node", {}).items() if v.get("exportedName") == "setupSpaceAction"][0]
|
||||
except Exception:
|
||||
self.tried = "no setupSpaceAction in the app's server-reference-manifest"
|
||||
say(" rallly: the setup action was not found in the app's manifest")
|
||||
return False
|
||||
rc, code, out = w.app_curl(sub, "/setup", "-H", f"Cookie: {ck}", "-H", f"Next-Action: {aid}",
|
||||
"-H", "Accept: text/x-component", "-H", "Content-Type: text/plain;charset=UTF-8",
|
||||
"-H", f"Origin: https://{sub}.{w.DOMAIN}", data=json.dumps([{"spaceType": "personal"}]),
|
||||
method="POST")
|
||||
ok = code == "200" and "1:{}" in (out or "")
|
||||
say(f" rallly: personal space set up http={code} ok={ok}")
|
||||
if not ok:
|
||||
self.tried = f"POST /setup (setupSpaceAction) -> {code} {(out or '')[-120:]}"
|
||||
return ok
|
||||
|
||||
def _make_poll(self, w, sub, ck, say):
|
||||
title = "drillpoll-" + secrets.token_hex(4)
|
||||
rc, code, out = w.app_curl(sub, "/api/trpc/polls.make", "-H", f"Cookie: {ck}", "-H", "Content-Type: application/json",
|
||||
"-H", f"Origin: https://{sub}.{w.DOMAIN}",
|
||||
|
||||
@@ -344,12 +344,20 @@ class Immich:
|
||||
|
||||
|
||||
class _MediaServer:
|
||||
"""jellyfin / emby — the startup wizard IS the front door on a fresh install."""
|
||||
"""jellyfin / emby — the startup wizard IS the front door on a fresh install.
|
||||
|
||||
Jellyfin 10.11 (measured on the bench 2026-10-27, 10.11.11): the wizard's first user exists only after
|
||||
`GET /Startup/User` (a POST before it is 404), and `/Users/Public` lists nobody (`[]`). So the seed GETs first,
|
||||
and the readback is the household's own sign-in, `POST /Users/AuthenticateByName`: the seeded password must give a
|
||||
token AND a wrong one must be refused — the control that keeps an always-yes readback from passing."""
|
||||
AUTH = 'MediaBrowser Client="felhom-drill", Device="drill", DeviceId="felhom-drill", Version="1"'
|
||||
|
||||
def seed(self, w, sub, say):
|
||||
if not w.wait_app(sub, "/", want=("200", "302"), tries=90):
|
||||
if not w.wait_app(sub, "/System/Info/Public", want=("200",), tries=90):
|
||||
return None
|
||||
u = "drill" + secrets.token_hex(4)
|
||||
pw = "Drill-" + secrets.token_hex(8)
|
||||
w.app_curl(sub, "/Startup/User")
|
||||
rc, code, out = w.app_curl(sub, "/Startup/User", "-H", "Content-Type: application/json",
|
||||
data=json.dumps({"Name": u, "Password": pw}), method="POST")
|
||||
if code not in ("200", "204"):
|
||||
@@ -358,17 +366,25 @@ class _MediaServer:
|
||||
return None
|
||||
w.app_curl(sub, "/Startup/Complete", method="POST")
|
||||
say(f" {self.name}: seeded first user {u}")
|
||||
return {"u": u}
|
||||
return {"u": u, "pw": pw}
|
||||
|
||||
def _login(self, w, sub, u, pw):
|
||||
rc, code, out = w.app_curl(sub, "/Users/AuthenticateByName", "-H", "Content-Type: application/json",
|
||||
"-H", f"Authorization: {self.AUTH}", data=json.dumps({"Username": u, "Pw": pw}),
|
||||
method="POST")
|
||||
return code, '"AccessToken"' in (out or "")
|
||||
|
||||
def verify(self, w, sub, t, say):
|
||||
rc, code, out = w.app_curl(sub, "/Users/Public")
|
||||
found = t["u"] in (out or "")
|
||||
absent = ("nope" + secrets.token_hex(6)) not in (out or "")
|
||||
if not absent:
|
||||
say(f" {self.name}: READBACK UNUSABLE")
|
||||
if not w.wait_app(sub, "/System/Info/Public", want=("200",), tries=90):
|
||||
say(f" {self.name}: /System/Info/Public never came back")
|
||||
return False
|
||||
c_bad, tok_bad = self._login(w, sub, t["u"], "wrong-" + secrets.token_hex(5))
|
||||
if tok_bad or c_bad == "200":
|
||||
say(f" {self.name}: READBACK UNUSABLE — a wrong password was not refused (http {c_bad})")
|
||||
return None
|
||||
say(f" {self.name}: readback found={found} (http {code}, control passed)")
|
||||
return found
|
||||
c_ok, tok = self._login(w, sub, t["u"], t["pw"])
|
||||
say(f" {self.name}: sign-in as the seeded user http={c_ok} token={tok} (wrong password refused: http {c_bad})")
|
||||
return tok
|
||||
|
||||
|
||||
class Jellyfin(_MediaServer):
|
||||
|
||||
Reference in new issue
Block a user