File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,8 @@ def load(jwt):
340340 header = json .loads (header_data .decode ('utf-8' ))
341341 except ValueError as e :
342342 raise DecodeError ('Invalid header string: %s' % e )
343+ if not isinstance (header , Mapping ):
344+ raise DecodeError ('Invalid header string: must be a json object' )
343345
344346 try :
345347 payload_data = base64url_decode (payload_segment )
@@ -349,6 +351,8 @@ def load(jwt):
349351 payload = json .loads (payload_data .decode ('utf-8' ))
350352 except ValueError as e :
351353 raise DecodeError ('Invalid payload string: %s' % e )
354+ if not isinstance (payload , Mapping ):
355+ raise DecodeError ('Invalid payload string: must be a json object' )
352356
353357 try :
354358 signature = base64url_decode (crypto_segment )
You can’t perform that action at this time.
0 commit comments