CVE-2025-62706

6.5 MEDIUM

📋 TL;DR

CVE-2025-62706 is a denial-of-service vulnerability in Authlib's JWE implementation where DEFLATE decompression lacks size limits. Attackers can send specially crafted tokens that cause excessive memory and CPU consumption when decrypted, potentially crashing affected services. This affects any system using Authlib versions before 1.6.5 for JWE token processing.

💻 Affected Systems

Products:
  • Authlib
Versions: All versions prior to 1.6.5
Operating Systems: All platforms running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems using Authlib's JWE functionality with zip=DEF parameter. Systems not using JWE or using other compression methods are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service unavailability due to memory exhaustion and CPU saturation, potentially affecting multiple services in shared environments.

🟠

Likely Case

Service degradation or temporary outages for affected endpoints, requiring restarts and causing user disruption.

🟢

If Mitigated

Minimal impact with proper input validation and rate limiting; failed token processing with error logging.

🌐 Internet-Facing: HIGH - Attackers can exploit this remotely by sending malicious tokens to public endpoints.
🏢 Internal Only: MEDIUM - Internal attackers or compromised systems could still exploit this, but attack surface is reduced.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires ability to supply decryptable tokens to the target system. Attack complexity is moderate as it requires understanding of JWE token structure and compression.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.6.5

Vendor Advisory: https://github.com/authlib/authlib/security/advisories/GHSA-g7f3-828f-7h7m

Restart Required: No

Instructions:

1. Update Authlib to version 1.6.5 or later using pip: 'pip install --upgrade authlib>=1.6.5'. 2. Verify the update completed successfully. 3. No restart required as this is a library update.

🔧 Temporary Workarounds

Reject zip=DEF tokens

all

Configure application to reject or strip zip=DEF parameter from inbound JWEs at the application boundary.

Implement bounded decompression

all

Fork and modify Authlib to add size limits to DEFLATE decompression using decompressobj().decompress(data, MAX_SIZE).

Enforce token size limits

all

Implement strict maximum token sizes and fail fast on oversized inputs, combined with rate limiting.

🧯 If You Can't Patch

  • Implement WAF rules to block or limit JWE tokens with zip=DEF parameter
  • Deploy rate limiting and input validation at the application perimeter

🔍 How to Verify

Check if Vulnerable:

Check Authlib version: 'python -c "import authlib; print(authlib.__version__)"' and verify it's below 1.6.5.

Check Version:

python -c "import authlib; print(authlib.__version__)"

Verify Fix Applied:

Verify version is 1.6.5 or higher using the same command, and test JWE token processing with zip=DEF to ensure proper error handling.

📡 Detection & Monitoring

Log Indicators:

  • High memory usage spikes
  • Process crashes or restarts
  • Error logs related to JWE decompression failures
  • Unusually large token processing times

Network Indicators:

  • High volume of JWE tokens to authentication endpoints
  • Repeated token submission patterns

SIEM Query:

source=application_logs AND ("JWE" OR "zip=DEF") AND ("memory" OR "crash" OR "timeout")

🔗 References

📤 Share & Export