matrix-org / matrix-org/matrix-spec

Auth rules don't explicitly prevent `m.room.create` events from having `auth_events`.

Open
#1,061 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clarification
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

Originally from #1048.

Link to problem area: https://spec.matrix.org/v1.2/rooms/v9/#authorization-rules

Issue

The auth rules begin:

  1. If type is m.room.create:
    1. If it has any previous events, reject.
    2. If the domain of the room_id does not match the domain of the sender, reject.
    3. If content.room_version is present and is not a recognised version, reject.
    4. If content has no creator field, reject.
    5. 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_events field of a PDU identifies the set of events which give the sender permission to send the event. The auth_events for the m.room.create event 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.