mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
MFA Enforcement on an Organization not working anymore? #1908
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rbability on GitHub (May 2, 2024).
I am on 1.30.5, but I can not say when the issue started, because we invite new users to those Organizations not very often.
Subject of the issue
After inviting a new user to an organization which has the "Enforce MFA" function enabled, I realized that this user has access, but was not enforced to enable MFA on his account. I am pretty sure that in the past, when I invited users to such an Organization, they were enforced to enable MFA first for their account before they were able to join.
Deployment environment
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden: ADMIN_TOKEN
None
Steps to reproduce
Expected behaviour
I expected that the User, when trying to accept the invitation to the Organization, gets a prompt that he has to enable MFA on his account first. I am pretty sure this was the behavior previously, but unfortunately I can not say since which version it changed.
Actual behaviour
The user can just accept an invitation to a MFA protected Organization without having MFA enabled.
@rbability commented on GitHub (May 2, 2024):
To add to this. When removing the Checkmark for MFA enforcement on an organization, all Users without MFA enabled get removed from this organization. So this is still working as intended.
@stefan0xC commented on GitHub (May 2, 2024):
What role is the user invited as? (Admins and Owners are exempt from MFA.)

This sounds backwards. If you remove the checkmark you turn off the policy meaning the enforcement of that policy should not be enabled and thus also not affect users.
0fe93edea6/src/db/models/org_policy.rs (L286-L289)@rbability commented on GitHub (May 2, 2024):
Thank you @stefan0xC! I was indeed inviting the User as Admin. The first one ever... normally everyone has less permissions. This is why he was exempt from MFA! From now on I will invite the new Admins as regular Users first to make sure they are enabling MFA and then update their membership to Admin afterwards.
The addition I made to my post was not proof-read by me, sorry. We had the case that another person ADDED the checkmark to an Organization where it was not enforced and almost everyone lost access to that organization. So THIS is working as expected. I am sorry for the confusion.
In hindsight I should have created a new org first and test again before opening this issue. I would then have seen the dialogue you posted above (which I have not seen since a very long time, since we do not create new Organizations regularly). I'm sorry for the inconvenience. Everything is working as it should.
Thank you very much for your time!