Summary
Statamic can allow an unauthenticated attacker to access an existing account when OAuth login is enabled with a provider that does not guarantee verified email addresses. Because the application matches OAuth identities by email alone, a matching unverified identity may result in account takeover, potentially including access to a super administrator account.
Affected context
The issue occurs in Statamic deployments where OAuth authentication is explicitly enabled and configured with a provider that does not reliably verify email ownership. Risk is greatest when an existing account, including a privileged administrative account, can be matched solely through an email address supplied by the OAuth provider.
Exploit preconditions
- Attack surface: Statamic OAuth login endpoint
- Required access: No prior authentication is required
- Configuration requirement: OAuth must be enabled with a provider that does not guarantee verified email addresses
- Trigger point: Authentication of an OAuth identity whose email matches an existing Statamic account
- Why exploitation is possible: Account linking relies on an email address without establishing that the OAuth identity controls or has legitimately verified that address
Why this happens
The underlying flaw is an authentication decision based on an insufficiently trusted identity attribute. Treating an OAuth-provided email address as proof of account ownership can allow an attacker-controlled or unverified identity to be associated with an existing local account. This maps primarily to CWE-287: Improper Authentication, with CWE-290: Authentication Bypass by Spoofing also relevant because the identity is accepted without adequate verification.
Potential impact
- An attacker may gain access to an existing user account
- A compromised account could expose private CMS content and administrative data
- A privileged account takeover could allow unauthorized content or configuration changes
- A compromised super administrator account could enable broader application compromise
General mitigation guidance
Mitigation generally focuses on strengthening identity binding rather than
trusting an unverified email address as the sole account-matching key.
Common defensive patterns include:
- Accepting OAuth identities only from providers that provide strong, verified identity claims
- Requiring explicit account linking or prior authenticated consent before associating an OAuth identity with an existing account
- Using the provider's stable subject identifier together with issuer context as the primary identity key
- Requiring verified email claims and validating issuer, audience, token integrity, and claim semantics
- Applying least privilege to administrative accounts and requiring stronger authentication for privileged access
- Treating OAuth provider configuration as security-sensitive and restricting unauthorized changes
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis and code review rules that flag account lookup or linking by email alone
- Reviews of OAuth handlers for missing issuer, subject, audience, or email-verification checks
- Authentication tests using unverified, changed, or duplicate email claims
- Policy enforcement requiring explicit identity-linking flows for external authentication
- Audit-log monitoring for unexpected OAuth logins, new identity associations, and privileged account access
- Neutral automated security review tools that identify weak OAuth account-binding patterns

