Miggo Logo

GHSA-g7f3-828f-7h7m: Authlib : JWE zip=DEF decompression bomb enables DoS

6.5

CVSS Score
3.1

Basic Information

CVE ID
-
EPSS Score
-
Published
10/10/2025
Updated
10/10/2025
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
authlibpip< 1.6.51.6.5

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in the unbounded decompression of JWE tokens that use the zip=DEF (DEFLATE) compression algorithm. The analysis of the provided patch (commit e0863d5129316b1790eee5f14cece32a03b8184d) pinpoints the exact location of the vulnerability.

The root cause is in the DeflateZipAlgorithm.decompress method within authlib/jose/rfc7518/jwe_zips.py. The original code called zlib.decompress(s, -zlib.MAX_WBITS) without imposing a limit on the size of the decompressed output. This allows a malicious actor to send a small, specially crafted JWE token that expands into a massive amount of data upon decryption and decompression, thereby exhausting system resources (CPU and memory) and causing a denial of service.

The patch addresses this by replacing the direct call to zlib.decompress with a safer mechanism using zlib.decompressobj(). It introduces a MAX_SIZE constant (set to 250 KB) and checks if the decompressed output exceeds this limit, throwing a ValueError if it does. This prevents the decompression bomb from consuming unbounded resources.

Therefore, the function DeflateZipAlgorithm.decompress is the direct vulnerable function that would appear in a runtime profile during an exploit, as it is the function performing the unsafe decompression operation.

Vulnerable functions

DeflateZipAlgorithm.decompress
authlib/jose/rfc7518/jwe_zips.py
The function `DeflateZipAlgorithm.decompress` is vulnerable to a denial-of-service attack. It uses `zlib.decompress` to decompress input data without any size limit. An attacker can craft a small, compressed payload (a 'zip bomb') that, when decompressed, expands to a very large size, consuming excessive memory and CPU resources, leading to a server crash or denial of service. The patch mitigates this by introducing a maximum size limit for the decompressed data.

WAF Protection Rules

WAF Rule

### Summ*ry _*ut*li*’s JW* `zip=***` p*t* p*r*orms un*oun*** ***L*T* ***ompr*ssion. * v*ry sm*ll *ip**rt*xt **n *xp*n* into t*ns or *un*r**s o* m****yt*s on ***rypt, *llowin* *n *tt**k*r w*o **n supply ***rypt**l* tok*ns to *x**ust m*mory *n* *PU *n*

Reasoning

T** vuln*r**ility li*s in t** un*oun*** ***ompr*ssion o* JW* tok*ns t**t us* t** `zip=***` (***L*T*) *ompr*ssion *l*orit*m. T** *n*lysis o* t** provi*** p*t** (*ommit `****************************************`) pinpoints t** *x**t lo**tion o* t** vul