privileges gate: a template named like another app's appdata folder gets no root; one folder for two apps fails (security review 2026-10-18)
gates / gates (push) Successful in 6s
gates / gates (push) Successful in 6s
This commit is contained in:
1 parent
d928932087
commit
fc93846b2c
3 files changed
+12
-1
No files matched your search
@@ -14,6 +14,8 @@
|
||||
new cases; the homepage-entry cases now run on a test list carrying the old entry, and the homepage socket on the REAL
|
||||
list is a FACT (refused). Red-proof: root back at `${HDD_PATH}/appdata` → four R-1142 decoys convict the gate
|
||||
(felhom.eu `audits/night-2026-10-18/P1/redproof-catalog-gate-r1142.txt`).
|
||||
- **Security review 2026-10-18 (same night):** a template NAMED like a folder the list gives to another app (`paperless`)
|
||||
gets no `${HDD_PATH}` root, and one folder given to two apps fails the gate — two more decoys, as the box.
|
||||
- **Order:** this commit is pushed BEFORE controller v0.329.0 (which refuses the old homepage template); an older
|
||||
controller accepts this one.
|
||||
|
||||
|
||||
@@ -354,7 +354,11 @@ def appdata_folder(app, folders):
|
||||
"""The app's own folder under ${HDD_PATH}/appdata/ (R-1142) — as the box's privpolicy.AppdataFolder."""
|
||||
if app in folders:
|
||||
return folders[app]
|
||||
return app if one_segment(app) else ""
|
||||
# a folder the list gives to ANOTHER app is not this app's, even when it is named like it (security review
|
||||
# 2026-10-18: a template called "paperless" must not get paperless-ngx's files)
|
||||
if not one_segment(app) or app in folders.values():
|
||||
return ""
|
||||
return app
|
||||
|
||||
|
||||
def valid_roots(env, app="", folders=None):
|
||||
@@ -531,6 +535,9 @@ def main(argv):
|
||||
if not one_segment(f):
|
||||
print("FAIL: %s: the appdata folder of %s is not one folder name: %r" % (ALLOWLIST, a, f))
|
||||
return 1
|
||||
if len(set(folders.values())) != len(folders):
|
||||
print("FAIL: %s: one appdata folder is given to two apps" % ALLOWLIST)
|
||||
return 1
|
||||
sibling = os.path.join(root, CONTROLLER_COPY)
|
||||
if os.path.exists(sibling):
|
||||
with io.open(sibling, encoding="utf-8") as f:
|
||||
|
||||
@@ -903,6 +903,8 @@ def privileges_cases():
|
||||
run("FACT: the whole appdata/ (R-1142)", {"a/docker-compose.yml": compose(vol=" - ${HDD_PATH}/appdata:/all\n")}, 1, ("appdata -> /all",))
|
||||
run("GENUINE: paperless-ngx's listed folder appdata/paperless (R-1142)", {"paperless-ngx/docker-compose.yml": compose(vol=" - ${HDD_PATH}/appdata/paperless/media:/m\n")}, 0)
|
||||
run("FACT: paperless-ngx binds appdata/paperless-ngx (the slug, where a folder is listed)", {"paperless-ngx/docker-compose.yml": compose(vol=" - ${HDD_PATH}/appdata/paperless-ngx:/m\n")}, 1, ("appdata/paperless-ngx",))
|
||||
run("FACT: a template NAMED like paperless-ngx's folder binds it (security review 2026-10-18)", {"paperless/docker-compose.yml": compose(vol=" - ${HDD_PATH}/appdata/paperless/media:/m\n")}, 1, ("appdata/paperless/media",))
|
||||
run("FACT: one appdata folder given to two apps", {"a/docker-compose.yml": compose()}, 1, ("given to two apps",), list_body=allow.replace('"paperless-ngx": "paperless"', '"paperless-ngx": "paperless", "x": "paperless"'))
|
||||
run("FACT: an appdata folder that is a path (R-1142)", {"a/docker-compose.yml": compose()}, 1, ("not one folder name",), list_body=allow.replace('"paperless-ngx": "paperless"', '"paperless-ngx": "../backups"'))
|
||||
# The stdlib reader against PyYAML on every catalog file (this suite needs PyYAML anyway).
|
||||
import importlib.util
|
||||
|
||||
Reference in new issue
Block a user