mirror of
https://github.com/bitwarden/server
synced 2026-02-18 10:23:27 +00:00
[PM-31356] Event logs: Ensure User has access to Service Account Organization #6997
Fix a vulnerability in the service account events API that allowed any Premium/Enterprise User to retrieve events for any service account. This change ensures that the requesting User has access to the Organization the service account belongs to, by checking for it in the list of Orgs in request context. This matches the pattern from other endpoints in EventsController
This commit is contained in:
@@ -212,7 +212,7 @@ public class EventsController : Controller
|
||||
}
|
||||
|
||||
var serviceAccount = await GetServiceAccount(id, orgId);
|
||||
var org = _currentContext.GetOrganization(orgId);
|
||||
var org = _currentContext.GetOrganization(serviceAccount.OrganizationId);
|
||||
|
||||
if (org == null || !await _currentContext.AccessEventLogs(org.Id))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user