CVE-2026-119203

pypdf: Possible infinite loop when hitting EOF in standard xref table during trailer search

Published Oct 29, 2026 CVSS 4.0 · 7.1 High EPSS < 1% KEV · Not listed
Description
pypdf is a free and open-source pure-python PDF library. Prior to 6.21.4, pypdf can enter an infinite loop while opening a crafted incomplete PDF whose standard cross-reference table reaches the end of the file without a trailer. The trailer search can repeatedly rewind to the same stream position instead of terminating when parsing makes no progress, blocking the processing thread. This issue is fixed in version 6.21.4.

Analysis

AI-generated

Technical impact

pypdf, a popular pure‑Python PDF library, contains a flaw that can cause the parser to enter an infinite loop while searching for the trailer of a PDF that ends its cross‑reference table at EOF. This loop repeatedly rewinds to the same stream position and never terminates, leaving the thread that processes the PDF blocked and consuming CPU resources. The weakness is classified as CWE‑835, an improper termination of a loop or iteration, and the result is a denial of service, not a code‑execution or data‑leak vulnerability.

Affected Systems

All installations of py‑pdf's pypdf library that are older than version 6.21.4 are vulnerable. The fix is issued in release 6.21.4 and later versions. Applications that import and use pypdf—whether locally or as part of a web service—must ensure they are running a patched version to avoid exposure.

Risk and Exploitability

The CVSS score of 7.1 indicates a high‑severity flaw. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, but the lack of a mitigated EPSS does not diminish the risk when the vulnerable library processes untrusted PDFs. An attacker can trigger the infinite loop by supplying a crafted incomplete PDF file to any code path that uses pypdf for parsing. Because the loop blocks the thread but does not exit the process, the attack can stall a single background worker or, in multi‑threaded environments, exhaust the pool of worker threads, leading to degraded performance or denial of service for legitimate users.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade pypdf to version 6.21.4 or newer in your production environment.
  • Implement a watchdog or isolate PDF parsing in a separate process to prevent a single infinite loop from blocking all workers.
  • Validate incoming PDF files for structural integrity before processing, and reject truncated or malformed files.

Generated by OpenCVE AI on October 29, 2026 at 22:04 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-5849-834g-hvw5 pypdf has possible infinite loop when hitting EOF in standard xref table during trailer search
History
Type Values Removed Values Added
CPEs cpe:2.3:a:pypdf_project:pypdf:*:*:*:*:*:*:*:* cpe:2.3:a:py-pdf:pypdf:*:*:*:*:*:*:*:*
Vendors & Products Pypdf Project
Pypdf Project pypdf
Type Values Removed Values Added
First Time appeared Pypdf Project
Pypdf Project pypdf
CPEs cpe:2.3:a:pypdf_project:pypdf:*:*:*:*:*:*:*:*
Vendors & Products Pypdf Project
Pypdf Project pypdf
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Py-pdf
Py-pdf pypdf
Vendors & Products Py-pdf
Py-pdf pypdf
Type Values Removed Values Added
Description pypdf is a free and open-source pure-python PDF library. Prior to 6.21.4, pypdf can enter an infinite loop while opening a crafted incomplete PDF whose standard cross-reference table reaches the end of the file without a trailer. The trailer search can repeatedly rewind to the same stream position instead of terminating when parsing makes no progress, blocking the processing thread. This issue is fixed in version 6.21.4.
Title pypdf: Possible infinite loop when hitting EOF in standard xref table during trailer search
Weaknesses CWE-835
References
Metrics cvssV4_0

{'score': 7.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-835

    Loop with Unreachable Exit Condition ('Infinite Loop')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 30, 2026, 5:11 PM
Reserved
Oct 29, 2026, 4:04 PM
Status
Analyzed
Published
Oct 29, 2026, 9:17 PM
Modified
Nov 2, 2026, 4:06 PM
Severity
Moderate
Public date
Oct 29, 2026, 8:30 PM