CVE-2026-102997: pypdf denial of service in FlateDecode decompression

CVE-2026-102997 · Severity: high · CVSS 4 · Published 2026-09-30

pypdf is a Python library for reading and manipulating PDF files. A specially crafted PDF with a malformed compression stream can force the library into slow byte-by-byte decompression, consuming excessive CPU and causing application hangs or unavailability. The vulnerability affects versions before 6.18.1.

Technologies: Py-Pdf Pypdf, pypdf (PyPI). Vendors: Py-Pdf, PyPI.

Quick answers

Is CVE-2026-102997 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-102997 being exploited in the wild.
How severe is CVE-2026-102997?
High severity, with a CVSS score of 4, published 30 September 2026.
Which products and versions are affected?
Py-Pdf Pypdf before 6.18.1; pypdf (PyPI) < 6.18.1, ECOSYSTEM:introduced=0,fixed=6.18.1.
Is there a fix for CVE-2026-102997?
Yes. pypdf (PyPI): upgrade to 6.18.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-102997 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-102997?
Check whether you run Py-Pdf Pypdf or pypdf (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • pypdf (PyPI): upgrade to 6.18.1 or later
    pip install "pypdf>=6.18.1"

Technical details

A partially malformed /FlateDecode stream with padded data bypasses the recovery counter mechanism in pypdf/filters.py, triggering inefficient byte-by-byte decompression instead of the normal fast path. The counter fails to advance for bytes that successfully decode, allowing an attacker to craft a malicious PDF that triggers long runtimes. This is fixed in version 6.18.1 by further restricting when the FlateDecode recovery mechanism is invoked.

Affected products

  • py-pdf pypdf before 6.18.1

Identifiers

  • CVE-2026-102997
  • GHSA-jw7q-gvrg-4vj3
  • PYSEC-2026-4156

Timeline

  • 2026-09-30: disclosed
  • 2026-09-11: patched: Fix merged in version 6.18.1

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.