Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

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

Open
richvdh opened this issue Sep 23, 2022 · 1 comment
Labels
A-Spec-Compliance places where synapse does not conform to the spec O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@richvdh
Copy link
Member

richvdh commented Sep 23, 2022

The canonicaljson spec says that json requests cannot contain:

  • Integers outside the range [-2 ^ 53 + 1, 2 ^ 53 - 1]
  • Floats
  • NaN, Infinity, -Infinity

... 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
Copy link
Member Author

richvdh commented Sep 23, 2022

Related: #7381

@richvdh richvdh added A-Spec-Compliance places where synapse does not conform to the spec S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Sep 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Spec-Compliance places where synapse does not conform to the spec O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

1 participant