From 4638c12780636a66b118e699f5b70ce193555106 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Thu, 2 May 2024 09:42:34 +0200 Subject: [PATCH] jwt.decode: Set algorithms to all when None See https://github.com/mpdavis/python-jose/issues/346 --- jose/jwt.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jose/jwt.py b/jose/jwt.py index b364b4ba..07b83012 100644 --- a/jose/jwt.py +++ b/jose/jwt.py @@ -141,6 +141,9 @@ def decode(token, key, algorithms=None, options=None, audience=None, issuer=None verify_signature = defaults.get("verify_signature", True) + if algorithms is None: + algorithms = ALGORITHMS.ALL + try: payload = jws.verify(token, key, algorithms, verify=verify_signature) except JWSError as e: