element-hq / element-hq/synapse

`event` field is sometimes returned in `/send_join` response without resident server signature on `public` rooms

Open
#18,523 0 comments 0 reactions 0 assignees View on GitHub
A-Federated-Join A-Federation O-Occasional S-Major T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

### Description

It has been [reported](https://gitlab.com/famedly/conduit/-/issues/486#note_2548845004) that when attempting to join `#fedora-space:fedoraproject.org` via `matrix.org`, the following PDU is returned inside the `event` field:
```json
{
"auth_events": [
"$4Lyc67bzAQJBiDpkpVqwsUGv5OirlAeZSuHQAfBjzAw",
"$H-GisRAGH-LulmzJVJSC_L9iLGaYVz0d-qz17bMuEqo",
"$m5UCp7erAGum3d6lJtYSQf3cGVfiLCdAJlAIaufmex8",
"$R9fQJ8U-4srtXexVDeSGHMbMOkBEGBs4zRoARH6wth8"
],
"content": {
"avatar_url": "mxc://trix.re/9wk7Dp4jm78a8v0hcI5RqHZGVsqbyTC1",
"displayname": "val",
"membership": "join"
},
"depth": 14216,
"hashes": {
"sha256": "t375zDLHIvmD/5o9A4TUbfxon2sTT9e65eaxj6xqeLM"
},
"origin": "trix.re",
"origin_server_ts": 1749215815742,
"prev_events": [
"$Bt2GqGLq5_INpqwJlCGKbApI6hNcQQXjA_-YHHdSON8"
],
"room_id": "!twHurYfxLMMQOufslw:fedoraproject.org",
"sender": "@val:trix.re",
"signatures": {
"trix.re": {
"ed25519:voCzWLcp": "7EVXTwzde2b4XSKEgOuZPhdW2OJEozv+1bgQPXHP+pJ/bPpPbmZmm0VKTHQ+NAmCuWEzCknkxHiUlcyeg48MDQ"
}
},
"state_key": "@val:trix.re",
"type": "m.room.member",
"unsigned": {
"replaces_state": "$m5UCp7erAGum3d6lJtYSQf3cGVfiLCdAJlAIaufmex8"
}
}
```

This is despite the spec stating that the `event` field response is "The membership event sent to other servers by the resident server **including a signature from the resident server**".
However, the `m.room.join_rules` of the room is `public`, meaning that the resident server does not need to sign the event **to pass the auth rules**. Stranger more, is that I managed to join `#fedora-space:fedoraproject.org` just fine on the same version of Conduit (v0.10.4), which expects for the event to be signed by the resident server if an event is returned in the `event` field (but granted I did not confirm whether my join was via `matrix.org`, as opposed to `fedoraproject.org` or some other server.

### Steps to reproduce

- Attempt to join `#fedora-space:fedoraproject.org` via join handshake (and via `matrix.org`)
- view `/send_join` response, and see that `event` is returned which is not signed by the resident server (`matrix.org`, as above)

### Homeserver

matrix.org

### Synapse Version

Synapse 1.131.0 (b=matrix-org-hotfixes-priv,10af977d05)

### Installation Method

I don't know

### Database

Whatever matrix.org is using

### Workers

I don't know

### Platform

Whatever matrix.org is using

### Configuration

_No response_

### Relevant log output

```shell
Issue was experienced on matrix.org, I don't have access to logs.
```

### Anything else that would be useful to know?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.