/

CVE-2026-29191

Severity:

CRITICAL RISK

(9.3)

XSS in ZITADEL Login V2 /saml-post Endpoint

CVE-2026-29191

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Account Takeover via Client-Side Code Execution

Severity:

CRITICAL RISK

(9.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A stored or reflected cross-site scripting (XSS) issue in ZITADEL's login V2 interface, specifically the /saml-post endpoint, can allow execution of attacker-controlled JavaScript in a victim's browser.

Under realistic conditions where an attacker can inject or influence SAML-related content rendered by this endpoint, this can lead to full account takeover for affected ZITADEL users.

Affected context

The vulnerability exists in the web-based login V2 flow of ZITADEL, centered on the /saml-post endpoint that processes and renders SAML-related data in the browser.

It becomes relevant in deployments where:

  • ZITADEL acts as or integrates with SAML identity providers or service providers,
  • SAML messages or related parameters can be influenced by untrusted or partially trusted parties,
  • Browser clients render data from /saml-post without sufficient output encoding.

The issue manifests only when user-controlled or externally sourced values are incorporated into the response page in an unsafe way.

Exploit preconditions

  • Attack surface: Public-facing ZITADEL login V2 interface, specifically HTTP(S) requests targeting the /saml-post endpoint.
  • Required access: Ability to inject or control data that the login V2 /saml-post flow reflects or stores and later renders (e.g., crafted SAML assertions, parameters, or integration inputs).
  • Victim interaction: A target user must be tricked into visiting or being redirected through a maliciously crafted login or SAML flow, typically via a phishing link or compromised integration.
  • Trigger point: The browser renders an HTML response from /saml-post that embeds attacker-controlled data without proper context-aware output encoding.
  • Why exploitation is possible: The endpoint mixes untrusted input with HTML/JavaScript in the response, violating output encoding and content separation principles, enabling arbitrary script execution in the victim's session.

Why this happens

This vulnerability stems from improper neutralization of user-controlled or externally sourced data before it is included in an HTML context within the login V2 /saml-post response.

The underlying bug class is CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where the application directly embeds data influenced by SAML or login parameters into the page without robust escaping or context-aware encoding.

As a result, crafted payloads can break out of the intended content context and introduce executable JavaScript, running with the same origin as the legitimate ZITADEL interface.

Potential impact

  • Attackers can execute arbitrary JavaScript in the victim's browser within the ZITADEL origin.
  • Session tokens, authorization codes, or other sensitive login artifacts may be read or exfiltrated.
  • User accounts can be taken over by stealing authentication data or performing authenticated actions on the user's behalf.
  • Login flows to downstream applications integrated with ZITADEL may be compromised, enabling broader identity and access abuse.
  • Trusted login pages can be modified in the victim's view to capture credentials or multi-factor authentication secrets.

General mitigation guidance

Effective mitigation relies on treating all SAML and login-related inputs as untrusted and applying robust output handling:

  • Apply strict, context-aware output encoding for any data rendered in HTML, attributes, URLs, or JavaScript contexts in the login V2 and /saml-post views.
  • Avoid directly embedding raw SAML fields or parameters into HTML templates; map them to safe, validated view models with whitelisting of expected values.
  • Normalize and validate SAML and query parameters against strict schemas, rejecting unexpected or malformed content before rendering.
  • Use modern templating systems that auto-escape by default and avoid concatenating HTML or JavaScript strings with user-controlled data.
  • Enforce defense-in-depth browser controls such as Content Security Policy (CSP) to reduce the impact of any remaining script injection vectors.

How teams detect issues like this

Organizations can detect and manage this class of vulnerability through multiple practices:

  • Static analysis: Configure SAST rules to flag HTML rendering paths where data from HTTP parameters, SAML assertions, or external identity inputs flow into templates without encoding.
  • Code review: During reviews of authentication and SSO flows, explicitly track how external identity data is consumed and rendered, and require visible encoding/validation at the boundary.
  • Dynamic testing: Use DAST or manual penetration testing against login and SAML endpoints, injecting benign test payloads to detect script execution in browser responses.
  • Security policies: Introduce secure coding guidelines mandating context-aware output encoding and safe templating for all identity and SSO-related user interfaces.
  • Automated tooling: Integrate automated web security scanners and linters into CI/CD to continuously check for XSS patterns in views and controllers.

Sources

SourceLink
github.comgithub.com/zitadel/zitadel/security/advisories/GHSA-pr34-2v5x-6qjq

Frequently asked

questions

Yes. Because the login V2 interface is typically internet-accessible, a remote attacker can craft malicious requests or SAML flows and lure victims into visiting them, leading to XSS-based account takeover.

The attacker generally needs only the ability to send crafted links or initiate SAML login flows that influence the data rendered by the /saml-post endpoint.

They do not need prior authentication to the victim's account, but they must convince the victim to interact with the malicious flow.

The most robust fix is to enforce strict context-aware output encoding for all untrusted data rendered in the login and SAML-related pages, combined with strong input validation and the avoidance of directly injecting raw SAML or request parameters into templates.

Future prevention involves adopting a secure-by-default templating strategy, enforcing organization-wide XSS-safe coding standards, regularly testing authentication and SSO interfaces with automated and manual security testing, and layering browser-side protections such as CSP and secure cookie attributes to limit the impact of any remaining injection points.

Find out what's already
exploitable in your codebase.