CVE-2026-33699

pypdf: Possible infinite loop during recovery attempts in DictionaryObject.read_from_stream

Published Mar 26, 2026 CVSS 4.0 · 4.6 Medium EPSS < 1% KEV · Not listed
Description
pypdf is a free and open-source pure-python PDF library. Versions prior to 6.9.2 have a vulnerability in which an attacker can craft a PDF which leads to an infinite loop. This requires reading a file in non-strict mode. This has been fixed in pypdf 6.9.2. If users cannot upgrade yet, consider applying the changes from the patch manually.

Analysis

AI-generated

Technical impact

An attacker can craft a PDF that causes pypdf, when used in non‑strict mode, to enter an endless loop during recovery attempts in the DictionaryObject.read_from_stream function. The loop consumes CPU time and memory without making progress, effectively locking the host application. This results in a denial of service rather than code execution or data exfiltration. The weakness stems from improper condition checks (CWE‑606) and uncontrolled loop increments (CWE‑835).

Affected Systems

The flaw affects all pypdf versions older than 6.9.2 on any operating system, because the library is pure Python and widely used in scripts and applications that process PDF files. Any Python program that imports pypdf and opens PDFs with non‑strict parsing is vulnerable.

Risk and Exploitability

The CVSS v3.1 score of 4.6 indicates moderate severity, while the EPSS score of less than 1 % and absence from the CISA KEV catalog suggest a low probability of exploitation in the wild. The attack vector would require the delivery of a malicious PDF to the target application, typically via local user input or an uploaded file. Using strict parsing, if available, mitigates the risk.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to pypdf 6.9.2 or later.
  • If an upgrade is not immediately possible, apply the changes from the official patch (GHSA‑87mj‑5ggw‑8qc3) to the affected module in your codebase.
  • Enable strict PDF parsing (strict=True) in pypdf calls to prevent the recovery loop from executing.
  • Restrict or sanitize external PDF inputs before they reach the pypdf processing routine.

Generated by OpenCVE AI on April 2, 2026 at 05:17 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-87mj-5ggw-8qc3 pypdf: Possible infinite loop during recovery attempts in DictionaryObject.read_from_stream
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
Metrics cvssV3_1

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

cvssV3_1

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

Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
Weaknesses CWE-606
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/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. Versions prior to 6.9.2 have a vulnerability in which an attacker can craft a PDF which leads to an infinite loop. This requires reading a file in non-strict mode. This has been fixed in pypdf 6.9.2. If users cannot upgrade yet, consider applying the changes from the patch manually.
Title pypdf: Possible infinite loop during recovery attempts in DictionaryObject.read_from_stream
Weaknesses CWE-835
References
Metrics cvssV4_0

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

Weaknesses
  • CWE-606

    Unchecked Input for Loop Condition

  • CWE-835

    Loop with Unreachable Exit Condition ('Infinite Loop')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 27, 2026, 7:59 PM
Reserved
Mar 23, 2026, 5:06 PM
Status
Analyzed
Published
Mar 27, 2026, 1:16 AM
Modified
Nov 2, 2026, 4:06 PM
Severity
Moderate
Public date
Mar 26, 2026, 11:58 PM