From 8eb4d538109bf33a3b9ff8faa9c63c268d557225 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 21 Oct 2021 22:59:01 +0200 Subject: [PATCH] providers/oauth2: fix events being created from /application/o/authorize/ Signed-off-by: Jens Langhammer --- authentik/providers/oauth2/views/authorize.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/authentik/providers/oauth2/views/authorize.py b/authentik/providers/oauth2/views/authorize.py index 6cfd5c8cf..3ae738d75 100644 --- a/authentik/providers/oauth2/views/authorize.py +++ b/authentik/providers/oauth2/views/authorize.py @@ -386,6 +386,9 @@ class AuthorizationFlowInitView(PolicyAccessView): def pre_permission_check(self): """Check prompt parameter before checking permission/authentication, see https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3.1.2.6""" + # Quick sanity check at the beginning to prevent event spamming + if len(self.request.GET) < 1: + raise Http404 try: self.params = OAuthAuthorizationParams.from_request(self.request) except AuthorizeError as error: