From 6ae52f1a1df559aa9ea8d92c255ab33501fac735 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 27 Aug 2025 16:10:40 +0200 Subject: [PATCH] Give better error message when invalid data is passed to cauth in d param This imports the latest version of upstream. --- pgcommitfest/auth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pgcommitfest/auth.py b/pgcommitfest/auth.py index c3756902..06cc609c 100644 --- a/pgcommitfest/auth.py +++ b/pgcommitfest/auth.py @@ -211,7 +211,10 @@ def auth_receive(request): # Finally, check of we have a data package that tells us where to # redirect the user. if 'd' in data: - (nonces, datas, tags) = data['d'][0].split('$') + splitdata = data['d'][0].split('$') + if len(splitdata) != 3: + return HttpResponse("Invalid login pass-through data received, likely because of an old link. Please try again.") + (nonces, datas, tags) = splitdata decryptor = AES.new( SHA256.new(settings.SECRET_KEY.encode('ascii')).digest()[:32], AES.MODE_SIV,