The vulnerability is a DOM-based Cross-Site Scripting (XSS) issue in the logout functionality of ZITADEL's V2 login interface. The root cause lies in the apps/login/src/app/(login)/logout/page.tsx file, where the Page component directly used the post_logout_redirect and post_logout_redirect_uri GET parameters from the URL to redirect the user after logout. There was no validation or sanitization of this user-provided input, allowing an attacker to inject a javascript: URI. This would lead to the execution of arbitrary JavaScript in the user's browser within the security context of the ZITADEL login domain, enabling session manipulation and potential account takeover.
The patch addresses this by fundamentally changing how logout parameters are handled. Instead of passing them directly in the URL, the backend, specifically in internal/api/oidc/auth_request.go, now generates a signed JSON Web Token (JWT) called logout_token. This token securely encapsulates the post_logout_redirect_uri and other logout-related data. The frontend Page component was modified to stop reading the insecure parameters directly. It now expects the logout_token, verifies its signature using the newly introduced verifyJwt function, and only then extracts and uses the redirect URI from the trusted token payload. This ensures the integrity and authenticity of the logout parameters, effectively mitigating the XSS vulnerability.
Pageapps/login/src/app/(login)/logout/page.tsx
buildLoginV2LogoutURLinternal/api/oidc/auth_request.go
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/zitadel/zitadel | go | < 1.80.0-v2.20.0.20251208091519-4c879b47334e | 1.80.0-v2.20.0.20251208091519-4c879b47334e |
| github.com/zitadel/zitadel | go | >= 1.83.4, <= 1.87.5 | |
| github.com/zitadel/zitadel | go | >= 4.0.0-rc.1, < 4.7.1 | 4.7.1 |
| github.com/zitadel/zitadel/v2 | go | < 1.80.0-v2.20.0.20251208091519-4c879b47334e | 1.80.0-v2.20.0.20251208091519-4c879b47334e |