~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

putRole can leave nobody able to configure the group

Closed
Closed chadtmiller.com opened this issue 0 comments

What happened

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.