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

Allow a timestamp to be passed to TOTP to filter out any possible options before that point #610

Open
ryall opened this issue May 24, 2021 · 0 comments

Comments

@ryall
Copy link

ryall commented May 24, 2021

Is your feature request related to a problem? Please describe.
Currently, if a man-in-the-middle attack were to happen, the attacker could reuse the same token as the end-user, reducing the security benefit of OTP.

Describe the solution you'd like
To mitigate this problem, I'd like to be able to pass a fromTimestamp property when checking TOTP tokens, so that all tokens that are generated using that timestamp or before are counted as invalid. This property can then be saved in the user's database and prevents the same token or older tokens from being used more than once.

Additional context
You can see an example of this in this Google 2FA library for PHP. It's easy to implement by simply discarding any options before or equal to the current timestamp.

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

1 participant