for a space whose access record has people, getGroupAuth takes the writes from credentialScopes (writes_for). The write check may_space instead allows only someone who is one of the people and whose roles hold repo:*. This goes wrong in both directions: - If the record has no credentialScopes (as the tests write it), an admin who is one of the people is refused a token: "no role of yours may act as the group in this space". An OAuth token could write there. - If it has credentialScopes for, say, member, a member who is not one of the people gets a token that fails every write with 403. publishable (group_tokens.rs:68-70) and rooms (oauth_scope.rs:157-164) both handle people, so this is an oversight. No test covers getGroupAuth on such a space.
How to see it
Read against docs/fresh at 4636e6d, the code at: crates/group-host/src/group_tokens.rs:135 against crates/group-host/src/token_writes.rs:463-467. Paths are under crates/group-host/src unless they say otherwise. Severity: low.
What you expected
In get_group_auth, decide the writes as rooms does. For a space with people, that is every collection when the caller reads it and holds repo:*, and nothing otherwise.
Where
The host, as built from 4636e6d. Found while checking the docs against the code.
What happened
for a space whose access record has
people,getGroupAuthtakes the writes fromcredentialScopes(writes_for). The write checkmay_spaceinstead allows only someone who is one of the people and whose roles holdrepo:*. This goes wrong in both directions: - If the record has nocredentialScopes(as the tests write it), an admin who is one of the people is refused a token: "no role of yours may act as the group in this space". An OAuth token could write there. - If it hascredentialScopesfor, say,member, a member who is not one of the people gets a token that fails every write with 403.publishable(group_tokens.rs:68-70) androoms(oauth_scope.rs:157-164) both handlepeople, so this is an oversight. No test coversgetGroupAuthon such a space.How to see it
Read against
docs/freshat 4636e6d, the code at: crates/group-host/src/group_tokens.rs:135 against crates/group-host/src/token_writes.rs:463-467. Paths are undercrates/group-host/srcunless they say otherwise. Severity: low.What you expected
In
get_group_auth, decide the writes asroomsdoes. For a space withpeople, that is every collection when the caller reads it and holdsrepo:*, and nothing otherwise.Where
The host, as built from 4636e6d. Found while checking the docs against the code.