CVE-2025-61920·Python vulnerability
Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to version 1.6.5, Authlib’s JOSE implementation accepts unbounded JWS/JWT header and signature segments. A remote attacker can craft a token whose base64url‑encoded header or signature spans hundreds of megabytes. During verification, Authlib decodes and parses the full input before it is rejected, driving CPU and memory consumption to hostile levels and enabling denial of service. Version 1.6.5 patches the issue. Some temporary workarounds are available. Enforce input size limits before handing tokens to Authlib and/or use application-level throttling to reduce amplification risk.
- Severity
- high
- Software
- Python
- Fixed in
- 1.6.5
- Published
- 2025-10-10
Affected versions
Until: 1.6.5
Fixed in: 1.6.5
How to fix this CVE
Update Authlib to version 1.6.5 or later to fix a denial-of-service vulnerability in the JOSE implementation that allows oversized JWT headers and signatures to consume excessive CPU and memory. If immediate patching is not possible, implement input size validation on JWT tokens before they reach your application and deploy rate limiting to reduce amplification risk.
sudo dnf update python3-authlibDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST|GET.*\/(oauth|openid|token|authorize) HTTP.*; Slow request body transmission; Oversized Authorization header (>1MB); Base64-encoded payload with repetitive padding patterns spanning multiple seconds to decodeWAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Implement JWT token size limits at the WAF level: reject requests with Authorization headers or request bodies exceeding 64KB; enforce connection timeouts on slow-reading clients to prevent algorithmic complexity attacks on base64 decodingHow to check if you are affected
- Step 1: Check Authlib version installed: pip show authlib | grep Version
- Step 2: Verify JOSE functionality is in use: grep -r 'authlib.jose\|from authlib.jose' /path/to/your/app --include='*.py'
- Step 3: Search application logs for JWT processing errors or timeouts: grep -i 'jwt\|jws\|timeout\|memory' /var/log/application.log | tail -100
- Step 4: Confirm patch applied by verifying Authlib version >= 1.6.5: python3 -c 'import authlib; print(authlib.__version__)'
FAQ
What is CVE-2025-61920?
A denial-of-service vulnerability in Authlib's JOSE implementation that accepts unbounded JWT/JWS header and signature segments, allowing attackers to craft massive tokens that exhaust server resources during verification.
Is CVE-2025-61920 being actively exploited?
No, this vulnerability is not listed on the CISA KEV catalog and no public exploits are currently available, but the attack surface is significant for any service accepting untrusted JWT tokens.
What versions of Authlib are affected by CVE-2025-61920?
All versions prior to 1.6.5 are vulnerable; version 1.6.5 and later include the fix.
How do I check if my server is vulnerable to CVE-2025-61920?
Run: pip show authlib | grep Version. If the version is below 1.6.5, your installation is vulnerable.
Does Defensia detect CVE-2025-61920?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Authlib is installed on a monitored server, CVE-2025-61920 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2025-61920. Free for 1 server.
Get started free