CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Dashboard
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-27840
4.30.01%

ZITADEL Opaque Token Validation Logic Flaw

Alon Barad
Alon Barad
Software Engineer

Feb 28, 2026·6 min read·4 visits

PoC Available

Executive Summary (TL;DR)

ZITADEL fails to verify the full integrity of decrypted V2 opaque access tokens. By truncating a valid token to approximately 80 characters, an attacker can bypass integrity checks, as the system validates the session identifier but ignores the missing user ID suffix. Fixed in versions 3.4.7 and 4.11.0.

A logical integrity vulnerability exists in ZITADEL's handling of V2 opaque access tokens. Due to insufficient validation of the decrypted token payload, the system accepts truncated tokens that lack the required user identity suffix. This flaw allows modified authentication artifacts to pass verification checks, violating the integrity of the authorization mechanism.

Vulnerability Overview

ZITADEL, an open-source identity management platform, utilizes opaque access tokens for user authorization. In affected versions, a vulnerability exists in the validation logic for "V2" format tokens. These tokens are encrypted strings that, when decrypted, contain a composite structure: a token identifier (session reference) and a user identifier. The vulnerability arises from the system's failure to enforce strict integrity checks on the entire decrypted payload.

The specific flaw allows a token to be truncated—stripping the user identifier portion of the payload—while remaining valid in the eyes of the verification logic. Because the system successfully extracts the token identifier from the prefix and retrieves the corresponding session from the database, it erroneously assumes the token is valid without verifying that the token's embedded user identity matches the database record. This represents a violation of CWE-302 (Authentication Bypass by Assumed-Immutable Data).

Root Cause Analysis

The root cause lies in the implementation of the verifyAccessTokenV2 function within the event sourcing repository. ZITADEL V2 tokens encapsulate two pieces of data in their decrypted plaintext: a token_id (formatted as v2_<oidc_session>...) and a user_id.

When a request is received, the system performs the following steps:

  1. Decrypts the opaque token string.
  2. Parses the token_id from the beginning of the plaintext.
  3. Queries the database using this token_id to retrieve the active session and associated metadata (including the authoritative user_id).

In vulnerable versions, the verification logic stopped there. It implicitly trusted that if the token_id existed and was active in the database, the token was valid. It failed to compare the user_id present in the token's tail against the user_id retrieved from the database. Consequently, if a token was truncated such that the token_id remained intact but the user_id was removed, the system processed the request as authenticated, ignoring the data discrepancy.

Code Analysis

The vulnerability exists in internal/authz/repository/eventsourcing/eventstore/token_verifier.go. The fix introduces a mandatory parity check between the token's claim and the database's record.

Below is the logic flow before and after the patch:

// VULNERABLE LOGIC (Conceptual)
// The system retrieves the token object based on the ID found in the input string.
activeToken, err := repo.eventstore.GetToken(ctx, tokenID)
if err != nil {
    return error
}
// The function returns success here without checking if the input 'subject' (userID from token)
// actually matches 'activeToken.UserID' (userID from DB).
return activeToken.UserID, nil

The patch enforces strict equality. If the decrypted subject does not match the database record, the token is rejected as invalid or tampered with.

// PATCHED LOGIC in verifyAccessTokenV2
func (repo *TokenVerifierRepo) verifyAccessTokenV2(ctx context.Context, token, subject, ...) {
    // ... [Retrieval of activeToken from database] ...
 
    // CRITICAL FIX: Verify the subject (decrypted UserID) matches the DB record.
    // If the token was truncated, 'subject' would be empty or malformed.
    if activeToken.UserID != subject {
        // Explicitly reject the request if the identities do not align
        return "", "", "", "", "", zerrors.ThrowUnauthenticated(nil, "APP-3f4fs", "invalid token")
    }
 
    // ... [Continue with expiration checks] ...
}

Exploitation and Attack Vector

The exploitation of this vulnerability is trivial but requires access to a valid V2 token. The attack vector is network-based and involves token malleability.

Attack Workflow

  1. Acquisition: The attacker obtains a valid V2 opaque access token (e.g., via a standard OIDC login flow).
  2. Modification: The attacker truncates the token string to approximately 80 characters. This length is sufficient to retain the encrypted token_id prefix but discards the suffix containing the user_id.
  3. Submission: The attacker submits this truncated token in the Authorization: Bearer <token> header of an API request.

Outcome

The ZITADEL backend decrypts the partial ciphertext (or processes the prefix depending on the encryption mode specifics), successfully extracts the session ID, and validates the request. The server responds with 200 OK despite the token being structurally corrupt. While this does not inherently allow an attacker to generate tokens for other users (as the token_id contains high-entropy random values), it degrades the integrity of the authentication protocol by allowing malformed credentials to be accepted.

Impact Assessment

The severity of this vulnerability is classified as Medium (CVSS 4.3). The impact is primarily on the integrity of the authentication mechanism rather than direct confidentiality or availability loss.

  • Integrity Violation: The core issue is the system's willingness to accept modified data. In a strict security model, any alteration to a credential must result in immediate rejection.
  • Limited Privilege Escalation: The vulnerability does not allow an attacker to forge a session for an arbitrary user, as they would still need to guess a valid 128-bit (or larger) token_id which acts as the database key. The attack is limited to modifying existing valid tokens.
  • Scope: This affects all deployments using V2 opaque tokens in ZITADEL versions prior to 3.4.7 and 4.11.0.

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N

  • Attack Vector: Network (N)
  • Privileges Required: None (N) - theoretically, though possession of a token is needed.
  • Integrity: Low (L) - Modification of data is possible, but control over the scope is limited.

Mitigation Strategies

Remediation requires updating the ZITADEL instance to a patched version that includes the logic to cross-verify the token subject against the database record.

Official Patches

  • v3.x Branch: Upgrade to ZITADEL v3.4.7 or later.
  • v4.x Branch: Upgrade to ZITADEL v4.11.0 or later.

Deployment Changes

No configuration changes are required after the upgrade. The fix is internal to the TokenVerifierRepo logic. Existing tokens remain valid; however, any truncated tokens cached or stored by malicious actors will immediately cease to function, resulting in Unauthenticated errors (APP-3f4fs).

Detection

Security teams can identify exploitation attempts by analyzing application logs for specific error patterns post-patch. Look for increased occurrences of the error ID APP-3f4fs with the message "invalid token," which indicates that a token's decrypted subject did not match the associated session owner.

Official Patches

ZITADELRelease v3.4.7 fixing the vulnerability
ZITADELRelease v4.11.0 fixing the vulnerability

Fix Analysis (1)

Technical Appendix

CVSS Score
4.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
EPSS Probability
0.01%
Top 97% most exploited

Affected Systems

ZITADEL Identity Management Platform

Affected Versions Detail

Product
Affected Versions
Fixed Version
ZITADEL
ZITADEL
>= 3.0.0, < 3.4.73.4.7
ZITADEL
ZITADEL
>= 4.0.0, < 4.11.04.11.0
AttributeDetail
CWECWE-302
CVSS v3.14.3 (Medium)
Attack VectorNetwork
ImpactIntegrity Loss
Exploit StatusPoC Available
EPSS Score0.015%

MITRE ATT&CK Mapping

T1556Modify Authentication Process
Credential Access
T1212Exploitation for Credential Access
Credential Access
CWE-302
Authentication Bypass by Assumed-Immutable Data

Authentication Bypass by Assumed-Immutable Data

Known Exploits & Detection

ZITADEL Security AdvisoryProof of concept involves truncating the opaque access token to 80 characters.

Vulnerability Timeline

Fix committed to GitHub
2026-02-16
Public disclosure and GHSA publication
2026-02-26

References & Sources

  • [1]GHSA-6mq3-xmgp-pjm5
  • [2]NVD CVE-2026-27840

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.