GHSA-69q9-v8p6-xvx3: Revoked or unconfirmed organization member retains read and delete access to organization ciphers
- Published:
- Fetched:
- Updated:
- Affects:
- dani-garcia vaultwarden
https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-69q9-v8p6-xvx3 ↗
Revoked or unconfirmed organization member retains read and delete access to organization ciphers ## Summary Revoking an organization member suspends them in the UI and hides organization items from their sync, but does not remove the collection and group grants that the per-item authorization checks rely on. A revoked member who keeps their own account can continue to read organization ciphers one at a time, and can soft-delete and permanently delete them, indefinitely. The item-level checks never consult membership status, while the listing queries do. ## Severity / CVSS CVSS 3.1 vector: `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N` Base score: 8.1 Severity: High `PR:L` because the attacker authenticates with their own surviving account, which revocation does not disable. `C:H` for continued read access to organization secrets, including secrets rotated in place after the revocation. `I:H` for permanent destruction of organization items; editing item contents is blocked by a separate check, so this metric covers deletion only. `A:N` because the service itself is unaffected. ## Affected component - `src/db/models/cipher.rs`, `Cipher::get_access_restrictions`, `get_user_collections_access_flags`, `get_group_collections_access_flags` - `src/db/models/group.rs`, `Group::is_in_full_access_group` - `src/api/core/organizations.rs`, `revoke_member_impl` - `src/api/core/ciphers.rs`, `get_cipher`, `delete_cipher_by_uuid`, `restore_cipher_by_uuid`, `delete_cipher_attachment_by_id` Tested at commit `46ae59eaf444f0ae0a799070cf2bd6c415284a51`, default configuration, sqlite, mail disabled. ## Root cause Revocation adjusts the status field and saves the row: ```rust // organizations.rs:2338, revoke_member_impl member.revoke(); // status -= 128 member.save(conn).await?; ``` `Membership::save` (`organization.rs:752`) writes the membership row and nothing else. The removal path, `Membership::delete` (`organization.rs:785`), does tear down the derived grants: ```rust CollectionUser::delete_all_by_user_and_org(&self.user_uuid, &self.org_uuid, conn).await?; GroupUser::delete_all_by_member(&self.uuid, conn).await?; ``` Revocation performs neither, so the `users_collections` and `groups_users` rows survive. The listing queries compensate by filtering on membership status. `Cipher::find_by_user` joins `users_organizations` under `status = Confirmed` and then constrains the collection join to that membership: ```rust // cipher.rs:814-825 .left_join( users_organizations::table.on(ciphers::organization_uuid .eq(users_organizations::org_uuid.nullable()) .and(users_organizations::user_uuid.eq(user_uuid)) .and(users_organizations::status.eq(MembershipStatus::Confirmed as i32))), ) .left_join( users_collections::table.on(ciphers_collections::collection_uuid .eq(users_collections::collection_uuid) // Ensure that users_collections::user_uuid is NULL for unconfirmed users. .and(users_organizations::user_uuid.eq(users_collect Affected packages: rust:vaultwarden Patched: vaultwarden 1.37.4