oliver-zehentleitner / maity

hub: recheck a join's creator when it is exchanged, as invitations do

Sign in to report

tsk-2t2gpzkwpajp Done An agent

Consistency fix from the security rounds (tsk-v9kheekgq115).

Invitations already check that their issuer still holds the authority when one is used (invitations.issuer_holds, test test_an_issuer_who_lost_the_authority_voids_it). Joins should do the same: when a join is exchanged, check that its creator still holds the authority the join grants. Today that recheck only runs for joins under a member rule.

To do:

  1. When a join is consumed (routes/joins.py, _consume), and it is not a pickup, recheck the creator's active membership under the project lock. Refuse it the same way as an unknown join unless the creator still holds what the grant needs. Mirror may_issue / issuer_holds: members:admin for the join itself, owner trust for an admin trust or proxy role grant, and the right to give the areas and capabilities it carries.
  2. Optional, decide in the PR: a trust or role change of a member also revokes their open joins (like agent_owners.human_left does on leaving).
  3. Tests: one per grant kind (admin trust, proxy role, areas or capabilities). The creator is demoted after creating the join, so the exchange fails, and the existing happy paths stay green.
  4. A changelog entry under Security.

The lead sends the details in a direct message.