Authlib
CVE-2025-61920
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify Authlib JWS/JWT verification endpoint
-
DeliveryCraft token with oversized header/signature segment
-
ExploitSubmit token to unauthenticated endpoint
-
ExecutionAuthlib decodes and parses full buffer
-
ImpactCPU and memory exhausted, service denied
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | No special configuration is required beyond the target application using Authlib (≤ 1.6.3, and up to < 1.6.5) to verify attacker-supplied JWS/JWT tokens - i.e. any OAuth/OIDC flow, token introspection, or JWT authentication path that calls Authlib's JOSE deserialize_compact / extract_segment routines on untrusted input. Exploitation is remote and unauthenticated (CVSS PR:N, confirmed by vector), needs no user interaction, and succeeds against default configurations because pre-1.6.5 code imposed no size bound. The primary LIMITING factor is deployment of a size guard outside Authlib: if a proxy/WAF or application layer already rejects oversized token inputs (a few KB) before they reach Authlib, or rate-limits the verification endpoint, the amplification is neutralized. Impact is availability-only; no authentication bypass or data disclosure results. |
| Impact | This is a genuine but bounded availability-only risk. All signals align coherently: the CVSS v3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, 7.5) describes a remote, low-complexity, unauthenticated attack with no user interaction that impacts only availability (C:N/I:N - no data exposure or integrity loss). The GitHub-issued advisory and commit confirm the root cause (unbounded JOSE header/signature segments, CWE-20) and a vendor fix in 1.6.5, and publicly available exploit code (the GHSA PoC jws_segment_dos_demo.py) lowers the barrier to opportunistic abuse. No EPSS score and no SSVC decision data were provided in the input, and the CVE is NOT listed in CISA KEV, so there is no evidence of active real-world exploitation - the threat is a publicly demonstrated DoS, not confirmed in-the-wild attacks. The practical priority is moderate: exploitation is easy and unauthenticated against any endpoint that verifies attacker-supplied JWS/JWT, but impact is confined to resource exhaustion (the advisory measured ~4 GB RSS and ~9 s CPU for a 500 MB header), and several effective mitigations exist (upstream patch, proxy/WAF input-size limits, rate limiting). Prioritize patching on internet-facing OAuth/OIDC token-verification services; de-prioritize where tokens are already size-capped upstream. |
| Exploit ScenarioDerived | An unauthenticated remote attacker sends a single crafted JWS/JWT to any Authlib-backed OAuth/OIDC verification endpoint, with the base64url header or signature segment inflated to hundreds of megabytes. Authlib fully base64-decodes and parses the oversized buffer before rejecting it, spiking CPU and RAM (~4 GB RSS, ~9 s CPU for a 500 MB header per the advisory) and exhausting service capacity. Publicly available PoC exploit code (jws_segment_dos_demo.py) exists, making the attack trivially reproducible. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Authlib's JOSE/JWS verification path (through 1.6.4, with 1.6.5 as the fix) decodes attacker-supplied JWT/JWS header and signature segments without any size bound, so a single malicious token with a hundreds-of-megabytes base64url segment can exhaust CPU and memory and knock an OAuth/OIDC or JWT-authenticating service offline. Any application that hands untrusted tokens to Authlib's deserialize_compact / extract_segment routines is exposed, with no authentication or user interaction needed. Publicly available exploit code exists (the advisory ships a working PoC that consumed ~4 GB RSS and ~9 s CPU on a 500 MB header), and the risk is real but bounded: it is availability-only, and it disappears if a proxy, WAF, or application layer rejects oversized tokens before Authlib sees them.
RemediationAI
Vendor-released patch: upgrade Authlib to 1.6.5 or later (pip install --upgrade 'authlib>=1.6.5'), which applies the upstream commit 867e3f87b072347a1ae9cf6983cc8bbf88447e5e adding a 256 KB MAX_CONTENT_LENGTH and per-segment header/signature length checks that raise ValueError before any decoding occurs; Debian LTS users should apply the fixed package from https://lists.debian.org/debian-lts-announce/2025/10/msg00032.html, and details are in advisory GHSA-pq5p-34cr-23v9. If immediate upgrade is not possible, the effective compensating control is a hard input-size limit enforced outside Authlib: configure the reverse proxy or WAF to reject request bodies, Authorization headers, or token form parameters larger than a few kilobytes (real-world JWTs are typically 1-4 KB, so a 16 KB cap is safe) - the trade-off is that you must audit legitimate token sizes first and remember this guard must be applied to every path that receives tokens (introspection endpoints, callback URLs, websocket auth); alternatively wrap token verification in application code that checks len(token) before calling deserialize_compact, and add per-client rate limiting or throttling on verification endpoints to cap the amplification an attacker can achieve, accepting that throttling only reduces rather than eliminates the DoS potential.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Authlib is a widely used Python library for building OAuth 2.x and OpenID Connect clients, servers, and resource servers. Its authlib/jose module implements the JOSE standards: RFC 7515 (JSON Web Signature) and RFC 7519 (JWT), where compact serialization takes the form base64url(header).base64url(payload).base64url(signature). The root cause is CWE-20, improper input validation: before version 1.6.5, JsonWebSignature.deserialize_compact and the helper functions in authlib/jose/util.py (extract_segment/extract_header) passed the raw dotted string straight into base64url decoding and JSON parsing without checking segment length. Because base64 decoding and JSON parsing are linear in input size and Python allocates the decoded buffer plus parsed structures, a token with a 500 MB header forces both an enormous allocation and seconds of CPU work before signature verification can even fail. The upstream fix (commit 867e3f87) introduces a MAX_CONTENT_LENGTH of 256000 bytes plus explicit 256 KB checks on each header/signature segment, raising ValueError('Serialization is too long') early, and adds regression tests covering oversized header, payload, and signature segments. Note that the vulnerable JOSE code is used not only by direct library consumers but is also reachable through higher-level OAuth/OIDC and JWT-validation calls, so the attack surface is any endpoint that processes a token string.
Know when Authlib gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Remote unauthenticated token submission with no UI (AV:N/AC:L/PR:N/UI:N); only resource exhaustion occurs, so C:N/I:N/A:H and scope unchanged.
Primary rating from Vendor (github).
CVSS VectorVendor: github
DescriptionCVE.org
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.
Blast Radius
ecosystem impact- 23 pypi packages depend on authlib (21 direct, 2 indirect)
Ecosystem-wide dependent count for version 1.6.5.
Executive ViewAI
A high-severity availability flaw in Authlib, the Python library used by many of our OAuth/OIDC and JWT-validating services, allows a single specially crafted token to consume gigabytes of memory and seconds of CPU, potentially taking a token-verifying service offline. Any internet-facing login, API gateway, or identity component that accepts untrusted tokens and passes them to Authlib is in scope, meaning customer-facing authentication and single sign-on availability could be disrupted without any credentials or user interaction. Public exploit code exists, so the barrier to attempting this denial-of-service is low, though the impact is limited to service availability rather than data exposure or compromise.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Affected Products (CPE)CVE.org
Authlib is a Python library which builds OAuth and OpenID Connect servers. [CVSS 5.7 MEDIUM]
Authentication bypass in Authlib (Python OAuth/OpenID Connect library) versions 1.6.5 through 1.6.6 allows remote attack
Authlib is a Python library which builds OAuth and OpenID Connect servers. Rated high severity (CVSS 7.5), this vulnerab
lepture Authlib before 1.3.1 has algorithm confusion with asymmetric public keys. Rated high severity (CVSS 7.5), this v
Unbounded DEFLATE decompression in Authlib's JWE zip=DEF handling (authlib/jose/rfc7518/jwe_zips.py) lets a small, valid
Signature verification bypass in Authlib 1.7.2 and earlier allows unauthenticated remote attackers to have crafted JWS J
Poisoned OAuth/OIDC discovery metadata in Authlib 1.7.2 and earlier allows an attacker who controls or intercepts the me
Authentication bypass in the joserfc Python library before 1.7.4 lets remote, unauthenticated attackers submit a JWS Gen
Token forgery in the Authlib Python library before 1.9.1 lets a remote, unauthenticated attacker mint HS256, HS384 or HS
Authentication bypass in Authlib's deprecated-but-still-shipped authlib.jose module (1.3.1 through 1.8.0, fixed in 1.9.0
Authlib's default RFC 7523 JWT bearer grant, in all releases prior to 1.9.0, fails to bind an incoming JWT assertion to
Server-side request forgery in Authlib's RFC 9101 JWTAuthenticationRequest (JAR) extension lets unauthenticated remote a
NVD
CVE.org
EPSS
GitHub
Exploit-DB