CVE-2021-44878

7.5 HIGH

📋 TL;DR

CVE-2021-44878 is an authentication bypass vulnerability in pac4j OpenID Connect implementation. It allows attackers to forge unsigned ID tokens using the 'none' algorithm, bypassing signature validation. This affects pac4j v5.3.0 and earlier when using OpenID Connect with providers that support the 'none' algorithm.

💻 Affected Systems

Products:
  • pac4j
Versions: v5.3.0 and prior versions
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects configurations using OpenID Connect with providers that support 'none' algorithm. The 'idtoken' response type is particularly vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete authentication bypass allowing unauthorized access to protected resources and user impersonation.

🟠

Likely Case

Authentication bypass leading to unauthorized access to applications using pac4j for OpenID Connect authentication.

🟢

If Mitigated

No impact if proper signature validation is enforced and 'none' algorithm is explicitly rejected.

🌐 Internet-Facing: HIGH - Web applications using pac4j for authentication are directly exposed to this attack.
🏢 Internal Only: MEDIUM - Internal applications are still vulnerable but attack surface is reduced.

🎯 Exploit Status

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

Attack requires ability to intercept or modify authentication flow. Proof-of-concept code is available in security advisories.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v5.3.1 and later

Vendor Advisory: https://www.pac4j.org/blog/cve_2021_44878_is_this_serious.html

Restart Required: Yes

Instructions:

1. Update pac4j to version 5.3.1 or later. 2. Update dependencies in your project configuration. 3. Restart the application. 4. Verify the fix by testing authentication flows.

🔧 Temporary Workarounds

Explicitly reject 'none' algorithm

all

Configure pac4j to explicitly reject the 'none' algorithm in OpenID Connect configuration

Configure 'none' algorithm as not allowed in OpenID client configuration

Use only trusted OpenID providers

all

Configure pac4j to only accept tokens from providers that don't support 'none' algorithm

Restrict allowed OpenID providers in configuration

🧯 If You Can't Patch

  • Implement additional token validation layer that rejects 'none' algorithm tokens
  • Monitor authentication logs for suspicious 'none' algorithm usage and implement WAF rules to block such tokens

🔍 How to Verify

Check if Vulnerable:

Check if using pac4j version 5.3.0 or earlier with OpenID Connect. Test by attempting to authenticate with a token using 'alg': 'none' in header.

Check Version:

Check project dependencies or Maven/Gradle configuration for pac4j version

Verify Fix Applied:

After updating to 5.3.1+, test authentication with 'none' algorithm token - it should be rejected. Verify configuration explicitly rejects 'none' algorithm.

📡 Detection & Monitoring

Log Indicators:

  • Authentication attempts with 'alg': 'none' in token headers
  • Failed token validation logs
  • Unexpected successful authentications

Network Indicators:

  • Authentication requests with malformed tokens
  • Traffic patterns showing authentication bypass

SIEM Query:

search 'alg":"none' OR 'authentication bypass' OR 'token validation failed' in application logs

🔗 References

📤 Share & Export