CVE-2026-92161: FriendsOfFlarum OAuth: Unauthenticated account takeover via unverified email trust in Discord OAuth provider
Impact
An unauthenticated account takeover vulnerability exists in fof/oauth when the Discord OAuth provider is enabled.
Discord allows an account to use an unverified email address when its phone number has been verified. During OAuth authentication, Discord may return that email address with "verified": false.
Affected versions of fof/oauth did not validate this flag and passed the email address to Flarum core as trusted via provideTrustedEmail(). Flarum core could then match the trusted email address to an existing user, link the attacker-controlled Discord identity to that user, and authenticate the attacker as the victim.
An attacker who knows a user's email address can therefore take over the corresponding Flarum account without knowing its password or requiring any interaction from the victim. This includes administrator accounts.
Preconditions for exploitation
1. Discord sign-in is enabled on the forum. 2. The victim has a Flarum account with a known email address. 3. The victim's email address is not already associated with a Discord account. 4. The attacker creates or configures a Discord account using the victim's email address without verifying it and verifies a phone number instead. 5. The attacker authenticates to the forum using that Discord account.
The issue is specific to Discord's ability to return an unverified email address through OAuth. Other bundled providers were not confirmed to be practically exploitable through the same method because they only return verified or confirmed email addresses in the relevant authentication flow.
Patched Versions
- 1.7.4 - 2.0.0-beta.4
Workarounds
Administrators who cannot update immediately should disable the Discord OAuth provider in the extension settings.
Credits
Reported by @faran1512
Other sources
FriendsOfFlarum OAuth allows users to log in to Flarum with GitHub, Twitter, Facebook, and other providers. Prior to 1.7.4 and 2.0.0-beta.4, the Discord OAuth provider does not check the verified field returned for an OAuth email before passing the address to Flarum core as trusted through provideTrustedEmail(). When Discord sign-in is enabled, an unauthenticated attacker who knows the email address of a Flarum user can configure a Discord account with that unverified address and a verified phone number, then sign in to cause Flarum to match the trusted address, link the attacker-controlled Discord identity to the existing user, and authenticate as the victim without a password or victim interaction. Exploitation requires that the victim's email address is not already associated with a Discord account, and it can compromise administrator accounts. Other bundled providers were not confirmed to be practically exploitable by this method because their relevant authentication flows return only verified or confirmed email addresses. This issue is fixed in versions 1.7.4 and 2.0.0-beta.4.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/fof/oauthto a version that resolves this vulnerability.Fixed in 2.0.0-beta.4 - Upgrade
Upgrade
composer/fof/oauthto a version that resolves this vulnerability.Fixed in 1.7.4 - Upgrade
Upgrade
fof/oauthto a version that resolves this vulnerability.Fixed in 1.7.4 - Upgrade
Upgrade
fof/oauthto a version that resolves this vulnerability.Fixed in 2.0.0-beta.4 - Configuration
Disable the Discord OAuth provider in the extension settings if you cannot update immediately.
fof/oauth Discord OAuth provider Discord OAuth provider = disabled
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using FriendsOfFlarum OAuth before 1.7.4 or 2.0.0-beta.4 are exposed when Discord sign-in is enabled. The issue can affect any Flarum account, including administrator accounts.
What does an attacker need to exploit it?
The attacker needs to know a Flarum user's email address and must be able to configure a Discord account with that address while it remains unverified, plus a verified phone number. Exploitation also requires that the victim email address is not already associated with a Discord account.
Are the other bundled OAuth providers known to be affected in practice?
GitHub, Twitter, Facebook, and other bundled providers were not confirmed to be practically exploitable through this method. Their relevant authentication flows return only verified or confirmed email addresses.
What should be done if immediate patching is not possible?
Disable Discord sign-in until FriendsOfFlarum OAuth can be updated to 1.7.4 or 2.0.0-beta.4. This prevents the vulnerable Discord OAuth email-trust flow from being used.