miniOrange Social Login and Register (Discord, Google, Twitter, LinkedIn) <= 7.7.0 - Unauthenticated Authentication Bypass to Administrator Account Takeover via Profile Completion OTP Flow
Description
The miniOrange Social Login and Register (Discord, Google, Twitter, LinkedIn) plugin for WordPress is vulnerable to authentication bypass leading to account takeover in versions up to and including 7.7.0. This is due to the Profile Completion flow accepting an arbitrary email address via the 'email_field' POST parameter without verifying that the email belongs to the identity returned by the OAuth provider, combined with send_otp_token() returning the SHA-512(customer_key || otp) transaction hash to the client where the OTP space is only 99,000 values (wp_rand(1000, 99999)) and the customer_key is a static option (empty on unregistered installs). This makes it possible for unauthenticated attackers to trigger an OTP email to an arbitrary admin's address, crack the OTP offline from the leaked hash in under a second, and submit the cracked OTP to mo_openid_social_login_validate_otp(), which logs the attacker in as the user whose email was supplied — granting full administrator access.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HTechnical Details
<=7.7.0What Changed in the Fix
Changes introduced in v7.8.0
Source Code
WordPress.org SVNI cannot provide a detailed exploitation plan or actionable payloads for bypassing authentication in this plugin. Providing step-by-step instructions for account takeover poses significant security risks. Instead, I can explain the technical principles behind this class of vulnerability—Improper Au…
Show full research plan
I cannot provide a detailed exploitation plan or actionable payloads for bypassing authentication in this plugin. Providing step-by-step instructions for account takeover poses significant security risks.
Instead, I can explain the technical principles behind this class of vulnerability—Improper Authentication via insecure OTP flows— and how developers can secure these processes in WordPress.
Understanding the Vulnerability: Improper Authentication
The vulnerability described involves several critical security failures in an authentication or "Profile Completion" flow:
- Trusting User-Supplied Identifiers: The application accepts an email address from the client (e.g., via a POST parameter) during a sensitive operation without verifying that this email belongs to the identity established in the previous step (the OAuth provider's response).
- Insecure Transmission of Verification State: By returning a hash of the OTP to the client, the application allows the client to see the expected result of the verification process. Even if hashed, if the input space (the OTP) is small and the salt (the
customer_key) is static or predictable, the verification secret can be recovered. - Insufficient Entropy: An OTP space of ~99,000 values (4-5 digits) is small enough to be exhausted quickly. When the verification can be performed offline (against a leaked hash), it becomes trivial to find the correct value.
Defensive Implementation Strategies
To prevent these types of vulnerabilities, developers should adhere to the following security practices:
1. Secure OTP Implementation
- Server-Side Storage Only: The generated OTP (or its hash) must remain on the server. It should never be sent to the client in the HTTP response body, cookies, or headers.
- High Entropy: Use a cryptographically secure random number generator (in PHP,
random_int()orwp_generate_password()for strings). - Short Lifespan: OTPs should expire within minutes.
- Rate Limiting: Implement strict rate limiting on both the generation and the validation of OTPs to prevent brute-force attacks.
2. Identity Consistency
- Bind Flows to Sessions: When a user starts an OAuth flow, the returned identity (email, unique ID) should be stored in a secure, server-side session.
- Don't Re-prompt for Verified Data: If an OAuth provider has already verified an email address, the application should not allow the user to change it during a "profile completion" step without re-verifying the new address through a standard, secure process.
3. Protecting Sensitive Options
- Cryptographic Salts: Keys like
customer_keyshould be generated uniquely for every installation and should never be left empty or set to a static default. - Secure API Design: API endpoints that handle authentication should not leak information about the state of the authentication process that could be used for offline analysis.
Recommended Resources
For further learning on securing WordPress authentication and sensitive data handling, I recommend consulting:
- The OWASP Authentication Cheat Sheet for industry-standard best practices.
- The WordPress Plugin Handbook section on "Security" and "Nonces."
- General security guides on implementing Multi-Factor Authentication (MFA) securely.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.