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

Roles that are not defined can be given through admitMember

Closed
Closed chadtmiller.com opened this issue 0 comments

What happened

assignRoles refuses undefined roles. admitMember only checks that each named role is in the admitter's assignable list. putRole accepts any string in assignable without checking that it is defined. So putRole admin {assignable: [{role: "ghost"}]} followed by admitMember {roles: [{role: "ghost"}]} writes a membership holding ghost, which grants nothing and is listed nowhere. That member then can't read the members space (see the member section above).

How to see it

Read against docs/fresh at 4636e6d, the code at: group_join.rs:169-183; group_members.rs:286. Paths are under crates/group-host/src unless they say otherwise. Severity: low.

What you expected

Check the named roles against the role records in admitMember, and the assignable roles in putRole.

Where

The host, as built from 4636e6d. Found while checking the docs against the code.