mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Single Orginization policy erroneously removed all members from org #1813
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 @Spunkie on GitHub (Dec 28, 2023).
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden: DOMAIN, ADMIN_TOKEN
Steps to reproduce
I was trying to turn on the
Account recovery administrationorg policy but it required theSingle Organizationpolicy to be turned on first. When turning on theSingle Organizationpolicy it does warn that:But I didn't expect this to apply to anyone on our vaultwarden instance because our instance only has a single org on it.
Expected behaviour
I would have expected the policy to turn on and that no one would be removed from my org.
Actual behaviour
All non-admin/owners were removed from my org.
@BlackDex commented on GitHub (Dec 28, 2023):
What happened is the expected behavior as described at Bitwarden.
https://bitwarden.com/help/policies/#single-organization
@Spunkie commented on GitHub (Dec 28, 2023):
@BlackDex I've read the passage you linked multiple times and it's still unexpected to me.
None of the ejected memebers were part of multiple orgs. Sorry I'm being dense here, can you point out the exact wording that I'm missing that would make this expected behavior?
There is that passage, but I'm pretty sure this is refering to members that have accepted an invite to an org but not yet been confirmed by an admin.
@BlackDex commented on GitHub (Dec 28, 2023):
Are you sure the users were not part of any other org?
Because the code tells me they should have.
cbdcf8ef9f/src/api/core/organizations.rs (L1741..L1764)It checks if the count of organisations is greater then 1 and if there user isn't an admin or owner or not in an invited state, if then the count is more then 1, those users will be deleted.
So that tells me the users should be in a different organization too.
Double check the admin interface and see too which orgs they are a member.
@Spunkie commented on GitHub (Dec 28, 2023):
@BlackDex Unless they are talking about orgs outside my instance then yes, there is only one org on my instance:

@BlackDex commented on GitHub (Dec 28, 2023):
And the user count there doesn't match the amount of users you are expecting? Those 18 are all admin or owner level users?
@BlackDex commented on GitHub (Dec 28, 2023):
Looks like the query which does the count is wrong.
Thanks for reporting.
@tessus commented on GitHub (Jan 1, 2024):
@BlackDex sorry for asking in this PR, but it is related. Isn't every user in the pseudo org
vaultwardenwhen they are invited to no specific org?I never saw anything in the code that would exclude users that are in this pseudo group.
@BlackDex commented on GitHub (Jan 1, 2024):
That is only a group used for invites, nothing used for anything else.