CVE-2025-62706: Authlib Denial of Service Vulnerability via JWE zip=DEF Decompression Bomb
Summary
CVE-2025-62706: Authlib : JWE zip=DEF decompression bomb enables DoS. Affects authlib versions < 1.6.5. Fixed in 1.6.5. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Authlib is a popular Python library that provides a comprehensive suite of tools for building OAuth and OpenID Connect clients and servers. It is widely used for handling JSON Web Tokens (JWT) and other security-related functionalities. The library's JOSE (JavaScript Object Signing and Encryption) module supports various encryption and compression methods, including DEFLATE compression for JSON Web Encryption (JWE). However, a vulnerability exists in the way Authlib handles DEFLATE decompression, specifically when the 'zip=DEF' header is present, making it susceptible to denial of service attacks.
Vulnerability Detail
Authlib's JWE zip=DEF path performs unbounded DEFLATE decompression, allowing a small ciphertext to expand into a significantly larger plaintext during decryption. This can lead to memory and CPU exhaustion, causing denial of service. The vulnerability arises from the lack of a maximum output limit in the decompression method, which can be exploited by an attacker to craft a tiny ciphertext that inflates to a large size, consuming system resources. The affected code is located in the 'authlib/authlib/jose/rfc7518/jwe_zips.py' file, where the 'DeflateZipAlgorithm.decompress' method calls 'zlib.decompress' without any restrictions on output size.
How To Fix
Latest published version: 1.9.1 as of 23 Oct 2026
pip install --upgrade "authlib==1.9.1"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.6.5
This is the first release that contains the fix.
pip install --upgrade "authlib==1.6.5"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can reject or strip 'zip=DEF' from inbound JWEs at the application boundary until a fix is applied. Additionally, you can implement a bounded decompression guard by modifying the decompression method to include a maximum output size limit. For example, you can use the following code snippet:
import zlib
def bounded_decompress(data, max_length):
decompressed_data = zlib.decompress(data, -zlib.MAX_WBITS)
if len(decompressed_data) > max_length:
raise ValueError('Decompressed data exceeds maximum length')
return decompressed_data
This function checks the length of the decompressed data and raises an error if it exceeds the specified maximum length.
Conclusion
The Authlib library has a vulnerability that allows for denial of service through unbounded DEFLATE decompression when handling JWE tokens with the 'zip=DEF' header. It is crucial to update to the patched version 1.6.5 or later to mitigate this risk. In the meantime, implementing workarounds can help protect your application from potential attacks.
See every vulnerability recorded for authlib →
FAQ
The CVSS score of this vulnerability is 6.5, indicating a medium severity level.
Any service using Authlib to decrypt JWE tokens with 'zip=DEF' and where an attacker can submit tokens for decryption is affected.
The primary impact is denial of service due to memory and CPU exhaustion during the decryption of maliciously crafted JWE tokens.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If you cannot update Authlib right away, implement the suggested workaround to reject or strip 'zip=DEF' from inbound JWEs.
References
Related vulnerabilities
Recent vulnerabilities recorded for authlib.