Cleanup accepted codes stored in user data

Created on 23 April 2021, over 3 years ago
Updated 25 November 2023, 12 months ago

Problem/Motivation

TFA stores the value of each accepted Totp and Hotp login for each user in the user data table but there's no cleanup method for outdated data in the module code.

Likewise with trusted browsers, which should no longer be shown in the list of trusted browsers after the timeout for their use has passed.

Steps to reproduce

Install Tfa and GA Login. Enable tfa for user with Totp or Hotp and login. Timestamp is stored for accepted code for user.

Proposed resolution

The RFC doesn't seem to demoand any kind of storage of old codes once they are no longer valid, so they should only be stored to prevent replay attacks while the code is still valid (2 * 30 seconds).

For safety, we could delete all but the last accepted code, and keep only the previous ones that were accepted within the last minute.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024