matrix-org / matrix-org/matrix-spec
Auth rules don't explicitly prevent `m.room.create` events from having `auth_events`.
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
Link to problem area: https://spec.matrix.org/v1.2/rooms/v9/#authorization-rules
Issue
The auth rules begin:
- If type is m.room.create:
- If it has any previous events, reject.
- If the domain of the room_id does not match the domain of the sender, reject.
- If content.room_version is present and is not a recognised version, reject.
- If content has no creator field, reject.
- Otherwise, allow.
This doesn't restrict the auth_events on m.room.create events. The auth events selection intends for there to be no auth_events:
The
auth_eventsfield of a PDU identifies the set of events which give the sender permission to send the event. Theauth_eventsfor them.room.createevent in a room is empty; for other events, it should be the following subset of the room state: [...]
But that rule isn't explicitly enforced in the suite of checks on incoming PDUs.
On the face of it, fixing this by requiring servers to reject m.room.create events with auth events would require a room version bump, because it changes the authorisation rules. But the m.room.create event is special in that it marks the start of the event DAG. Perhaps that gives us some extra wiggle room.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the v1.2 room authorization rules, the auth-events selection section, and the checks performed on receipt of a PDU linked in the issue. Determine whether rejecting auth_events on m.room.create requires a room version change, then update the relevant specification rules and document the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100