CVE-2026-102997: pypdf Long Runtime Vulnerability Due to Malformed FlateDecode Streams

pypdf Updated 01 Oct 2026

Summary

01/10/2026
Yes i
High
8.7

CVE-2026-102997: pypdf: Possible long runtimes for partially malformed FlateDecode streams (Follow-up). Affects pypdf versions < 6.18.1. Fixed in 6.18.1. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

pypdf is a popular Python library used for manipulating PDF files. It provides functionalities such as reading, merging, and modifying PDF documents. However, like many libraries that handle external data formats, pypdf is susceptible to vulnerabilities that can be exploited through specially crafted inputs. This specific vulnerability arises from the handling of FlateDecode streams, which are used for compressing data in PDF files.

Vulnerability Detail

The vulnerability allows an attacker to create a PDF file with a partially malformed FlateDecode stream. When this PDF is processed, it can lead to excessively long runtimes due to the byte-by-byte decompression method employed by pypdf. This can result in denial of service as the application may hang or become unresponsive while attempting to process the malformed stream.

How To Fix

Latest published version: 6.21.2 as of 22 Oct 2026

pip install --upgrade "pypdf==6.21.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.18.1

This is the first release that contains the fix.

pip install --upgrade "pypdf==6.18.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you are unable to upgrade to the patched version immediately, you can apply the changes from PR #4073 on GitHub. This involves modifying the decompression logic to handle malformed streams more gracefully, thus mitigating the impact of this vulnerability.

Conclusion

In summary, the vulnerability identified as CVE-2026-102997 in the pypdf library can lead to long runtimes when processing malformed FlateDecode streams. It is crucial to update to version 6.18.1 or later to mitigate this risk. For those unable to upgrade immediately, applying the changes from PR #4073 can serve as a temporary workaround.

See every vulnerability recorded for pypdf →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 8.7, indicating a high severity level.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The main consequence is a denial of service, where the application may hang or become unresponsive when processing a specially crafted PDF.

Yes, you can apply the changes from PR #4073 on GitHub as a temporary workaround until you can upgrade.

FlateDecode is a compression method used in PDFs to reduce file size. It is essential for efficient storage and transmission of PDF documents.

Related vulnerabilities

Recent vulnerabilities recorded for pypdf.

How To Fix

Latest published version: 6.21.2 as of 22 Oct 2026

pip install --upgrade "pypdf==6.21.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.18.1

This is the first release that contains the fix.

pip install --upgrade "pypdf==6.18.1"

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