Summary
Vaultwarden allowed an invited but unconfirmed organization owner to call the /api/ciphers/purge endpoint and hard-delete all vault ciphers and attachments for that organization.
Because the endpoint only verified that the user had the Owner role and did not verify that their membership status was Confirmed, an attacker with an accepted but unconfirmed owner invite could cause immediate organization-wide data loss.
Affected context
This vulnerability occurs in Vaultwarden's organization management and purge functionality, specifically for deployments that:
- Use organizations with multiple owners
- Rely on the two-step invite workflow (Invited → Accepted → Confirmed)
- Expose the
/api/ciphers/purgeAPI endpoint to authenticated clients
The issue manifests when the backend enforces only the Owner role requirement on the purge endpoint, without tying that check to the membership's confirmation status. In such setups, any owner-level invitee who has accepted the invitation but not yet been confirmed can still reach a destructive operation intended only for fully confirmed owners.
Exploit preconditions
- Attack surface: Authenticated application API (
POST /api/ciphers/purge). - Required access:
- A valid Vaultwarden account.
- An invitation to an organization with the Owner role.
- The invitation has been accepted (membership state: Accepted) but not yet confirmed by an existing owner (state: not Confirmed).
- Trigger point: Sending an authenticated
POSTrequest to/api/ciphers/purgeusing standard headers, as a user whose membership type is Owner but whose status is not Confirmed. - Why exploitation is possible:
- The purge endpoint authorizes based solely on the membership type (Owner) and does not validate the membership status (Confirmed).
- The system assumes that all Owner-type members are fully authorized, even though the invite flow defines an additional confirmation step that should gate access to destructive operations.
Why this happens
The root cause is a missing authorization check on the membership status associated with an organization owner, aligning with CWE-863: Incorrect Authorization.
While Vaultwarden models organization membership with both a role (e.g., Owner) and a status (Invited, Accepted, Confirmed), the /api/ciphers/purge handler only enforces the role constraint. This creates a gap between the designed workflow (where destructive actions should be reserved for confirmed owners) and the implemented authorization logic (which implicitly treats all owners as fully trusted once they accept an invite).
Conceptually, this is an insecure pattern where:
- Authorization decisions rely on a coarse-grained attribute (role) and ignore a critical state flag (confirmation).
- A multi-step trust elevation process exists in the model but is not enforced consistently in privileged API endpoints.
This separation between intended trust model and actual access control checks is characteristic of higher-level authorization flaws, not simple missing authentication.
Potential impact
- Hard deletion of all organization ciphers, causing loss of stored secrets and credentials.
- Deletion of all organization attachments, leading to loss of associated files and documents.
- Immediate disruption of all users relying on the affected organization's vault for operational access.
- Potential long-term business or operational impact due to unrecoverable loss of critical secrets if backups are absent or outdated.
- Erosion of trust in shared organizations where invitation flows are assumed to provide safe onboarding.
General mitigation guidance
Mitigation focuses on aligning access control checks with the full membership state and minimizing the blast radius of destructive operations:
- Enforce multi-attribute authorization: Ensure that privileged endpoints (like purge) verify both role (Owner) and status (Confirmed), or an equivalent "fully activated" state, before proceeding.
- Centralize authorization logic: Route all role- and state-based decisions through a shared authorization layer or policy engine, so that new endpoints cannot bypass required status checks.
- Require multi-step or multi-party confirmation for destructive actions: For operations that can wipe entire organizations, consider requiring explicit confirmation from an already-confirmed owner or multiple independent approvals.
- Harden destructive operations with in-band safeguards: Introduce confirmation prompts, secondary factors (e.g., re-authentication, time delays), or "soft delete" with a recoverable grace period where feasible.
- Apply least privilege to invited users: Treat invited or unconfirmed accounts as having limited capabilities regardless of their intended final role, and only elevate privileges after a clear confirmation step.
- Review role semantics and API contracts: Explicitly document which membership attributes are required for each privileged operation and use those definitions consistently across all endpoints.
How teams detect issues like this
Effective detection involves examining both the codebase and runtime behavior for inconsistencies between the intended authorization model and actual checks:
- Static analysis and policy checks:
- Search for endpoints that perform sensitive operations (e.g., purge, delete, reset) and verify that they check all relevant membership attributes (role and status).
- Define patterns or rules that flag authorization logic which inspects only the role field when the data model also exposes a status or confirmation attribute.
- Use policy-as-code tools or linters to enforce that high-impact endpoints call a central authorization helper rather than embedding ad hoc checks.
- Code review signals:
- Pay particular attention to APIs that manipulate entire collections (e.g., "purge all ciphers"), ensuring the enforcement matches the business workflow (invite, accept, confirm).
- Look for any shortcuts like "if user.is_owner { allow }" without cross-checking the user's lifecycle state.
- Verify that test suites include scenarios for partially-onboarded users (invited, accepted but not confirmed) across privileged operations.
- Runtime monitoring and logging:
- Log calls to destructive endpoints with membership role, status, and actor identity, and alert on anomalous patterns, such as unconfirmed users invoking high-impact operations.
- Periodically analyze audit logs to ensure that only fully confirmed owners are performing organization-wide destructive actions.
- Automated tooling:
- Integrate automated security testing in CI that exercises critical endpoints with users in different membership states, verifying that unconfirmed or invited accounts are denied.

