CVE-2025-62706: Authlib Denial of Service Vulnerability via JWE zip=DEF Decompression Bomb

authlib Updated 07 Jul 2026

Summary

07/07/2026
Yes i
Medium
6.5

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for authlib.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback