ZITADEL Org Admin to Instance Admin (GHSA-qx3g-qf45-rmvq)
ZITADEL 4.2.0 to 4.20.7 lets an organization owner grant themselves IAM_OWNER when creating a project, reaching instance admin. Fixed in 4.20.8.
TL;DR
- ZITADEL project creation accepted any role for the initial project administrators, so an organization owner could make themselves IAM_OWNER or SYSTEM_OWNER. ZITADEL published the advisory on 2026-12-01.
- The project-role flaw affects 4.2.0 through 4.20.7. A second Critical flaw affects 4.15.2 through 4.20.7, and four High issues affect 4.0.0 through 4.20.7.
- GitHub rates the two Criticals CVSS v3.1 9.9 and 9.6. No CVE is assigned, no public proof of concept is linked, and none appears in CISA KEV as of 2026-12-01.
- Upgrade to 4.20.8 or 4.21.0, then review project memberships for non-PROJECT_ roles and user IDs created in more than one organization. See "How do I fix it?" for the checks and workarounds.
Am I affected?
ZITADEL 4.x deployments expose the two Critical flaws when the Management API or User API is reachable and public organization registration is enabled, which is the default. The project-role escalation needs all of these conditions:
- ZITADEL 4.2.0 through 4.20.7 is running.
- The Management API V1 is reachable. This is the default configuration.
- The attacker is an organization owner or holds ORG_PROJECT_CREATOR in some organization. Public organization registration is enabled by default, so an outsider can create that organization.
- The deployment has not been upgraded to 4.20.8 or later.
The duplicate-ID escalation needs all of these conditions:
- ZITADEL 4.15.2 through 4.20.7 is running.
- The Management API or User API v2 is reachable.
- The attacker can manage users in one organization. An organization owner can do this, and public organization registration is enabled by default.
- The attacker knows the user ID of a user in another organization. User IDs are not secrets and appear in API responses, invitations, audit data and application logs.
The four High issues add their own conditions:
- The host-header account takeover needs the hosted Login V2 with an external identity provider, and a proxy that passes
x-zitadel-public-host,x-zitadel-forward-hostorx-forwarded-hostunchanged. - The SAML attribute disclosure needs at least one SAML application.
- The password-reset code takeover needs an application whose access token carries the ZITADEL API audience.
- The cross-organization grant change needs
user.grant.writein any organization. Its creation path also needsIMPROVED_PERFORMANCE_USER_GRANT.
| Advisory | Issue | Severity | Affected versions | Fixed version |
|---|---|---|---|---|
| GHSA-qx3g-qf45-rmvq | Project creation accepts instance roles | CVSS v3.1 9.9 Critical | 4.2.0 to 4.20.7 | 4.20.8 |
| GHSA-68mv-8rxc-2rrr | Service user ID duplicated across organizations | CVSS v3.1 9.6 Critical | 4.15.2 to 4.20.7 | 4.20.8 |
| GHSA-8cr2-7rvm-hxq5 | Host header in the external IdP flow | CVSS v3.1 8.1 High | 4.0.0 to 4.20.7 | 4.20.8 |
| GHSA-g8gm-547r-665m | Unauthenticated SAML AttributeQuery | CVSS v3.1 7.5 High | 4.0.0 to 4.20.7 | 4.20.8 |
| GHSA-6hq4-74jm-4hj4 | Password-reset code returned without user.write |
CVSS v3.1 7.3 High | 4.0.0 to 4.20.7 | 4.20.8 |
| GHSA-j24h-w6rf-r4c6 | Cross-organization user grant update | CVSS v3.1 7.1 High | 4.0.0 to 4.20.7 | 4.20.8 |
The two Critical advisories carry the highest scores, and each one turns a limited organization role into an instance-wide capability.
The supported branches line up as follows. Four advisories reach back to 4.0.0. The project-role escalation starts at 4.2.0, and the duplicate-ID escalation starts at 4.15.2.
| Branch | Affected versions | Fixed version |
|---|---|---|
| 4.0.x and 4.1.x | 4.0.0 through 4.1.x (four advisories: host header, SAML, password reset, user grants) | 4.20.8 or 4.21.0 |
| 4.2.x through 4.14.x | 4.2.0 through 4.14.x (five advisories; the duplicate-ID flaw starts at 4.15.2) | 4.20.8 or 4.21.0 |
| 4.15.x through 4.20.x | 4.15.0 through 4.20.7 (five advisories in 4.15.0 and 4.15.1; all six from 4.15.2) | 4.20.8 or 4.21.0 |
| 4.21.x | None | Not affected |
Check the version of a container. The official image runs the binary at /app/zitadel:
docker exec <container> /app/zitadel --version
Check a binary installation:
/path/to/zitadel --version
Check the image tag in Kubernetes:
kubectl get deployment <deployment> -o jsonpath='{.spec.template.spec.containers[0].image}'
How do I fix it?
Upgrade to 4.20.8 or 4.21.0. Both releases contain the six fixes, and 4.21.0 was cut from 4.20.8.
- Back up the database and record the current version.
- For Docker, pull the fixed image and recreate the container. A pulled image alone does not replace the running container:
docker pull ghcr.io/zitadel/zitadel:v4.20.8
docker stop <container>
docker rm <container>
docker run -d --name <container> --env-file <env-file> -p 8080:8080 ghcr.io/zitadel/zitadel:v4.20.8
- For Kubernetes, set the image tag to
v4.20.8orv4.21.0and roll out the deployment:
kubectl set image deployment/<deployment> zitadel=ghcr.io/zitadel/zitadel:v4.20.8
kubectl rollout status deployment/<deployment>
- For a binary installation, download the 4.20.8 release asset for your platform. Replace the binary and restart the service.
- Confirm the new version with the command in "Am I affected?".
- Run the checks in "How do I check if I was compromised?" after the upgrade. The patch stops new duplicates and ignores stored non-project roles, but it does not remove credentials or memberships created before the upgrade.
If you cannot upgrade, use these mitigations:
- Disable public organization registration with
DisallowPublicOrgRegistration. This removes the anonymous route to an organization-owner account, but it does not protect against administrators who already hold user-management rights. - Limit the
ORG_PROJECT_CREATORand organization-owner roles to trusted users. - Strip
x-zitadel-public-host,x-zitadel-forward-hostandx-forwarded-hostat the reverse proxy on every request, and keep the login unreachable around that proxy. This covers only the host-header account takeover. - Block requests to
/saml/v2/attributeat the reverse proxy or load balancer. This covers only the SAML attribute disclosure.
No configuration fully closes the two Critical flaws. Upgrade.
What is the root cause?
Project creation wrote the caller-supplied roles of the initial administrators into the project membership without checking that they were project roles. The permission resolver then treated a project membership carrying IAM_OWNER as an instance-wide grant. The duplicate-ID flaw is a second missing check: service-user creation tested the chosen ID only inside the caller's organization.
The project creation path lives in internal/command/project.go. It validates the project, then appends a project-member event for each requested administrator. At v4.20.7 the loop copied admin.Roles into the event and fell back to PROJECT_OWNER only when the list was empty:
// internal/command/project.go, v4.20.7
func (c *Commands) addProjectMemberEvents(ctx context.Context, resourceOwner, projectID string, admins []*AddProjectAdmin) ([]eventstore.Command, error) {
if len(admins) == 0 {
return nil, nil
}
events := make([]eventstore.Command, 0)
for _, admin := range admins {
_, err := c.checkUserExists(ctx, admin.ID, "")
if err != nil {
return nil, err
}
roles := admin.Roles
if len(roles) == 0 {
roles = append(roles, domain.RoleProjectOwner)
}
projectMemberWriteModel := NewProjectMemberWriteModel(projectID, admin.ID, resourceOwner)
events = append(events, project.NewProjectMemberAddedEvent(ctx,
ProjectAggregateFromWriteModelWithCTX(ctx, &projectMemberWriteModel.WriteModel),
admin.ID,
roles...,
))
}
return events, nil
}
AddProjectMember, the ordinary project-member endpoint, rejects roles that are not project roles. The creation path skipped that check, so IAM_OWNER and SYSTEM_OWNER were stored as project roles.
The permission resolver in internal/api/authz/permissions.go did not filter those stored roles. It mapped every role name on every membership to permissions, and it added the membership's object ID to each permission when the membership was a project or project-grant membership:
// internal/api/authz/permissions.go, v4.20.7
func mapMembershipToPerm(requiredPerm string, membership *Membership, roleMappings []RoleMapping, requestPermissions, allPermissions []string) ([]string, []string) {
roleNames, roleContextID := roleWithContext(membership)
for _, roleName := range roleNames {
perms := getPermissionsFromRole(roleMappings, roleName)
for _, p := range perms {
permWithCtx := addRoleContextIDToPerm(p, roleContextID)
if !ExistsPerm(allPermissions, permWithCtx) {
allPermissions = append(allPermissions, permWithCtx)
}
p, _ = SplitPermission(p)
if p == requiredPerm {
if !ExistsPerm(requestPermissions, permWithCtx) {
requestPermissions = append(requestPermissions, permWithCtx)
}
}
}
}
return requestPermissions, allPermissions
}
The project membership therefore produced iam.* permissions. The Admin API checks those permissions, so it accepted the caller as an instance administrator. Versions before 4.15.2 are different: a duplicated record stayed in the target user's organization, and nothing could be issued for it from another organization.
The duplicate-ID flaw is in internal/command/user_machine.go. Service-user creation built a write model scoped to the caller's resource owner, so the lookup could not see a user with the same ID in another organization:
// internal/command/user_machine.go, v4.20.7
writeModel, err := getMachineWriteModel(ctx, a.ID, a.ResourceOwner, filter, machine.PermissionCheck)
if err != nil {
return nil, err
}
if isUserStateExists(writeModel.UserState) {
return nil, zerrors.ThrowPreconditionFailed(nil, "COMMAND-k2una", "Errors.User.AlreadyExisting")
}
getMachineWriteModel passes resourceOwner into NewMachineWriteModel, so its event query carries the organization filter. A caller in organization A could create a machine user with the ID of a human or machine user in organization B. The event was written under A's aggregate, while the user ID already existed under B.
How is it exploited?
The project-role escalation turns an organization-level role into instance administration in one API call. The duplicate-ID escalation turns a known user ID into that user's credentials.
- Create an organization through public registration, or use an organization where you already hold
ORG_PROJECT_CREATOR. - Send
POST /management/v1/projectswithadmins[].rolesset toIAM_OWNER. The endpoint accepts the request because the role list is not validated. - The response creates a project membership for your user with
IAM_OWNER, stored as a project role. - Call an Admin API endpoint with the same token. The permission resolver maps
IAM_OWNERfrom the project membership toiam.*, and the Admin API accepts the call. - Repeat the project creation with
SYSTEM_OWNERto reach the System API, which includes deleting the instance.
The second chain needs a target user ID:
- Read a target user ID from an API response, an invitation, audit data or an application log.
- Send
POST /management/v1/users/machinewithuserIdset to the target ID and your organization in the request context. The duplicate check looks only in your organization, so the call succeeds. - Issue a personal access token for that user ID from your organization.
- Use the token. It authenticates as the existing user, with that user's roles, including
IAM_OWNERif the target is an instance administrator. - Optionally add an identity provider link to the user ID and sign in as the target through the hosted login. The advisory also notes that this can lock the target out of password sign-in.
The host-header account takeover needs user interaction:
- Prepare a login link that reaches the real ZITADEL login with
x-zitadel-public-hostset to a host you control. - Send the link to the victim. The victim signs in at the real external identity provider.
- The provider returns the browser to your host with the intent ID, intent token and victim user ID.
- Complete the login in your browser and obtain a session as the victim.
How does the attack flow?
The first Critical flaw turns one authenticated project-creation request into an instance-wide grant, because the role is stored unchecked and then resolved as an instance role.
or holds ORG_PROJECT_CREATOR"] --> B["POST /management/v1/projects
admins roles = IAM_OWNER"] B --> C["no project-role check
membership stores IAM_OWNER"] C --> D["permission resolver maps
IAM_OWNER to iam.*"] D --> E["Admin API accepts
instance-wide access"] E --> F["SYSTEM_OWNER reaches
System API and instance deletion"]
What can an attacker do?
The project-role flaw gives an organization owner full instance administration. The attacker can read and change instance policies and configuration through the Admin API, enumerate and act across every organization, and export cross-organization data. With SYSTEM_OWNER the attacker reaches the System API, up to deleting the instance.
The conditions are an organization owner or ORG_PROJECT_CREATOR role, a reachable Management API, and a version from 4.2.0 through 4.20.7. Public organization registration, which is enabled by default, lets an outsider obtain that organization role.
The duplicate-ID flaw lets an attacker issue a personal access token, key or client secret that authenticates as the targeted user. The token carries the target's roles across the instance, including IAM_OWNER.
The attacker can also add an identity provider link and sign in as the target. The advisory notes that the attacker can lock the target out of password sign-in.
The conditions are user-management rights in one organization and knowledge of a user ID in another organization. The deployment must also expose the Management API or User API v2 and run a version from 4.15.2 through 4.20.7.
The host-header flaw lets an attacker who gets a victim to sign in through a prepared link receive the identity provider result and finish the login as the victim. It needs the hosted Login V2, an external identity provider, a client-controlled host header that reaches the login, and user interaction.
The four High issues each need their own condition:
- The SAML AttributeQuery flaw lets an unauthenticated attacker read any user's profile and confirm that a login name exists when the instance has at least one SAML application. Some SAML applications that accept identity-provider-initiated sign-ins may wrongly accept the signed statement as a sign-in.
- The password-reset flaw lets an application operator who receives a victim token with the ZITADEL API audience read the victim's reset code. The operator can then set a new password, including on accounts that had no local password. The token must carry that audience.
- The cross-organization grant flaw lets a user with
user.grant.writein one organization change the roles on another organization's grants. The same user can remove all their roles. The Management API must be reachable. WithIMPROVED_PERFORMANCE_USER_GRANTenabled, the flaw also allows creating grants on another organization's project. - The host-header flaw is described in the numbered steps in "How is it exploited?".
None of the six advisories reports exploitation in the wild. No public proof of concept is linked, and no CVE ID is assigned, so none can appear in CISA KEV.
Why does the fix work?
The patch adds the missing role check at project creation, filters legacy non-project roles when permissions are resolved, and replaces the organization-scoped user lookup with an instance-wide one.
Project creation now rejects any role outside the PROJECT_ prefix, using the same check as the ordinary project-member endpoint:
--- a/internal/command/project.go
+++ b/internal/command/project.go
@@
events := make([]eventstore.Command, 0)
for _, admin := range admins {
+ // same check as AddProjectMember: only PROJECT_ roles may be granted on a project
+ if len(domain.CheckForInvalidRoles(admin.Roles, domain.ProjectRolePrefix, c.zitadelRoles)) > 0 {
+ return nil, zerrors.ThrowInvalidArgument(nil, "PROJECT-9sKqZ", "Errors.Project.Member.Invalid")
+ }
_, err := c.checkUserExists(ctx, admin.ID, "")
The permission resolver also ignores a non-project role on a stored project membership, so memberships created before the upgrade stop granting instance permissions:
--- a/internal/api/authz/permissions.go
+++ b/internal/api/authz/permissions.go
@@
roleNames, roleContextID := roleWithContext(membership)
for _, roleName := range roleNames {
+ // project memberships only carry PROJECT_* roles; ignore anything else that was persisted
+ if isProjectMembership(membership) && !strings.HasPrefix(roleName, projectRolePrefix) {
+ continue
+ }
perms := getPermissionsFromRole(roleMappings, roleName)
Service-user creation now checks the ID across the instance. A user ID is available again only after the user or its organization is removed:
--- a/internal/command/user_machine.go
+++ b/internal/command/user_machine.go
@@
- writeModel, err := getMachineWriteModel(ctx, a.ID, a.ResourceOwner, filter, machine.PermissionCheck)
+ exists, err := userExistsInInstance(ctx, filter, a.ID)
if err != nil {
return nil, err
}
- if isUserStateExists(writeModel.UserState) {
+ if exists {
return nil, zerrors.ThrowPreconditionFailed(nil, "COMMAND-k2una", "Errors.User.AlreadyExisting")
}
The patched release also blocks issuing a personal access token, key or client secret for a user ID that was already created twice before the upgrade. It removes the SAML attribute endpoint and requires user.write to return a password-reset code. The host-header fix checks that the identity provider success and failure URLs point to the request's public host and that the host is an instance domain or trusted domain.
The fix is complete for the two Critical flaws. The role check covers project creation, and the resolver filter covers memberships that already exist. The user-ID check covers the Management API and User API v2, and the token, key and secret paths reject duplicates that predate the patch.
How do I check if I was compromised?
Run the advisory's read-only query against the ZITADEL database. It lists every user ID that was created more than once:
WITH creates AS (
SELECT instance_id, aggregate_id, event_type, "owner", creator, created_at, "position"
FROM eventstore.events2
WHERE aggregate_type = 'user'
AND event_type IN ('user.added', 'user.selfregistered',
'user.human.added', 'user.human.selfregistered',
'user.machine.added')
), dups AS (
SELECT instance_id, aggregate_id
FROM creates
GROUP BY instance_id, aggregate_id
HAVING count(*) > 1
)
SELECT c.instance_id, c.aggregate_id AS user_id, c.created_at, c.event_type,
c."owner" AS org_id, c.creator,
EXISTS (SELECT 1 FROM eventstore.events2 d
WHERE d.instance_id = c.instance_id AND d.aggregate_type = 'user'
AND d.aggregate_id = c.aggregate_id AND d.event_type = 'user.removed'
AND d."position" > c."position") AS user_removed_later,
EXISTS (SELECT 1 FROM eventstore.events2 o
WHERE o.instance_id = c.instance_id AND o.aggregate_type = 'org'
AND o.aggregate_id = c."owner" AND o.event_type = 'org.removed'
AND o."position" > c."position") AS org_removed_later
FROM creates c
JOIN dups USING (instance_id, aggregate_id)
ORDER BY c.instance_id, c.aggregate_id, c."position";
A user ID needs attention when at least two rows have both user_removed_later = false and org_removed_later = false. The first row is the original user. Later rows in other organizations are duplicates. The creator column names the user who created each record.
Check project memberships for roles that are not project roles. The eventstore.project_members view exposes one row per role:
SELECT instance_id, project_id, user_id, role
FROM eventstore.project_members
WHERE role NOT LIKE 'PROJECT_%'
ORDER BY instance_id, project_id, user_id;
A non-project role in that view is a lead. Compare the project ID and user ID with the project creation events and with the audit log before concluding that the membership was used. The patch ignores those roles after the upgrade, but the stored rows remain.
If the duplicate query returns a user ID created in two live organizations, review every membership and credential for that ID. The review covers user grants, keys, personal access tokens, client secrets and identity provider links. Delete the user, recreate the legitimate account with a new ID, and review the audit log of the affected organizations.
ZITADEL published no indicators of compromise for these issues. A failed attempt may leave no trace, and the database queries are the reliable check for state that persists.
Timeline
- 2026-11-30: ZITADEL 4.20.7 is released, the last affected version.
- 2026-12-01 09:54 UTC: ZITADEL 4.20.8 is released with the six fixes.
- 2026-12-01 10:17 to 10:22 UTC: ZITADEL publishes the six GitHub security advisories.
- 2026-12-01 12:03 UTC: ZITADEL 4.21.0 is released from 4.20.8 and contains the same fixes.
FAQ
Does 4.20.8 fix all six issues?
Yes. Version 4.20.8 contains the fixes for the two Critical flaws and the four High issues. Version 4.21.0 was cut from 4.20.8 and contains them too.
Is ZITADEL 4.21.0 affected?
No. The advisories list 4.0.0, 4.2.0 or 4.15.2 through 4.20.7 as the affected ranges. Version 4.21.0 was released after 4.20.8 and includes the fixes.
Can an unauthenticated attacker exploit the Critical flaws?
Yes, when public organization registration is enabled, which is the default. An outsider can create an organization, become its owner and obtain the role the project-creation flaw needs. The duplicate-ID flaw also needs a target user ID, and user IDs are not secret.
Is there a CVE ID for these issues?
No. ZITADEL published the six advisories with GHSA IDs and no CVE IDs on 2026-12-01. Use the GHSA IDs to track them.
Were the flaws exploited in the wild?
No evidence of exploitation is published. The six advisories report none, and no CVE ID is assigned, so none can appear in CISA KEV. Absence of evidence is not proof that no attempt was made.
What should I do first?
Upgrade to 4.20.8 or 4.21.0. Then run the duplicate-user and project-membership queries. If either returns a hit, treat the instance as possibly compromised and rotate the credentials and tokens that the affected users could reach.
References
- GHSA-qx3g-qf45-rmvq, privilege escalation to instance and system administrator via project creation, https://github.com/zitadel/zitadel/security/advisories/GHSA-qx3g-qf45-rmvq (checked December 1, 2026)
- GHSA-68mv-8rxc-2rrr, privilege escalation by creating a user with the ID of a user in another organization, https://github.com/zitadel/zitadel/security/advisories/GHSA-68mv-8rxc-2rrr (checked December 1, 2026)
- GHSA-8cr2-7rvm-hxq5, account takeover via host header in the identity provider flow of Login V2, https://github.com/zitadel/zitadel/security/advisories/GHSA-8cr2-7rvm-hxq5 (checked December 1, 2026)
- GHSA-g8gm-547r-665m, unauthenticated user attribute disclosure via SAML AttributeQuery, https://github.com/zitadel/zitadel/security/advisories/GHSA-g8gm-547r-665m (checked December 1, 2026)
- GHSA-6hq4-74jm-4hj4, account takeover via password reset code returned without user.write, https://github.com/zitadel/zitadel/security/advisories/GHSA-6hq4-74jm-4hj4 (checked December 1, 2026)
- GHSA-j24h-w6rf-r4c6, Management API allows organization managers to modify user grants in other organizations, https://github.com/zitadel/zitadel/security/advisories/GHSA-j24h-w6rf-r4c6 (checked December 1, 2026)
- ZITADEL v4.20.8 release notes, https://github.com/zitadel/zitadel/releases/tag/v4.20.8 (published 2026-12-01, checked December 1, 2026)
- ZITADEL v4.21.0 release notes, https://github.com/zitadel/zitadel/releases/tag/v4.21.0 (published 2026-12-01, checked December 1, 2026)
- Fix commit for the project-role check, https://github.com/zitadel/zitadel/commit/a23e238e1763661eddab585f54d86175256503dd (checked December 1, 2026)
- Fix commit for the instance-wide user ID check, https://github.com/zitadel/zitadel/commit/e590967bb5e9de98cd763ca6aaf49d6d78e25bef (checked December 1, 2026)
- Fix commit for the host-header check, https://github.com/zitadel/zitadel/commit/a51161a4b84ee8d1522c6ea334504148cf9fd93d (checked December 1, 2026)
- Fix commit for the password-reset code, https://github.com/zitadel/zitadel/commit/fed1cd45d8a1b27c7c43d0de212e1c02a3b2eed3 (checked December 1, 2026)
- Fix commit that removes the SAML attribute authority, https://github.com/zitadel/zitadel/commit/b09dcc6d75c66d0d1f115b63b0a30db7ee0a98f1 (checked December 1, 2026)
- Fix commit for user-grant scoping, https://github.com/zitadel/zitadel/commit/58bc058e8c58fdfc94d70fdee73dc64d962f44d4 (checked December 1, 2026)
- ZITADEL project creation source at v4.20.7, https://github.com/zitadel/zitadel/blob/v4.20.7/internal/command/project.go (checked December 1, 2026)
- ZITADEL permission resolver at v4.20.7, https://github.com/zitadel/zitadel/blob/v4.20.7/internal/api/authz/permissions.go (checked December 1, 2026)
- ZITADEL service-user creation source at v4.20.7, https://github.com/zitadel/zitadel/blob/v4.20.7/internal/command/user_machine.go (checked December 1, 2026)
- ZITADEL Login V2 identity provider flow at v4.20.7, https://github.com/zitadel/zitadel/blob/v4.20.7/apps/login/src/lib/server/zitadel.ts (checked December 1, 2026)
- ZITADEL public host helper at v4.20.7, https://github.com/zitadel/zitadel/blob/v4.20.7/apps/login/src/lib/server/host.ts (checked December 1, 2026)
- ZITADEL project members view, https://github.com/zitadel/zitadel/blob/v4.20.8/cmd/setup/46/05-project_members_view.sql (checked December 1, 2026)
- ZITADEL repository, https://github.com/zitadel/zitadel (15,688 stars and 1,451 forks, checked December 1, 2026)
- CISA Known Exploited Vulnerabilities catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog (catalog 2026.11.30, checked December 1, 2026)
Keep reading
