{"record":{"id":"78d4dcfe135a9ee9","repo":"bitwarden/server","slug":"trying-to-share-ciphers-that-you-do-not-own","errorCode":null,"errorMessage":"Trying to share ciphers that you do not own.","messagePattern":"Trying to share ciphers that you do not own\\.","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"src/Api/Vault/Controllers/CiphersController.cs","lineNumber":1255,"sourceCode":"        var ciphers = await _cipherRepository.GetManyByUserIdAsync(userId, withOrganizations: false);\n        var ciphersDict = ciphers.ToDictionary(c => c.Id);\n\n        // Validate the model was encrypted for the posting user\n        foreach (var cipher in model.Ciphers)\n        {\n            if (cipher.EncryptedFor.HasValue && cipher.EncryptedFor.Value != userId)\n            {\n                _logger.LogError(\"Cipher was not encrypted for the current user. CipherId: {CipherId}, CurrentUser: {CurrentUserId}, EncryptedFor: {EncryptedFor}\", cipher.Id, userId, cipher.EncryptedFor);\n                throw new BadRequestException(\"Cipher was not encrypted for the current user. Please try again.\");\n            }\n        }\n\n        var shareCiphers = new List<(CipherDetails, DateTime?)>();\n        foreach (var cipher in model.Ciphers)\n        {\n            if (!ciphersDict.TryGetValue(cipher.Id.Value, out var existingCipher))\n            {\n                throw new BadRequestException(\"Trying to share ciphers that you do not own.\");\n            }\n\n            ValidateClientVersionForFido2CredentialSupport(existingCipher);\n\n            shareCiphers.Add((cipher.ToCipherDetails(existingCipher), cipher.LastKnownRevisionDate));\n        }\n\n        var updated = await _cipherService.ShareManyAsync(\n            shareCiphers,\n            organizationId,\n            model.CollectionIds.Select(Guid.Parse),\n            userId\n        );\n\n        var response = updated.Select(c => new CipherMiniResponseModel(c, _globalSettings, c.OrganizationUseTotp));\n        return new ListResponseModel<CipherMiniResponseModel>(response);\n    }\n","sourceCodeStart":1237,"sourceCodeEnd":1273,"githubUrl":"https://github.com/bitwarden/server/blob/e93b962371d80964556f5590c6615f5160a437a1/src/Api/Vault/Controllers/CiphersController.cs#L1237-L1273","documentation":"Error \"Trying to share ciphers that you do not own.\" thrown in bitwarden/server.","triggerScenarios":"Thrown when a user attempts to share ciphers to an organization that belong to another user or that the user does not own.","commonSituations":"See trigger scenarios.","solutions":["Only share ciphers from your personal vault or from collections where you have manage permission.","Remove the ciphers you do not own from the share request and retry.","Ask the owner of those items to share them instead."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e93b962371d80964556f5590c6615f5160a437a1","analyzedAt":"2026-08-13T14:22:19.382Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}