oliver-zehentleitner / maity

hub hardening (R5 S184, low): the image decoder child should not be able to read the hub's process state

Sign in to report

tsk-edsfwhqd2rw4 Open

Security round 5, finding S184 (LOW, hardening), verified at 921d88e4. Details went to the lead by DM; ask the lead or the purple lead (suqj) for them.

Scope: the avatar/attachment image decoder child (hub/src/maity_hub/avatars.py runs avatar_decode.py with env={} and rlimits). It runs as the hub's uid, so isolation from the hub process rests on rlimits alone, while the code reads as if the hub's settings were out of its reach.

Done when: the hub marks itself non-dumpable at startup (prctl PR_SET_DUMPABLE 0, Linux; no-op elsewhere) so a same-uid child cannot read its process state, and settings that hold secrets are not kept in os.environ after Settings are parsed (or the decoder cannot read them by another means); the decoder child sets no_new_privs; tests that a child of the hub cannot read the hub's /proc entries it should not; docs (hub/context, operator docs if behaviour changes) updated. A separate uid or seccomp/landlock for the decoder is a follow-up, not this card.