matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.79k stars 2.13k forks source link

Spec compliance: synapse does not appear to correctly enforce strict canonicaljson in federation requests, etc #13883

Open richvdh opened 1 year ago

richvdh commented 1 year ago

The canonicaljson spec says that json requests cannot contain:

... which should mean that it is impossible to sign a federation request containing such values, so all such requests should be rejected. However AFAICT Synapse does not enforce this.

Canonicaljson is used in a couple of other places too (3pid invites, E2EE, etc), and the same considerations apply there.

richvdh commented 1 year ago

Related: https://github.com/matrix-org/synapse/pull/7381