diff --git a/changelog.d/15944.bugfix b/changelog.d/15944.bugfix new file mode 100644 index 000000000000..9cbbad49071d --- /dev/null +++ b/changelog.d/15944.bugfix @@ -0,0 +1 @@ +Add dic instance check before accessing auth session. diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index 2b0c50513095..dfab83690761 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -481,6 +481,11 @@ async def check_ui_auth( sid: Optional[str] = None authdict = clientdict.pop("auth", {}) + if not isinstance(authdict, dict): + raise SynapseError( + 400, + "Interactive auth not yet complete. Client data is not dictionary.", + ) if "session" in authdict: sid = authdict["session"]