CVE-2026-59935: pypdf Possible Infinite Loop For Not Vulnerability

HIGH
Advisory Identifier: GHSA-g867-7843-wf8q
CWE-835
Published
Advisory Summary

CVE-2026-59935 is a HIGH possible infinite loop for not vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting pypdf libraries in the PyPI ecosystem. The issue involves possible infinite loop for not terminated inline images (ascii85 and asciihex filter). Remediation is available by upgrading affected packages to version 6.14.2.

CVE-2026-59935 at a Glance

CVE Identifier CVE-2026-59935
GHSA Identifier GHSA-g867-7843-wf8q
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product pypdf
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-59935

To remediate this vulnerability, upgrade all affected pypdf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pypdf fixed: 6.14.2
pip install pypdf>=6.14.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pypdf

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-59935, inspect your installed packages using pip:

pip show pypdf

Analyze the terminal output to locate any version of pypdf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.14.2), your application is affected.

Note: The pip show pypdf command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In pypdf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact An attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires parsing the content stream of a page with a not terminated inline image, as done when extracting the page text for example. It only affects the ASCII85 and ASCIIHex filters. ### Patches This has been fixed in [pypdf==6.14.2](https://github.com/py-pdf/pypdf/releases/tag/6.14.2). ### Workarounds If you cannot upgrade yet, consider applying the changes from PR [#3892](https://github.com/py-pdf/pypdf/pull/3892).

CVE-2026-59935 Affected pypdf Versions

1 component(s)
Fixed Versions:
6.14.2
Product / Package Ecosystem Affected Versions Fixed Version
pypdf
PyPI
< 6.14.2
6.14.2

References

Frequently Asked Questions

What is CVE-2026-59935?
CVE-2026-59935 is a security vulnerability in pypdf involving Possible infinite loop for not terminated inline images (ASCII85 and ASCIIHex filter) under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which pypdf versions are affected?
Affected versions include releases prior to 6.14.2 across affected packages: pypdf.
What version fixes CVE-2026-59935?
Upgrading to 6.14.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pypdf affected?
Yes, pypdf is affected in releases prior to 6.14.2. Upgrade your dependency to 6.14.2 or later.
What CWE is associated with CVE-2026-59935?
CVE-2026-59935 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check PyPI dependencies for CVE-2026-59935?
Run the dependency tree command: 'pip show pypdf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g867-7843-wf8q",
  "modified" : "2026-07-23T16:37:07Z",
  "published" : "2026-07-23T16:37:07Z",
  "aliases" : [ "CVE-2026-59935" ],
  "summary" : "pypdf: Possible infinite loop for not terminated inline images (ASCII85 and ASCIIHex filter)",
  "details" : "### Impact\n\nAn attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires parsing the content stream of a page with a not terminated inline image, as done when extracting the page text for example. It only affects the ASCII85 and ASCIIHex filters.\n\n### Patches\n\nThis has been fixed in [pypdf==6.14.2](https://github.com/py-pdf/pypdf/releases/tag/6.14.2).\n\n### Workarounds\n\nIf you cannot upgrade yet, consider applying the changes from PR [#3892](https://github.com/py-pdf/pypdf/pull/3892).",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pypdf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.14.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/py-pdf/pypdf/security/advisories/GHSA-g867-7843-wf8q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59935"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/py-pdf/pypdf/pull/3892"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/py-pdf/pypdf/commit/5a33a46416aa1ae6c025ff90a3cca57631fdafd2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/py-pdf/pypdf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/py-pdf/pypdf/releases/tag/6.14.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-23T16:37:07Z",
    "nvd_published_at" : "2026-07-08T20:16:59Z"
  }
}