PYSEC-2026-1202: Authlib : JWE zip=DEF decompression bomb enables DoS

Published Oct 22, 2025
·
Updated

Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to version 1.6.5, Authlib’s JWE zip=DEF path performs unbounded DEFLATE decompression. A very small ciphertext can expand into tens or hundreds of megabytes on decrypt, allowing an attacker who can supply decryptable tokens to exhaust memory and CPU and cause denial of service. This issue has been patched in version 1.6.5. Workarounds for this issue involve rejecting or stripping zip=DEF for inbound JWEs at the application boundary, forking and add a bounded decompression guard via decompressobj().decompress(data, MAXSIZE)) and returning an error when output exceeds a safe limit, or enforcing strict maximum token sizes and fail fast on oversized inputs; combine with rate limiting.

Affected Software

1 affected component
pypi/authlib<1.6.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Authlib to a version that resolves this vulnerability.

    Fixed in 1.6.5
  2. Compensating control

    At the application boundary, reject or strip zip=DEF from inbound JWEs.

  3. Compensating control

    Fork Authlib and add a bounded decompression guard using decompressobj().decompress(data, MAX_SIZE), returning an error when decompressed output exceeds a safe limit.

  4. Compensating control

    Enforce strict maximum token sizes, fail fast on oversized inputs, and combine this control with rate limiting.

Event History

Oct 22, 2025
CVE Published
via OSV·09:31 PM
Data Sourced
via OSV·09:31 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who can exploit this issue?

An attacker must be able to supply decryptable JWE tokens to an application using an affected Authlib version. They can use a small ciphertext with zip=DEF that expands during decryption and exhausts memory and CPU.

2

Are applications affected by default?

The issue is in the inbound JWE zip=DEF decompression path. Exposure depends on whether the application accepts and decrypts attacker-supplied JWEs that use zip=DEF.

3

What can be done before upgrading?

Reject or remove zip=DEF from inbound JWEs at the application boundary. Alternatively, add bounded decompression with a safe maximum output size, enforce strict token-size limits with early rejection, and apply rate limiting.

4

What version contains the fix?

Authlib version 1.6.5 patches the unbounded DEFLATE decompression issue.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203