mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 03:34:55 -04:00
Properly check for frozendicts in event auth code. (#14864)
Check for for an instance of a mapping instead of a dict. This only affects room version 10 when frozen events are enabled.
This commit is contained in:
parent
e1b2c7095d
commit
4d6b1d3c47
2 changed files with 3 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import collections.abc
|
||||
import logging
|
||||
import typing
|
||||
from typing import (
|
||||
|
@ -877,7 +878,7 @@ def _check_power_levels(
|
|||
if not isinstance(v, int):
|
||||
raise SynapseError(400, f"{v!r} must be an integer.")
|
||||
if k in {"events", "notifications", "users"}:
|
||||
if not isinstance(v, dict) or not all(
|
||||
if not isinstance(v, collections.abc.Mapping) or not all(
|
||||
isinstance(v, int) for v in v.values()
|
||||
):
|
||||
raise SynapseError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue