putRole refuses to take group.configure from a role only when that role is the only configuring role (configuring.len() == 1). It counts roles, not the people holding them. Take a group with admin (held by alice) and owner (granted group.configure, held by nobody). Alice calls putRole {role: "admin", actions: ["invite"]}. Two roles configure, so the check passes and admin loses group.configure. Now nobody holds a configuring role. Nobody can call putRole, deleteRole or anything else that needs group.configure. Nobody can give owner either, unless some role carrying role.assign happens to list owner as assignable; admin's default assignable is [member]. assignRoles, ejectMember and leaveGroup count holders (keeps_a_configurer, group_members.rs:137), so the gap is only in putRole. deleteRole is safe, since it refuses a role anyone holds. The tests in crates/group-host/tests/members.rs (around line 147) only cover the single-configuring-role case.
How to see it
Read against docs/fresh at 4636e6d, the code at: group_members.rs:235-242. Paths are under crates/group-host/src unless they say otherwise. Severity: high.
What you expected
in putRole, when the new grant drops group.configure, work out the configuring roles after the change and require that some member holds one, the same check keeps_a_configurer makes over memberships.
Where
The host, as built from 4636e6d. Found while checking the docs against the code.
What happened
putRolerefuses to takegroup.configurefrom a role only when that role is the only configuring role (configuring.len() == 1). It counts roles, not the people holding them. Take a group withadmin(held by alice) andowner(grantedgroup.configure, held by nobody). Alice callsputRole {role: "admin", actions: ["invite"]}. Two roles configure, so the check passes and admin losesgroup.configure. Now nobody holds a configuring role. Nobody can callputRole,deleteRoleor anything else that needsgroup.configure. Nobody can giveownereither, unless some role carryingrole.assignhappens to listowneras assignable; admin's defaultassignableis[member].assignRoles,ejectMemberandleaveGroupcount holders (keeps_a_configurer, group_members.rs:137), so the gap is only inputRole.deleteRoleis safe, since it refuses a role anyone holds. The tests incrates/group-host/tests/members.rs(around line 147) only cover the single-configuring-role case.How to see it
Read against
docs/freshat 4636e6d, the code at: group_members.rs:235-242. Paths are undercrates/group-host/srcunless they say otherwise. Severity: high.What you expected
in
putRole, when the new grant dropsgroup.configure, work out the configuring roles after the change and require that some member holds one, the same checkkeeps_a_configurermakes over memberships.Where
The host, as built from 4636e6d. Found while checking the docs against the code.