This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Event auth allows booleans as power levels #14940
Copy link
Copy link
Closed
Labels
A-Spec-Complianceplaces where synapse does not conform to the specplaces where synapse does not conform to the specO-OccasionalAffects or can be seen by some users regularly or most users rarelyAffects or can be seen by some users regularly or most users rarelyS-MajorMajor functionality / product severely impaired, no satisfactory workaround.Major functionality / product severely impaired, no satisfactory workaround.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Description
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
- Disable the local (non-federation) event validation
- Send a power level event in a v10 room that contains a boolean (
true
orfalse
) 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
Labels
A-Spec-Complianceplaces where synapse does not conform to the specplaces where synapse does not conform to the specO-OccasionalAffects or can be seen by some users regularly or most users rarelyAffects or can be seen by some users regularly or most users rarelyS-MajorMajor functionality / product severely impaired, no satisfactory workaround.Major functionality / product severely impaired, no satisfactory workaround.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.