mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-12 01:45:56 -05:00
Users with custom role (old manager) in org cannot import into collections they have access rights to #5838
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 @maluueu on GitHub (Feb 14, 2025).
Vaultwarden Support String
Your environment (Generated via diagnostics page)
Config & Details (Generated via diagnostics page)
Show Config & Details
Config:
Vaultwarden Build Version
v1.33.1
Deployment method
Official Container Image
Custom deployment method
No response
Reverse Proxy
caddy v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=
Host/Server Operating System
Linux
Operating System Version
Ubuntu 24.04.1 LTS (noble)
Clients
Web Vault
Client Version
No response
Steps To Reproduce
Expected Result
All entries from KeePass imported into selected collection.
Actual Result
User is logged out from Web Vault.
After logging back in nothing has been imported.
Logs in browser console:
Logs
Screenshots or Videos
No response
Additional Context
All the users are members of exactly one organization. They have all been assigned the role 'Custom' so they can create collections by themselves.
When importing the KeePass 2 store as an admin user or org owner it is working fine.
@maluueu commented on GitHub (Feb 14, 2025):
Why do we require AdminHeaders here: organizations.rs#L1832?
Has this been forgotten when the Custom role was introduced?
@BlackDex commented on GitHub (Feb 14, 2025):
Managers were never able to import data into organizations as far as i know.
Not sure how you are able to view this in the web-vault, as that isn't visible for me when i login with a user which has manager rights.
@BlackDex commented on GitHub (Feb 14, 2025):
Hmm, looks like they are in the newer web-vault via the Password Vault import option.
@maluueu commented on GitHub (Feb 17, 2025):
@BlackDex I can see that. But while we're at it, why aren't users with a manager/custom role allowed to import passwords into collections they have access to (or create a new one for them)? I mean, they have permissions to do it manually (create the collection + passwords), what's the difference in being able to just import an existing password store in one go?
If we allowed that, what would have to change? I'm afraid I'm not really familiar with Rust, or with this code base in general, but I could give it my best shot.
@stefan0xC commented on GitHub (Feb 20, 2025):
@maluueu this seems to be a recent change by upstream, so the
AdminHeaderscheck has now become too strict.Allowing this via
ManagerHeaderswould be a bit tedious because the collection id is not part of the path param or the query359a4a088a/src/auth.rs (L671-L674)We could use the
ManagerHeadersLooseguard and then check the passed collection id manually if you are allowed to access them. Though this probably is not the right way either when this should be possible for any User that is allowed to manage a collection (8c339ead19) so we would probably have to implement a custom guard for that or change how we check for permissions (i.e. implement custom permissions and like upstream finally get rid of the manager role).@BlackDex commented on GitHub (May 21, 2025):
I'm working on this btw, but Bitwarden also checks if a user has access to the collection or not and if not return's a warning/error.
We can do the same.
@BlackDex commented on GitHub (May 21, 2025):
Ok, i have it fixed in my #5798 PR via
419d98b7a5