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

Event auth allows booleans as power levels #14940

@tulir

Description

@tulir

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"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Spec-Complianceplaces where synapse does not conform to the specO-OccasionalAffects or can be seen by some users regularly or most users rarelyS-MajorMajor functionality / product severely impaired, no satisfactory workaround.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions