Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of very large timestamps #83

Open
richardkirner-seon opened this issue Sep 15, 2022 · 1 comment
Open

Handling of very large timestamps #83

richardkirner-seon opened this issue Sep 15, 2022 · 1 comment

Comments

@richardkirner-seon
Copy link

richardkirner-seon commented Sep 15, 2022

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]))
@liquidsec
Copy link

Any chance this will get fixed? I run into this on a pretty regular basis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants