VulnWatch by ve1ve2
medium 4.3

GHSA-455c-vgg9-jxw8: Failed cipher share leaves a cross-organization collection link that grants access to the cipher

Source:
Vaultwarden releases + advisories (GitHub dani-garcia/vaultwarden)
Published:
Fetched:
Updated:
Affects:
dani-garcia vaultwarden

https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-455c-vgg9-jxw8 ↗

repo-advisoryrustCWE-284securityrepo:dani-garcia/vaultwarden

Failed cipher share leaves a cross-organization collection link that grants access to the cipher ### Summary A Broken Access Control vulnerability in the share_cipher_by_uuid endpoint allows a user who belongs to multiple organizations to bypass strict cross-organization data isolation. By intentionally triggering a validation error during the cipher sharing process, an attacker can create an orphaned database link (CollectionCipher) that binds a cipher owned by Organization A to a collection located in Organization B. This bypasses tenant isolation: the link grants access to the Org A cipher through the Org B collection. ### Details The vulnerability is located in src/api/core/ciphers.rs within the share_cipher_by_uuid function. When a user submits a PUT /api/ciphers//share request to share a cipher to an organization, the backend processes the request in two phases: 1. Link Creation: It iterates through the provided collectionIds, verifies write access, and immediately persists the mappings to the database via CollectionCipher::save(&cipher.uuid, &collection.uuid, conn).await?. 2. Cipher Update: It then calls update_cipher_from_data(...) to update the cipher's metadata and transfer its organization_uuid to the target organization. The issue arises because these two steps are not wrapped in a database transaction. If update_cipher_from_data encounters a validation error—for example, if the cipher already belongs to a different organization, causing the cipher.organization_uuid.is_some() && cipher.organization_uuid != data.organization_id check to fail—the function returns an error (HTTP 400). However, the CollectionCipher records saved in step 1 are not rolled back. This leaves the database in an inconsistent state: a cipher belonging to Org A is permanently linked to a collection in Org B. The item is not listed in the sync of Org B members, but the per-cipher endpoints (for example `GET`/`PUT`/`DELETE /api/ciphers/`) authorized access through collection membership without checking the cipher's organization. Anyone with access to that Org B collection who knew the cipher id could read, modify or delete it, including the attacker after being removed from Org A. The attacker needs write access to the cipher in Org A and to the target collection in Org B. ### PoC ``` const CIPHER_ID = "aa1b4c10-99f9-47e2-8a86-8a1c9a8b7a73"; const ORG_B_ID = "9ca8dbb7-8e66-442a-a977-16523b876c52"; const COL_ID_IN_ORG_B = "c0e886da-1be5-4c6d-9221-0722eb3cea8a"; fetch(`https://localhost/api/ciphers/${CIPHER_ID}/share`, { "headers": { "accept": "application/json", "content-type": "application/json", "authorization": "Bearer ....", "device-type": "10", "is-prerelease": "1", "Cache-Control": "no-store", "Pragma": "no-cache", "Bitwarden-Client-Name": "web", "Bitwarden-Client-Version": "2026.4.1", "Sec-GPC": "1", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-origin", "Priority": "u=4" }, "method": "PUT", "body": Affected packages: rust:vaultwarden Patched: vaultwarden 1.37.0

Linked vulnerabilities (1)

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N

Failed cipher share leaves a cross-organization collection link that grants access to the cipher

CWE: CWE-284