| 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 |
The vulnerability is a classic host header injection in the password reset functionality. The root cause lies in the apps/login/src/lib/server/host.ts file, where the getOriginalHost function blindly trusted the x-forwarded-host header provided by the user. This allowed an attacker to control the domain used in the password reset link.
The resetPassword function in apps/login/src/lib/server/password.ts used the value from the vulnerable getOriginalHost function to construct the password reset URL that was then emailed to the user. By injecting a malicious domain into the x-forwarded-host header, an attacker could cause the password reset link to be sent to a server they control. When the victim clicks the link, the attacker captures the secret password reset token from the URL, allowing them to reset the password and take over the account.
The patch addresses this by introducing a more robust way of handling host headers. It distinguishes between the public-facing host (publicHost) and the internal instance host (instanceHost). The getServiceConfig function and the new getPublicHost and getInstanceHost functions in apps/login/src/lib/server/host.ts are part of the fix. The backend is now expected to validate the provided host against a list of trusted domains. A similar vulnerability was also fixed in the logout process in buildLoginV2LogoutURL by using a signed JWT to protect the logout redirect URL.
resetPasswordapps/login/src/lib/server/password.ts
getOriginalHostapps/login/src/lib/server/host.ts
buildLoginV2LogoutURLinternal/api/oidc/auth_request.go
getServiceUrlFromHeadersapps/login/src/lib/service-url.ts