POST /api/v2/impersonate accepts any user ID. An admin of one organization received a session for a member of a different organization.
Request
POST /api/v2/impersonate
Host: staging.acme.dev
Authorization: Bearer ‹admin, org 1›
{"userId":"usr_org2_member"}Response
HTTP/1.1 200 OK
{"session":"…","org":"org_2"}How to fix
Check that the target user belongs to the caller's organization before issuing the session, and log every impersonation.