CVE-2026-31826

pypdf: manipulated stream length values can exhaust RAM

Published Mar 10, 2026 CVSS 4.0 · 6.8 Medium EPSS < 1% KEV · Not listed
Description
pypdf is a free and open-source pure-python PDF library. Prior to 6.8.0, an attacker who uses this vulnerability can craft a PDF which leads to large memory usage. This requires parsing a content stream with a rather large /Length value, regardless of the actual data length inside the stream. This vulnerability is fixed in 6.8.0.

Analysis

AI-generated

Technical impact

A flaw in the pypdf library allows an attacker to craft a PDF file that, when parsed, forces the library to preallocate memory based on an extremely large /Length value that does not match the actual data length. This mismatch can cause the program to consume a disproportionate amount of RAM, potentially leading to a denial‑of‑service. The weakness corresponds to resource exhaustion (CWE‑770).

Affected Systems

The vulnerability impacts all installations of the public pypdf library running any version prior to 6.8.0, on any operating system where the library is used to process PDF files.

Risk and Exploitability

The vulnerability has a CVSS score of 6.8, indicating moderate severity, and an EPSS below 1%, suggesting a low probability of exploitation. It is not listed in the CISA KEV catalog. The likely attack vector is a malicious PDF file that is parsed by an application using pypdf.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the pypdf library to version 6.8.0 or newer, which includes the fix.
  • Implement validation to reject or constrain PDFs whose /Length values exceed a reasonable threshold before invoking pypdf.
  • Configure the application to monitor memory usage during PDF parsing and enforce limits to prevent resource exhaustion.

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

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-hqmh-ppp3-xvm7 pypdf: manipulated stream length values can exhaust RAM
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': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/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
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': 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
Description pypdf is a free and open-source pure-python PDF library. Prior to 6.8.0, an attacker who uses this vulnerability can craft a PDF which leads to large memory usage. This requires parsing a content stream with a rather large /Length value, regardless of the actual data length inside the stream. This vulnerability is fixed in 6.8.0.
Title pypdf: manipulated stream length values can exhaust RAM
Weaknesses CWE-770
References
Metrics cvssV4_0

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

Weaknesses
  • CWE-770

    Allocation of Resources Without Limits or Throttling

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 11, 2026, 3:59 PM
Reserved
Mar 9, 2026, 5:41 PM
Status
Analyzed
Published
Mar 10, 2026, 10:16 PM
Modified
Nov 2, 2026, 4:06 PM
Severity
Moderate
Public date
Mar 10, 2026, 9:36 PM