-
Notifications
You must be signed in to change notification settings - Fork 9
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
Two factor is not disabled/removed during user deletion #89
Comments
Yes, this seems more likely to be a nuisance issue for the user. If they got their account "reset" (deleted, recreated) by the admin for some reason, and during that process they deleted their client/saved knowledge of the OTP secret, then they will find that they are blocked from logging in - even though their newly-created account has just skeleton files. Similarly if there was someone "Phil Davis" with user name |
As far as I see, we have a new generic event |
@karakayasemi use user.afterdelete. I think it's ok to depend on 10.0.5 or 10.0.10 in min-version. everything else is too old anyway |
Tested with tarball 0.5.3.Rc2: #95 (comment) and keeps failing for me: Steps to reproduce 1 - enable totp 0.5.2 The user can log in. Note If you install 0.5.3 version (the one with the fix) and then you enable TOTP for the user etc it works fine. The bug persist only for the users that enabled it previosly |
@karakayasemi please investigate |
I could not reproduce the problem. I followed the below steps: |
@karakayasemi Sorry wrong steps detailed above. In the scenario detailed in the OP: 1 - Delete that user, The user that 'has been hacked' keeps been possible to log in. The PR fixes if the user deletion happens after the totp update (cleaning the users secrets). Is there a way to also get the users that were 'hacked' before? (deletion before twofactor_totp upgrade). Maybe it is not possible or it is out of the scope of the fix. |
@davitol When you delete user (step 1), this PR deletes all user related entries in totp table. When you create an user with same username, two factor totp will not be activated for the new user. So, step 3 should be not possible. Actually, this PR's purpose is prevent possible locked down situation of new user from old user's second factor and clean up old redundant data. |
Yes, those steps are from the OP and twofactor_totp 0.5.2. (Already released). The scenario i comment is about fixing that users that were already deleted+created before the twofactor_totp upgrade. Due to the PR works fine for the detailed problem and prevents to happen again in the future, i think it is fine for me. Let's close it. |
Sorry, I understand your point now. I guess, it is not in the this PR's scope. To delete old deleted user's secrets, we should iterate all totp entries and check user exist or not. IMHO, we may add an |
@karakayasemi can you raise a ticket for this ? |
Raised in here: #110 |
When a user having activated TOTP is deleted, two-factor for that user is not disabled and secrets are not cleaned up.
So, if I:
Then, it can successfully be logged in.
Expected Output
The user is logged in without asking for two factor
P.S. This might not be a security issue, as the files are deleted during user cleanup.
@karakayasemi
The text was updated successfully, but these errors were encountered: