The vulnerability lies in the ZITADEL login V2 UI, where server-side functions responsible for user registration and authentication failed to properly enforce configured security policies. The analysis of the patch commit b4efc80 reveals that several functions in apps/login/src/lib/server/password.ts and apps/login/src/lib/server/register.ts were modified to include necessary policy checks.
The root cause was the absence of checks for policies like allowRegister, allowLocalAuthentication, and hidePasswordReset at the beginning of the respective functions. This allowed an attacker to send direct HTTP requests to the server, bypassing the UI and invoking these functions to perform actions that should have been disallowed by the organization's settings. For example, an attacker could register a new user even if self-registration was disabled, or authenticate with a password when only passwordless methods were supposed to be allowed.
The patch rectifies this by adding the policy enforcement logic at the entry point of the vulnerable functions (resetPassword, sendPassword, registerUser, registerUserAndLinkToIDP), ensuring that the security settings are respected before proceeding with any sensitive operations. During exploitation, these function names would appear in a runtime profile or stack trace.