CVE-2026-27024

pypdf has a possible infinite loop when processing TreeObject

Published Feb 20, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
pypdf is a free and open-source pure-python PDF library. Prior to 6.7.1, an attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires accessing the children of a TreeObject, for example as part of outlines. This vulnerability is fixed in 6.7.1.

Analysis

AI-generated

Technical impact

An infinite loop occurs when the pypdf library processes the children of a TreeObject, typically used for outlines in a PDF. The loop consumes CPU resources and can cause the parsing application to hang or crash, resulting in a denial of service. This weakness is classified as a logical flaw that can lead to application unavailability, potentially affecting services that rely on PDF processing.

Affected Systems

The vulnerability applies to the pypdf Python library for all versions prior to 6.7.1, released by the py-pdf project. Any system or application that imports pypdf and parses untrusted PDF files is potentially affected.

Risk and Exploitability

The CVSS score of 6.9 indicates a moderate impact. The EPSS score of less than 1% suggests a very low likelihood of exploitation in the wild, and the issue is not listed as a known exploited vulnerability. An attacker would need to supply a crafted PDF that contains a malicious TreeObject to a vulnerable application; the attack vector is inferred to be via file upload or remote processing of untrusted PDFs. Exploitation relies on the ability to load the PDF within an environment where resource limits are not tightly controlled, and the loop can be triggered without additional credentials.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the pypdf library to version 6.7.1 or newer, which contains the loop‑fix.
  • Validate or sanitize PDF input before feeding it to pypdf, rejecting files that contain malformed or excessively nested TreeObjects.
  • Run PDF parsing in a restricted or sandboxed process with CPU and memory limits to prevent a single malicious file from exhausting host resources.

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

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-996q-pr4m-cvgq pypdf has a possible infinite loop when processing TreeObject
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
Metrics ssvc

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

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': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H'}

cvssV3_1

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

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
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
Description pypdf is a free and open-source pure-python PDF library. Prior to 6.7.1, an attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires accessing the children of a TreeObject, for example as part of outlines. This vulnerability is fixed in 6.7.1.
Title pypdf has a possible infinite loop when processing TreeObject
Weaknesses CWE-835
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/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
Feb 24, 2026, 6:34 PM
Reserved
Feb 17, 2026, 3:08 AM
Status
Analyzed
Published
Feb 20, 2026, 10:16 PM
Modified
Nov 2, 2026, 4:06 PM
Severity
Moderate
Public date
Feb 20, 2026, 9:10 PM