The vulnerability is a Server-Side Request Forgery (SSRF) in the ZITADEL Actions feature. The root cause is the lack of validation on the target URLs for webhooks, which can be configured as part of an Action. An attacker could set the webhook URL to a local or internal network address (e.g., localhost, 127.0.0.1).
The analysis of the patch commit reveals that the fix was implemented in two main places:
- Configuration Time: When creating or modifying an Action target, the endpoint URL is now validated against a denylist. The functions
command.Commands.AddTarget and command.Commands.ChangeTarget were updated to perform this check. Previously, they only checked if the URL was parsable, not if it pointed to a restricted address.
- Execution Time: Right before making the HTTP request to the action's endpoint, another check against the denylist was added. This occurs in
execution.CallTarget and actions.transport.RoundTrip. This serves as a defense-in-depth measure, preventing the SSRF even if a maliciously configured action somehow exists in the system.
Therefore, the vulnerable functions are those that either allowed the creation of the malicious configuration (AddTarget, ChangeTarget) or those that executed the request without proper checks (CallTarget, transport.RoundTrip). During an exploit, a profiler would likely show execution.CallTarget or actions.transport.RoundTrip in the stack trace as they are directly responsible for the outbound HTTP request that constitutes the SSRF.