Summary
Ziit's Epilogue OAuth callback accepts requests without validating an OAuth state parameter, which can let a cross-site request interfere with the account-linking flow. If a signed-in victim is lured into completing that flow with an attacker's authorization code, the attacker may be able to sign in as the victim.
Affected context
The issue is in Ziit's /api/auth/epilogue/callback handler. It is risky when the handler processes an OAuth callback without requiring a valid state value tied to the initiating user session, and a signed-in user can be induced to visit attacker-controlled content.
Exploit preconditions
- Attack surface: The Epilogue OAuth callback endpoint.
- Required access: The victim must be signed in to Ziit; the attacker needs an Epilogue authorization code and a way to lure the victim to a cross-site page.
- Trigger point: The victim's browser sends a request that completes the OAuth link flow.
- Why exploitation is possible: The callback accepts requests without the OAuth state parameter, so it cannot reliably verify that the flow was initiated by the victim's session.
Why this happens
The callback does not require and validate an OAuth state value that is unpredictable, associated with the initiating session, and checked when the response returns. This is a CSRF weakness (CWE-352): the application processes a state-changing request without adequately verifying that it was intentionally initiated by the signed-in user. In an OAuth flow, missing state validation can also allow responses to be associated with the wrong session.
Potential impact
- An attacker may complete an OAuth linking flow in a victim's session.
- The attacker could gain the ability to sign in as the victim.
- The victim's account and data may be exposed to unauthorized access.
General mitigation guidance
Defensive patterns include requiring a high-entropy OAuth state value for every flow, binding it to the initiating session, and rejecting missing, mismatched, or reused values. Treat callback parameters as untrusted, validate the response before changing account state, and use secure session-cookie settings as an additional layer rather than a replacement for state validation. Apply least privilege to linked identities and provide users with ways to review and revoke account connections.
How teams detect issues like this
- Review OAuth callback code for missing, optional, or incomplete state validation.
- Use static analysis and code-review checks to flag state-changing handlers that do not verify request origin or session intent.
- Add automated tests for absent, mismatched, expired, and reused state values.
- Monitor authentication and account-linking events for unexpected callback sequences or newly linked identities.
- Enforce policies requiring documented CSRF protections for OAuth callbacks and other state-changing endpoints.

