GHSA-937x-3j8m-7w7p / CVE-2026-43913: Unconfirmed Owner Can Purge Entire Organization Vault
- Published:
- Fetched:
- Updated:
- Affects:
- dani-garcia vaultwarden
https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-937x-3j8m-7w7p ↗
Unconfirmed Owner Can Purge Entire Organization Vault ## Summary An invited organization owner can purge the entire organization vault after reaching `Accepted` state, before any existing owner confirms them. This is a server-side authorization bypass in the org-invite confirmation flow: 1. accepting an invite moves the membership from `Invited` to `Accepted` 2. confirmation is a separate step that later upgrades `Accepted` to `Confirmed` 3. most privileged org routes correctly require `Confirmed` 4. `POST /api/ciphers/purge?organizationId=` does not; it only checks `member.atype == Owner` As a result, a not-yet-confirmed owner can hard-delete every cipher and attachment in the organization. ## Impact This is a destructive authorization bypass on organization-wide ownership privileges. A user who is intentionally still pending confirmation can: - purge the entire organization vault - hard-delete all organization ciphers - delete all attachments linked to those ciphers - cause immediate organization-wide data loss before the invite is confirmed This breaks the security boundary that the `Accepted -> Confirmed` step is supposed to enforce. ## Exploit Scenario Assume: - attacker controls an email address invited as an `Owner` into `Org A` - attacker is not yet confirmed by an existing owner - attacker has a normal authenticated session on their own account Steps: 1. Attacker accepts the org invite. Result: membership becomes `Accepted`, not `Confirmed`. 2. Before any owner confirms them, attacker calls: ```http POST /api/ciphers/purge?organizationId= Authorization: Bearer Content-Type: application/json { "masterPasswordHash": "", "otp": null } ``` Expected behavior: - request should be rejected because org-wide destructive owner actions should require a `Confirmed` owner Actual behavior: - server looks up the membership - server only checks `member.atype == Owner` - server deletes every cipher in the organization - each cipher delete also removes attachments, collection links, favorites, and related records ## Root Cause Invite acceptance is intentionally separate from confirmation: - `accept_org_invite()` transitions `Invited -> Accepted` - `_confirm_invite()` transitions `Accepted -> Confirmed` Privileged org guards reflect this design: - `OwnerHeaders` only accepts `is_confirmed_and_owner()` But the org purge endpoint bypasses those guards entirely: - it uses plain `Headers` - it loads the membership with `Membership::find_by_user_and_org()` - it authorizes solely on `member.atype == MembershipType::Owner` - it never checks `member.status == Confirmed` That means a pending owner receives full destructive owner power earlier than intended. ## Code References - Invite acceptance sets `Accepted`: - `src/api/core/mod.rs:263-279` - New-account setup also auto-runs invite acceptance: - `src/api/core/accounts.rs:375-3 Affected packages: rust:vaultwarden Patched: vaultwarden 1.35.5