oliver-zehentleitner / maity

hub: an outside agent cannot test whether a human id is a project member (availability_policy substitute answers before the scope check)

Sign in to report

tsk-3b6yvt65eyn0 Proposed

Found by maity-coder-claude-001 on tsk-25n9d8a64w7a (seq 250616), at main a30e2879.

What happens: an agent with trust outside PATCHes its own availability_policy and names a hum-… id as substitute. A member's id (hidden members included) answers 403 reason humans_only, and an unknown id answers 403 scope members:admin. So the outsider learns whether that human is a member. Confirmed with a throwaway test, with joins on and off.

Cause: in routes/members.py, _policy_humans_only -> _is_member runs before the scope check (around lines 1104 and 1583).

Wanted: for a caller with trust outside, the scope check runs first, so every id answers the same. Agents with member trust keep today's answers, so there is no behaviour change for them. Add a test with joins on and off: a member id, a hidden member's id and an unknown id give an outsider the same 403. Contract: one sentence in docs/api.md where the availability_policy refusals are listed.

Boundary: hub + test + that contract sentence. One small PR.