NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · PyPI

CVE-2026-119207: pypdf has possible large memory usage for exceptions in strict mode

highCVSS 4.0 7.1GHSA-4vqv-7265-gm2w

In pypdf before 6.21.3, loading an invalid dictionary from a crafted PDF can produce very large exception output and memory use in strict mode. A small file can exhaust memory in the parsing process. Upgrade to pypdf 6.21.3.

Published Oct 30, 2026 · Analysis Oct 31, 2026

What an attacker can do

The advisory title points at exceptions in strict mode, and the trigger is loading an invalid dictionary. The 6.21.3 release notes list a change that reduces excessive error message output (pull request 4265). Together they suggest the error message grows with the malformed input, so memory use is out of proportion to the file size (CWE-400, CWE-405). That link between the notes and this advisory is my inference. The advisory does not state it.

Strict mode makes pypdf raise on malformed content instead of recovering, and applications often enable it to reject bad files. That choice is what exposes them: the rejection path itself becomes the cost.

The attacker needs only to submit a PDF to code that parses it. The CVSS 4.0 vector shows no privileges, passive user interaction and high availability impact. The outcome is a worker that bloats or is killed by the out-of-memory handler. There is no code execution or data exposure in the advisory.

Who is affected

All pypdf releases below 6.21.3, when a PDF with an invalid dictionary is loaded. The advisory ties the memory growth to strict mode. Check the installed version with:

pip show pypdf

Search your code for strict=True on PdfReader to find the exposed paths.

pypdf

Ecosystem
PyPI
Affected
< 6.21.3
Fixed in
6.21.3
Check
pip show pypdf

How to fix it

Upgrade to pypdf 6.21.3:

pip install --upgrade "pypdf>=6.21.3"

Without upgrading, the maintainers point to the changes in pull request 4265. As a stopgap, cap worker memory with container or ulimit limits and limit upload size.

How to tell if you were hit

Watch for pypdf workers whose memory spikes on a single document, out-of-memory kills, and logs with unusually long exception messages from PDF parsing. Keep the triggering files. The advisory names no other indicator and reports no exploitation.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

An attacker who uses this vulnerability can craft a PDF which leads to large memory usage. This requires loading an invalid dictionary.

Patches

This has been fixed in pypdf==6.21.3.

Workarounds

If you cannot upgrade yet, consider applying the changes from PR #4265.

Questions

Is only strict mode affected by CVE-2026-119207?

The advisory title names exceptions in strict mode. The stated trigger is loading an invalid dictionary. Upgrade regardless of your mode.

What fixes it?

pypdf 6.21.3, which the release notes say reduces excessive error message output.

Does it give code execution?

No. The advisory describes large memory usage only.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More PyPI vulnerabilities

All PyPI entries