From f8348fb883ffe3cd3bd9b8571ea2020135ca2db6 Mon Sep 17 00:00:00 2001 From: Prajjawal Agarwal Date: Tue, 22 Aug 2023 01:19:32 -0400 Subject: [PATCH 1/4] fix: check authdict before accessing any attribute --- synapse/handlers/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index 59ecafa6a094..e2fc9299710b 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -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. From f9fd27b14c34e9c91937577fb48a1ad1d20c07f8 Mon Sep 17 00:00:00 2001 From: Prajjawal Agarwal Date: Tue, 22 Aug 2023 01:27:48 -0400 Subject: [PATCH 2/4] Create 15871.bugfix --- changelog.d/15871.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/15871.bugfix diff --git a/changelog.d/15871.bugfix b/changelog.d/15871.bugfix new file mode 100644 index 000000000000..11d16f0d23f3 --- /dev/null +++ b/changelog.d/15871.bugfix @@ -0,0 +1 @@ +Checking authdic dictionary before accessing session from it. From 16335474f0a0c03b4e9af895c603f23429d99f43 Mon Sep 17 00:00:00 2001 From: Prajjawal Agarwal Date: Tue, 22 Aug 2023 01:28:51 -0400 Subject: [PATCH 3/4] added contribution info in changelog --- changelog.d/15871.bugfix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.d/15871.bugfix b/changelog.d/15871.bugfix index 11d16f0d23f3..7a00baa499e4 100644 --- a/changelog.d/15871.bugfix +++ b/changelog.d/15871.bugfix @@ -1 +1,3 @@ Checking authdic dictionary before accessing session from it. + +Contributed by @prajjawal05 From 1093c972171e9aa88271250a84e367bcd298a906 Mon Sep 17 00:00:00 2001 From: Prajjawal Agarwal Date: Tue, 22 Aug 2023 01:31:12 -0400 Subject: [PATCH 4/4] Update and rename 15871.bugfix to 16153.bugfix --- changelog.d/15871.bugfix | 3 --- changelog.d/16153.bugfix | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 changelog.d/15871.bugfix create mode 100644 changelog.d/16153.bugfix diff --git a/changelog.d/15871.bugfix b/changelog.d/15871.bugfix deleted file mode 100644 index 7a00baa499e4..000000000000 --- a/changelog.d/15871.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Checking authdic dictionary before accessing session from it. - -Contributed by @prajjawal05 diff --git a/changelog.d/16153.bugfix b/changelog.d/16153.bugfix new file mode 100644 index 000000000000..2fcc74736a93 --- /dev/null +++ b/changelog.d/16153.bugfix @@ -0,0 +1,3 @@ +Checking authdict dictionary before accessing session from it. + +Contributed by @prajjawal05