Skip to content
New issue

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

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

Already on GitHub? # to your account

Prevent the reuse of TOTP authentication codes #1720

Merged
merged 1 commit into from
Jun 17, 2021
Merged

Conversation

quantum5
Copy link
Member

@quantum5 quantum5 commented Jun 6, 2021

We store the timecodes in an IntegerField, which is guaranteed to support values up to 2147483647. This is okay because timecodes are Unix time divided by 30, so it supports values up to the year 4011.

This fixes #1692.

Ideally, we'd add a unit test that attempts to verify the same code twice, then mock change the time and see that it does indeed validate with the new code.

We store the timecodes in an IntegerField, which is guaranteed to support
values up to 2147483647. This is okay because timecodes are Unix time
divided by 30, so it supports values up to the year 4011.

This fixes #1692.
Copy link
Member

@kiritofeng kiritofeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@quantum5 quantum5 merged commit c189db3 into master Jun 17, 2021
@quantum5 quantum5 deleted the totp-no-repeat branch June 17, 2021 00:46
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent the reuse of TOTP tokens
2 participants