CVE-2026-119209

pypdf: Possible large memory usage when parsing cross-reference streams

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.3, pypdf can consume excessive memory while opening a crafted PDF containing cross-reference streams that declare very large entry counts. Highly compressible streams and /Prev chains can multiply the number of parsed entries across a document, while negative /Index counts can bypass the existing per-stream clamp. This issue is fixed in version 6.21.3.

Analysis

AI-generated

Technical impact

The vulnerability causes the pypdf library to allocate excessive amounts of memory when parsing PDF cross‑reference streams that declare very large entry counts. A crafted PDF can include highly compressible streams and a /Prev chain that multiplies the number of parsed entries, and negative /Index values can bypass the existing per‑stream clamp. An attack that leverages this flaw can exhaust an application's memory, making it unresponsive or forcing it to terminate. The weakness is a classic resource exhaustion (CWE‑400) and a failure to appropriately limit data sizes (CWE‑770).

Affected Systems

The flaw affects the py‑pdf distribution of pypdf. Any installation of pypdf earlier than version 6.21.3 is vulnerable. The library is commonly used in Python projects that process PDF files, so any software that imports or depends on pypdf and accepts user supplied PDFs may be impacted.

Risk and Exploitability

The CVSS score of 7.1 indicates a moderate severity risk. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, suggesting the likelihood of a public exploit is uncertain but still plausible. Attackers would need to supply a specially crafted PDF to the vulnerable application; depending on the context, the file could be uploaded, downloaded, or opened locally. Once delivered, the parser will allocate memory proportional to the declared entry count, potentially blowing the process’s memory limit or exhausting system resources. The exploitability is primarily local or remote, depending on how the application receives PDF inputs, but the impact on availability is substantial if the application is critical.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to pypdf version 6.21.3 or later, which includes the fix for the excessive memory usage.
  • If upgrading is not immediately possible, validate PDFs from untrusted sources for size and complexity before passing them to pypdf, and reject those that exceed reasonable limits.
  • Configure resource limits for the process that loads PDFs so that excessive memory consumption cannot take down the application, and monitor memory usage for anomalous spikes.

Generated by OpenCVE AI on October 29, 2026 at 21:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-x3rh-gjgm-fmqc pypdf has possible large memory usage when parsing cross-reference streams
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': 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
Metrics ssvc

{'options': {'Automatable': 'yes', '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.3, pypdf can consume excessive memory while opening a crafted PDF containing cross-reference streams that declare very large entry counts. Highly compressible streams and /Prev chains can multiply the number of parsed entries across a document, while negative /Index counts can bypass the existing per-stream clamp. This issue is fixed in version 6.21.3.
Title pypdf: Possible large memory usage when parsing cross-reference streams
Weaknesses CWE-400
CWE-770
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-400

    Uncontrolled Resource Consumption

  • CWE-770

    Allocation of Resources Without Limits or Throttling

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 30, 2026, 4:00 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:43 PM