The vulnerability, identified as CVE-2026-39373, is a decompression bomb attack in the jwcrypto library. The root cause is the lack of validation on the size of the decompressed data when processing a JWE token with zip compression. The previous mitigation only checked the size of the compressed data, which is insufficient to prevent an attacker from crafting a small, highly-compressed payload that exhausts system memory upon decompression.
The analysis of the patch between versions 1.5.6 and 1.5.7 reveals the exact location of the vulnerability. The fixing commit 25db861d8b29434838669a94a843af03d29ea6ed modifies the jwcrypto/jwe.py file.
The core of the vulnerability lies within the JWE._decrypt method. In the vulnerable version, this method used zlib.decompress to decompress the payload in a single operation, without any limits on the resulting data size. The patch replaces this with zlib.decompressobj, which allows for controlled, incremental decompression and enforces a maximum size for the plaintext output (max_plaintext).
The public-facing JWE.decrypt method was also modified to accept the max_plaintext parameter, allowing developers to specify a safe limit for their applications. This parameter is then passed down to the _decrypt method. During exploitation, a call to JWE.deserialize with a malicious token and a key would trigger JWE.decrypt and subsequently the vulnerable JWE._decrypt method, leading to excessive memory allocation.