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

CVE-2026-119203: pypdf has possible infinite loop when hitting EOF in standard xref table during trailer search

highCVSS 4.0 7.1GHSA-5849-834g-hvw5

pypdf before 6.21.4 can loop forever when it reads a truncated PDF that has a standard xref table but no `trailer`. A crafted file hangs the Python process that opens it. Anyone who parses 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

When pypdf opens a PDF, it reads the cross-reference (xref) table and then looks for the trailer dictionary. If the file ends before a trailer appears, the search for the trailer in a standard xref table never sees an end-of-file condition and never exits (CWE-835). The fix in pull request 4289 is titled "Detect EOF when reading standard xref table trailer".

The attacker only needs to get an incomplete PDF in front of your code. That means an upload form, a mail attachment pipeline, a document indexer or an RAG ingestion job. The CVSS 4.0 vector marks user interaction as passive and the impact as availability only. There is no code execution and no data leak. The result is a worker stuck at 100% CPU. In a synchronous web handler or a small worker pool, a few such files can stall the whole service.

Who is affected

All pypdf releases below 6.21.4 are affected. The trigger is opening a file that has a standard xref table and lacks a trailer. Check your version with:

pip show pypdf

Also check lockfiles and container images, since pypdf is often pulled in indirectly by other libraries.

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 suggest applying the changes from pull request 4289 to your installed copy. As a general safeguard, parse untrusted PDFs in a subprocess with a CPU or wall-clock timeout so one bad file cannot hang the service.

How to tell if you were hit

Look for pypdf worker processes pinned at full CPU with no progress, and for requests or jobs that time out only on specific uploaded PDFs. Collect the stuck input files and check whether they end without a trailer keyword after the xref table. The advisory gives no log line or network indicator, and it does not report exploitation in the wild.

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 opening an incomplete file without a trailer.

Patches

This has been fixed in pypdf==6.21.4.

Workarounds

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

Credited to smaeljaish771.

Questions

Does CVE-2026-119203 allow code execution in pypdf?

No. The advisory describes an infinite loop only. The CVSS 4.0 vector rates availability impact high and confidentiality and integrity impact none.

Which pypdf version fixes CVE-2026-119203?

pypdf 6.21.4, released on 28 October 2026. Every earlier version is listed as vulnerable.

Is CVE-2026-119203 exploited in the wild?

No source reports exploitation. It is not in CISA's KEV catalog, and its EPSS score is 0.003.

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