CVE-2026-119205: pypdf has possible infinite loop when cloning dictionaries
pypdf before 6.21.4 can loop forever when it clones a `DictionaryObject` taken from a crafted PDF. The process that does the cloning hangs. Anyone who copies or duplicates pages or objects from untrusted PDFs with pypdf is affected. Upgrade to pypdf 6.21.4.
Published Oct 30, 2026 · Analysis Oct 31, 2026
What an attacker can do
Cloning a DictionaryObject walks the objects it references. The 6.21.4 release notes say the fix is "loop detection when cloning DictionaryObject" (pull request 4288). A crafted file with self-referencing or cyclic dictionaries defeats the old loop detection, so the clone never finishes (CWE-835). That cyclic structure is my reading of the fix title, not something the advisory spells out.
Cloning happens when you copy pages into a writer, merge files or duplicate objects. An attacker who can get a PDF into such a workflow can freeze the worker with one file. The impact is availability only: no code execution and no data theft. A merge or split service with few workers can be stalled by a handful of requests.
Who is affected
All pypdf releases below 6.21.4 are affected, when your code clones or duplicates a DictionaryObject. Check the installed version with:
pip show pypdfSearch your code for PdfWriter page-copy and merge calls to see where untrusted files reach cloning.
pypdf
- Ecosystem
- PyPI
- Affected
- < 6.21.4
- Fixed in
- 6.21.4
- Check
pip show pypdf
How to fix it
Upgrade to pypdf 6.21.4:
pip install --upgrade "pypdf>=6.21.4"If you cannot upgrade yet, the maintainers point to the changes in pull request 4288. Run merge and copy jobs with a hard timeout so a stuck job is killed.
How to tell if you were hit
Look for merge or page-copy jobs that never finish, workers stuck at full CPU, and timeouts tied to particular input PDFs. Save those files for analysis. The advisory gives no log signature, and no source reports 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 an infinite loop. This requires cloning/duplicating a DictionaryObject.
Patches
This has been fixed in pypdf==6.21.4.
Workarounds
If you cannot upgrade yet, consider applying the changes from PR #4288.
Credited to smaeljaish771, KeenSecurityLab.
Questions
- Who found CVE-2026-119205?
The advisory credits smaeljaish771 and KeenSecurityLab.
- Does CVE-2026-119205 affect reading a PDF without copying it?
The advisory says the flaw needs cloning or duplicating a
DictionaryObject. Code that only reads text from a file may not reach it, but upgrade anyway.- What is the severity?
The advisory rates it high, CVSS 4.0 score 7.1, driven by availability impact. It is reachable over the network with passive user interaction.
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 entriesCVE-2026-119203
pypdf has possible infinite loop when hitting EOF in standard xref table during trailer search
high7.1Oct 30, 2026CVE-2026-119204
pypdf has possible large memory usage when parsing page tree
high7.1Oct 30, 2026CVE-2026-119206
pypdf has possible long runtimes when retrieving page labels
high7.1Oct 30, 2026CVE-2026-119207
pypdf has possible large memory usage for exceptions in strict mode
high7.1Oct 30, 2026CVE-2026-119208
pypdf has possible long runtimes/large memory usage for encrypted PDF files
high7.1Oct 30, 2026CVE-2026-119209
pypdf has possible large memory usage when parsing cross-reference streams
high7.1Oct 30, 2026
