CVE-2024-21632
📋 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
- omniauth-microsoft_graph
📦 What is this software?
Omniauth\ by Recognizeapp
⚠️ 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.
🎯 Exploit Status
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
allAdd 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
- https://github.com/synth/omniauth-microsoft_graph/commit/f132078389612b797c872b45bd0e0b47382414c1
- https://github.com/synth/omniauth-microsoft_graph/security/advisories/GHSA-5g66-628f-7cvj
- https://www.descope.com/blog/post/noauth
- https://github.com/synth/omniauth-microsoft_graph/commit/f132078389612b797c872b45bd0e0b47382414c1
- https://github.com/synth/omniauth-microsoft_graph/security/advisories/GHSA-5g66-628f-7cvj
- https://www.descope.com/blog/post/noauth