jwt_tool
jwt_tool copied to clipboard
Handling of very large timestamps
The tool does not handle extremely large timestamps (e.g.: 1001662538673) properly and crashes. The dissectPayl function should be patched like this:
def dissectPayl(paylDict, count=False):
timeseen = 0
comparestamps = []
countval = 0
expiredtoken = False
nowtime = int(datetime.now().timestamp())
for claim in paylDict:
countval += 1
if count:
placeholder = str(countval)
else:
placeholder = "+"
if claim in ["exp", "nbf", "iat"]:
if int(paylDict[claim]) > 10000000000:
timestamp = datetime.fromtimestamp(10000000000)
else:
timestamp = datetime.fromtimestamp(int(paylDict[claim]))
Any chance this will get fixed? I run into this on a pretty regular basis