Summary
A high-severity authentication bypass in Coolify's OAuth callback handler can authenticate a user based only on an email address, without adequately verifying the OAuth provider's identity assertion or binding the identity to an approved account.
If an attacker can register a victim's email address with an enabled OAuth provider and complete the callback flow, they may obtain an authenticated session as that victim, bypassing password and two-factor authentication controls.
Affected context
The vulnerability occurs in Coolify deployments that enable OAuth login and use a callback handler that maps provider-supplied email addresses directly to existing accounts. Risk is higher when the application does not require verified provider assertions, enforce trusted-provider policies, or maintain an explicit binding between local accounts and OAuth identities.
Exploit preconditions
- Attack surface: OAuth authentication callback endpoint
- Required access: Ability to create or control an identity on an OAuth provider accepted by the Coolify instance
- Trigger point: Completion of the OAuth login and callback flow
- Why exploitation is possible: The callback may trust an email address as sufficient identity proof without validating the provider assertion or confirming that the OAuth identity is bound to the account
Why this happens
The underlying bug is an account-identity validation failure. The OAuth callback uses an email address as the primary account-matching key while omitting or inadequately enforcing verification of provider claims and stable identity binding.
This maps to CWE-287: Improper Authentication, because the application accepts an authentication result without establishing that the OAuth identity is legitimately associated with the existing account. Email-address matching alone is not a sufficient substitute for provider-backed identity verification.
Potential impact
- An attacker may obtain an authenticated session for another user's account
- Password-based authentication requirements may be bypassed
- Existing two-factor authentication protections may be circumvented
- Administrative projects, deployments, or secrets could be exposed or modified
- The affected account may be used for unauthorized operational or supply-chain activity
General mitigation guidance
Mitigation generally focuses on treating OAuth identities as verified external principals rather than trusting email addresses alone.
Common defensive patterns include:
- Validate issuer, audience, signature, nonce, state, and other relevant provider assertions
- Bind accounts to a stable, provider-specific subject identifier rather than email alone
- Require verified email claims and apply explicit trusted-provider policies
- Require deliberate account linking or reauthentication for existing accounts
- Preserve local authentication and multi-factor requirements when linking identities
- Apply least privilege to OAuth-created sessions and administrative accounts
- Fail closed when identity claims are missing, ambiguous, or inconsistent
How teams detect issues like this
Organizations can look for authentication flows that use email addresses as the sole account-linking or account-selection key.
Useful approaches include:
- Static analysis and code review for OAuth callbacks that map email claims directly to local users
- Checks for missing issuer, audience, signature, nonce, state, or subject validation
- Review of account-linking logic for explicit user consent and reauthentication
- Monitoring for new OAuth identities, unusual provider changes, and sessions created without expected MFA events
- Policy enforcement requiring approved OAuth providers and stable subject-based identity binding
- Automated security review tools that flag improper authentication and unsafe account-linking patterns

