CVE-2024-52289

9.8 CRITICAL

📋 TL;DR

This vulnerability allows attackers to bypass OAuth2 redirect URI validation in authentik by exploiting improper regex escaping. Attackers can register malicious domains that match the regex pattern of legitimate redirect URIs, potentially leading to authorization code interception. All authentik instances with OAuth2 providers configured are affected.

💻 Affected Systems

Products:
  • authentik
Versions: All versions before 2024.8.5 and 2024.10.3
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only affects instances with OAuth2 providers configured. The vulnerability requires specific misconfiguration or lack of redirect URI validation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete account takeover via OAuth authorization code interception, leading to unauthorized access to connected applications and potential data exfiltration.

🟠

Likely Case

Attackers redirect OAuth authorization codes to domains they control, enabling them to steal access tokens and impersonate legitimate users.

🟢

If Mitigated

With proper input validation and regex escaping, the vulnerability is prevented, maintaining secure OAuth2 flow.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires attacker to register a domain that matches the regex pattern of a legitimate redirect URI. Public proof-of-concept demonstrates the bypass technique.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2024.8.5 or 2024.10.3

Vendor Advisory: https://github.com/goauthentik/authentik/security/advisories/GHSA-3q5w-6m3x-64gj

Restart Required: Yes

Instructions:

1. Update authentik to version 2024.8.5 or 2024.10.3. 2. Restart the authentik service. 3. Verify the update was successful by checking the version.

🔧 Temporary Workarounds

Manual Regex Escaping

all

Escape special regex characters in redirect URIs when configuring OAuth2 providers

🧯 If You Can't Patch

  • Review and validate all OAuth2 provider redirect URIs, ensuring they use proper regex escaping for special characters
  • Implement additional validation layer for redirect URIs at the application level

🔍 How to Verify

Check if Vulnerable:

Check if authentik version is below 2024.8.5 and 2024.10.3, and review OAuth2 provider configurations for unescaped regex characters in redirect URIs.

Check Version:

Check authentik admin interface or run: docker exec authentik authentik version

Verify Fix Applied:

Confirm authentik version is 2024.8.5 or 2024.10.3, and test OAuth2 redirect URI validation with malicious patterns.

📡 Detection & Monitoring

Log Indicators:

  • Unusual redirect URI patterns in OAuth2 authorization logs
  • Authorization requests to domains with similar patterns to legitimate redirect URIs

Network Indicators:

  • OAuth2 authorization redirects to unexpected domains
  • Traffic to domains with names similar to legitimate services

SIEM Query:

source="authentik" AND (event="oauth2_authorization" OR event="redirect_uri_validation") AND uri="*.*"

🔗 References

📤 Share & Export