mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-12 01:45:56 -05:00
Inconsistent permissions shown on clients for members with multiple groups #5837
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 @MartinK07 on GitHub (Feb 13, 2025).
Originally assigned to: @BlackDex on GitHub.
Vaultwarden Support String
Your environment (Generated via diagnostics page)
Config & Details (Generated via diagnostics page)
Show Config & Details
Config:
Vaultwarden Build Version
v1.33.2
Deployment method
Official Container Image
Custom deployment method
No response
Reverse Proxy
Traefik 2.11.10
Host/Server Operating System
Linux
Operating System Version
Kubernetes
Clients
Web Vault
Client Version
Web-vault: v2025.1.1, Desktop 2025.2.0, Browser 2024.12.4 (Firefox)
Steps To Reproduce
Expected Result
User permissions are consistent regardless which member group was updated/changed most recent.
Actual Result
The most recent updated member group determines the visible permission on the clients.
Logs
Screenshots or Videos
No response
Additional Context
Although the permissions are shown as readonly, clients like the bw cli tool have readwrite access to items in CollectionA.
Also, opening ItemA in edit mode on the browser extension (no fields are modifiable) and clicking save (without making changes), ItemA suddenly appears are readwrite able in the UI of all clients (Webvault, Desktop, browser extension).
Is this a bug in Vaultwarden or on all the Bitwarden clients?
@BlackDex commented on GitHub (May 19, 2025):
This seems to be fixed either via the web-vault or an other PR already.
It might also be fixed via my #5798 PR which is not yet merged, but i tested this using that code-base.
@MartinK07 commented on GitHub (Jun 2, 2025):
I just tested with the version 1.34.1, sadly the problem is still present.
@BlackDex commented on GitHub (Jun 2, 2025):
Have you repeated all the steps? Or did you used the current configured settings?
Because it might be that the stored rights using an older version were incorrect.
Back then i did all your steps and it worked not having your issue.
@MartinK07 commented on GitHub (Jun 2, 2025):
I tested with my current environment that i upgraded from v1.33.2, but i created new groups for testing.
The problem that the edit permissions vanish in the webvault, if I resave the group that has the view only permissions is still present.
edit: I also just tested with a new environment and the problem as described in the issue is still reproducible there too.
@BlackDex commented on GitHub (Jun 2, 2025):
Ok, i tested it again, and i can now reproduce it for some reason.
@stefan0xC commented on GitHub (Jul 9, 2025):
Looking into the proposed fix #6017 the issue from what I can tell is that we wrongly assumed that we will only store one
CollectionGroupfor any given collection in the respectiveHashMape718afb441/src/api/core/ciphers.rs (L1926-L1931)even though you can be member of multiple groups.So the potential issue arises when actually calculating the permissions for each collection
e718afb441/src/api/core/ciphers.rs (L140)because we only check the first result of eachHashMapwhich is fine for directly assigned collections but not for groups3b48e6e903/src/db/models/collection.rs (L102-L107)Also by checking both HashMaps sequentially and separately from each other the directly assigned permissions will always precede a group permission (which might be okay if it is intentional - but if it's not we should probably rewrite the way we calculate it).
@BlackDex To reliably reproduce the issue I would create two collections (e.g.
aandb) and two groups (read a, manage bandmanage a, read beach with the corresponding permissions). If you now add a User to both groups they will have the issue in one of those collections regardless of which group is used for calculating the permissions.@BlackDex commented on GitHub (Jul 10, 2025):
I think that one permission is still the good endresult, since you can only have one permission of course. But we probably need to fix how we determine that permissions final state. You can't have both read-only and manage rights on the exact same collection. That two groups assign you different rights means we need to consolidate those into one.
Ill have to check and validate with upstream in a more detailed way to fix this.
@stefan0xC commented on GitHub (Jul 10, 2025):
@BlackDex Yep. I just wanted to document my findings in case we want to tackle the issue again. And while I agree that the
combined_permissionsis correct for the groups I think that it might be better to do that consolidation in theCollection::to_json_details()function because if we traverse both HashMaps for the given collection we can maybe calculate the calculations in one pass (if we assume that a more permissive entitlement from a group should trump a more restrictive permission that has been directly assigned).@BlackDex commented on GitHub (Jul 10, 2025):
Yes, it's better to have that in one location which is shared indeed.