CVE-2026-113786: pypdf Arbitrary Image Parser Invocation via Unvalidated JPEG Data

pypdf Updated 22 Oct 2026

Summary

21/10/2026
Yes i
Low
2.3

CVE-2026-113786: pypdf: Unvalidated JPEG image data loading. Affects pypdf versions < 6.21.1. Fixed in 6.21.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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

pypdf is a Python library that allows users to manipulate PDF files, including reading, writing, and modifying PDF content. It is widely used for tasks such as merging documents, extracting text, and adding images. However, the library has a vulnerability that can lead to arbitrary image parsers being invoked when handling JPEG data, particularly when the optional Pillow dependency is not installed.

Vulnerability Detail

The vulnerability arises from the way pypdf processes JPEG images using the /DCTDecode filter. An attacker can craft a malicious PDF that exploits this flaw, potentially leading to arbitrary code execution or other unintended consequences. This vulnerability is particularly concerning for users who do not have the Pillow library installed, as they may be more susceptible to exploitation. The technical aspects involve the improper validation of image data, which allows for the invocation of arbitrary image parsers.

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.21.1

This is the first release that contains the fix.

pip install --upgrade "pypdf==6.21.1"

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

Workaround

If you cannot upgrade to the patched version immediately, consider applying the changes from pull request #4222 on GitHub. This involves modifying the image loading logic to ensure that only validated JPEG data is processed.

Conclusion

The pypdf library has a vulnerability that allows for arbitrary image parser invocation through unvalidated JPEG data. Users are advised to upgrade to version 6.21.1 or later to mitigate this risk. If an upgrade is not feasible, applying the changes from the relevant pull request can serve as a temporary workaround.

See every vulnerability recorded for pypdf →

Share this vulnerability

FAQ

An attacker can exploit this vulnerability to invoke arbitrary image parsers, potentially leading to code execution or other security issues.

Users of pypdf who do not have the optional Pillow dependency installed are particularly at risk.

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

If an upgrade is not possible, consider applying the changes from pull request #4222 to mitigate the risk.

The CVSS score for this vulnerability is 2.3, indicating a low severity level.

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.21.1

This is the first release that contains the fix.

pip install --upgrade "pypdf==6.21.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