CVE-2024-21632

8.6 HIGH

📋 TL;DR

CVE-2024-21632 is an authentication bypass vulnerability in omniauth-microsoft_graph where the email attribute from Microsoft Graph API responses isn't validated, allowing attackers to impersonate users. This affects applications using this OmniAuth strategy with email as a trusted identifier. The vulnerability enables account takeover through nOAuth misconfiguration.

💻 Affected Systems

Products:
  • omniauth-microsoft_graph
Versions: All versions prior to 2.0.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using email as trusted user identifier. Applications using other identifiers like user ID may not be vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete account takeover of any user in the system, potentially leading to data theft, privilege escalation, and unauthorized access to sensitive resources.

🟠

Likely Case

Targeted account takeover of specific users through crafted authentication responses, leading to unauthorized access to user accounts and associated data.

🟢

If Mitigated

Limited impact if email isn't used as primary identifier or additional validation layers exist, but authentication reliability remains compromised.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires ability to intercept or manipulate OAuth flow, but technique is well-documented as nOAuth attack pattern.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.0.0

Vendor Advisory: https://github.com/synth/omniauth-microsoft_graph/security/advisories/GHSA-5g66-628f-7cvj

Restart Required: Yes

Instructions:

1. Update Gemfile to specify 'omniauth-microsoft_graph', '>= 2.0.0'. 2. Run 'bundle update omniauth-microsoft_graph'. 3. Restart application server. 4. Verify email validation is now enforced.

🔧 Temporary Workarounds

Implement custom email validation

all

Add manual email validation in application code before trusting email from OAuth response

# In OmniAuth callback handler, add: if user_email.ends_with?('@trusted-domain.com') && validate_email_format(user_email)

🧯 If You Can't Patch

  • Disable email-based authentication and use Microsoft Graph user ID instead
  • Implement additional authentication factor for all users

🔍 How to Verify

Check if Vulnerable:

Check Gemfile.lock for omniauth-microsoft_graph version < 2.0.0

Check Version:

bundle show omniauth-microsoft_graph

Verify Fix Applied:

Verify Gemfile.lock shows version >= 2.0.0 and test authentication with invalid email domain

📡 Detection & Monitoring

Log Indicators:

  • Authentication attempts with unexpected email domains
  • Multiple successful logins from same IP with different emails

Network Indicators:

  • Unusual OAuth callback patterns
  • Authentication requests with modified email parameters

SIEM Query:

source="application.log" AND "omniauth" AND "microsoft_graph" AND ("email" OR "callback") | stats count by user_email

🔗 References

📤 Share & Export