GHSA-g7vj-c29h-3h5m: Critical severity composer/fof/oauth vulnerability
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
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 unable to update immediately.
fof/oauth Discord OAuth provider Discord OAuth provider = disabled
Event History
Frequently Asked Questions
Which forums are exposed to this account takeover issue?
Forums are exposed when the Discord OAuth provider is enabled in fof/oauth. The affected user must have a Flarum account with a known email address that is not already associated with a Discord account.
What does an attacker need to take over an account?
The attacker needs to know the victim's email address and create or configure a Discord account using that address without verifying it, while having a verified phone number. No Flarum password, prior authentication, or victim interaction is required.
Can administrator accounts be compromised?
Yes. If an administrator account meets the stated conditions, an attacker can authenticate as that administrator through the Discord OAuth flow.
How can I assess whether a specific user may be vulnerable?
Check whether Discord sign-in is enabled, whether the user's Flarum email address is known, and whether that address is already associated with a Discord account. Users whose email addresses are not associated with Discord accounts meet one of the exploitation preconditions.