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

Event auth allows booleans as power levels #14940

Closed
tulir opened this issue Jan 30, 2023 · 0 comments · Fixed by #14944
Closed

Event auth allows booleans as power levels #14940

tulir opened this issue Jan 30, 2023 · 0 comments · Fixed by #14944
Labels
A-Spec-Compliance places where synapse does not conform to the spec O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@tulir
Copy link
Member

tulir commented Jan 30, 2023

Description

⁣Synapse validates power levels in event authorization using isinstance(v, int). However, booleans in Python are also instances of int. Therefore, Synapse allows booleans as power levels, even though v10 rooms should only allow ints.

Steps to reproduce

  1. Disable the local (non-federation) event validation
  2. Send a power level event in a v10 room that contains a boolean (true or false) where there should be an integer

Homeserver

maunium.net → matrix.org

Synapse Version

1.76.0rc2

Anything else that would be useful to know?

Power level event received and accepted by matrix.org:

{
  "content": {
    "events_default": false,
    "invite": true,
    "users": {
      "@tulir:matrix.org": true,
      "@tulir:maunium.net": 9001
    },
    "users_default": false
  },
  "origin_server_ts": 1675084843722,
  "sender": "@tulir:maunium.net",
  "state_key": "",
  "type": "m.room.power_levels",
  "unsigned": {
    "replaces_state": "$RevlilKC-G4vl1U--eXxjLKjEddGSr_zBFPGY-A7ftg"
  },
  "event_id": "$ij4iOVCAKqFzOijUqs4ZyuWRHpjkly5tYp8UR0NOQVU",
  "room_id": "!VielVjraKNGUibBfrN:maunium.net"
}
@clokep clokep added A-Spec-Compliance places where synapse does not conform to the spec S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Occasional Affects or can be seen by some users regularly or most users rarely labels Jan 30, 2023
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-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants