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

fix: check authdict before accessing any attribute #16153

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/16153.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Checking authdict dictionary before accessing session from it.

Contributed by @prajjawal05
2 changes: 1 addition & 1 deletion synapse/handlers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ async def check_ui_auth(

sid: Optional[str] = None
authdict = clientdict.pop("auth", {})
if "session" in authdict:
if authdict and "session" in authdict:
sid = authdict["session"]

# Convert the URI and method to strings.
Expand Down