mirror of
https://github.com/zitadel/zitadel.git
synced 2026-11-03 12:47:09 -06:00
Token exchange impersonation only checked the `impersonation`
permission, so an IAM_END_USER_IMPERSONATOR could impersonate any user,
including an IAM_OWNER.
Impersonating a user who holds any membership (instance, org, project
or project grant) now requires the `admin.impersonation` permission,
which only the *_ADMIN_IMPERSONATOR roles grant. The membership
projections are triggered before the check, which fails closed if the
trigger fails; triggerBatch now returns its context and error for this.
The permission check is scoped to the impersonated user again.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Livio Spring <9405495+livio-a@users.noreply.github.com>
(cherry picked from commit 9c047cc36d)