CVE-2021-32637

10.0 CRITICAL

📋 TL;DR

CVE-2021-32637 is an authentication bypass vulnerability in Authelia that allows attackers to bypass SSO authentication by sending malformed HTTP requests through nginx with ngx_http_auth_request_module. This affects Authelia deployments using nginx as a reverse proxy with the auth_request module. The vulnerability could allow unauthorized access to protected web applications.

💻 Affected Systems

Products:
  • Authelia
Versions: All versions before 4.29.3
Operating Systems: All platforms running Authelia
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects deployments using nginx with ngx_http_auth_request_module. Other proxy servers are theoretically affected but not officially supported except nginx.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete authentication bypass allowing unauthorized access to all protected applications behind Authelia, potentially leading to data breaches, privilege escalation, and lateral movement.

🟠

Likely Case

Unauthorized access to protected web applications, potentially exposing sensitive data and functionality to unauthenticated users.

🟢

If Mitigated

No impact if proper patching or workarounds are implemented; authentication remains enforced.

🌐 Internet-Facing: HIGH - Internet-facing Authelia deployments with nginx are directly exploitable by external attackers.
🏢 Internal Only: MEDIUM - Internal deployments are still vulnerable to internal threats or compromised internal systems.

🎯 Exploit Status

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

Exploitation requires crafting malformed HTTP requests but does not require authentication. The vulnerability is straightforward to exploit once understood.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.29.3

Vendor Advisory: https://github.com/authelia/authelia/security/advisories/GHSA-68wm-pfjf-wqp6

Restart Required: Yes

Instructions:

1. Upgrade Authelia to version 4.29.3 or later. 2. Restart Authelia service. 3. Verify the fix by testing authentication with malformed URI paths.

🔧 Temporary Workarounds

Add URI validation in nginx configuration

linux

Add a block in nginx configuration to reject requests with malformed URI paths in the internal location block

location /internal/ {
    if ($request_uri ~ "[^\x20-\x7E]+") {
        return 403;
    }
}

🧯 If You Can't Patch

  • Implement network segmentation to isolate Authelia instances from untrusted networks
  • Deploy a WAF (Web Application Firewall) with rules to detect and block malformed URI requests

🔍 How to Verify

Check if Vulnerable:

Check if running Authelia version < 4.29.3 and using nginx with ngx_http_auth_request_module. Test by sending malformed URI requests to protected endpoints.

Check Version:

authelia --version

Verify Fix Applied:

After patching, test authentication with malformed URI paths; requests should be properly authenticated or rejected. Verify version is 4.29.3 or later.

📡 Detection & Monitoring

Log Indicators:

  • Unusual authentication bypass events in Authelia logs
  • Requests with malformed URI patterns in nginx access logs
  • Successful access to protected resources without proper authentication logs

Network Indicators:

  • HTTP requests with non-ASCII or malformed URI paths to Authelia endpoints
  • Unusual traffic patterns to protected applications bypassing authentication

SIEM Query:

source="authelia.log" AND (event="authentication bypass" OR status="200" AND user="anonymous") OR source="nginx.log" AND uri MATCHES "[^\\x20-\\x7E]+"

🔗 References

📤 Share & Export