PYSEC-2026-1828

Vulnerability from pysec - Published: 2026-07-07 16:03 - Updated: 2026-07-07 17:25
VLAI
Details

Impact

An attacker who exploits this vulnerability can craft a PDF which leads to possibly long runtimes for invalid startxref entries. When rebuilding the cross-reference table, PDF files with lots of whitespace characters become problematic. Only the non-strict reading mode is affected.

Patches

This has been fixed in pypdf==6.6.0.

Workarounds

from pypdf import PdfReader, PdfWriter


# Instead of
reader = PdfReader("file.pdf")
# use the strict mode:
reader = PdfReader("file.pdf", strict=True)

# Instead of
writer = PdfWriter(clone_from="file.pdf")
# use an explicit strict reader:
writer = PdfWriter(clone_from=PdfReader("file.pdf", strict=True))

Resources

This issue has been fixed in #3594.

Impacted products
Name purl
pypdf pkg:pypi/pypdf

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "pypdf",
        "purl": "pkg:pypi/pypdf"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "6.6.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "1.0",
        "1.1",
        "1.10",
        "1.11",
        "1.12",
        "1.13",
        "1.2",
        "1.3",
        "1.4",
        "1.5",
        "1.6",
        "1.7",
        "1.8",
        "1.9",
        "3.1.0",
        "3.10.0",
        "3.11.0",
        "3.11.1",
        "3.12.0",
        "3.12.1",
        "3.12.2",
        "3.13.0",
        "3.14.0",
        "3.15.0",
        "3.15.1",
        "3.15.2",
        "3.15.3",
        "3.15.4",
        "3.15.5",
        "3.16.0",
        "3.16.1",
        "3.16.2",
        "3.16.3",
        "3.16.4",
        "3.17.0",
        "3.17.1",
        "3.17.2",
        "3.17.3",
        "3.17.4",
        "3.2.0",
        "3.2.1",
        "3.3.0",
        "3.4.0",
        "3.4.1",
        "3.5.0",
        "3.5.1",
        "3.5.2",
        "3.6.0",
        "3.7.0",
        "3.7.1",
        "3.8.0",
        "3.8.1",
        "3.9.0",
        "3.9.1",
        "4.0.0",
        "4.0.1",
        "4.0.2",
        "4.1.0",
        "4.2.0",
        "4.3.0",
        "4.3.1",
        "5.0.0",
        "5.0.1",
        "5.1.0",
        "5.2.0",
        "5.3.0",
        "5.3.1",
        "5.4.0",
        "5.5.0",
        "5.6.0",
        "5.6.1",
        "5.7.0",
        "5.8.0",
        "5.9.0",
        "6.0.0",
        "6.1.0",
        "6.1.1",
        "6.1.2",
        "6.1.3",
        "6.2.0",
        "6.3.0",
        "6.4.0",
        "6.4.1",
        "6.4.2",
        "6.5.0"
      ]
    }
  ],
  "aliases": [
    "CVE-2026-22691",
    "GHSA-4f6g-68pf-7vhv"
  ],
  "details": "### Impact\nAn attacker who exploits this vulnerability can craft a PDF which leads to possibly long runtimes for invalid `startxref` entries. When rebuilding the cross-reference table, PDF files with lots of whitespace characters become problematic. Only the non-strict reading mode is affected.\n\n### Patches\nThis has been fixed in [pypdf==6.6.0](https://github.com/py-pdf/pypdf/releases/tag/6.6.0).\n\n### Workarounds\n\n```python\nfrom pypdf import PdfReader, PdfWriter\n\n\n# Instead of\nreader = PdfReader(\"file.pdf\")\n# use the strict mode:\nreader = PdfReader(\"file.pdf\", strict=True)\n\n# Instead of\nwriter = PdfWriter(clone_from=\"file.pdf\")\n# use an explicit strict reader:\nwriter = PdfWriter(clone_from=PdfReader(\"file.pdf\", strict=True))\n```\n\n### Resources\nThis issue has been fixed in #3594.",
  "id": "PYSEC-2026-1828",
  "modified": "2026-07-07T17:25:12.784995Z",
  "published": "2026-07-07T16:03:17.544640Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/py-pdf/pypdf/security/advisories/GHSA-4f6g-68pf-7vhv"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-22691"
    },
    {
      "type": "WEB",
      "url": "https://github.com/py-pdf/pypdf/pull/3594"
    },
    {
      "type": "WEB",
      "url": "https://github.com/py-pdf/pypdf/commit/294165726b646bb7799be1cc787f593f2fdbcf45"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/py-pdf/pypdf"
    },
    {
      "type": "WEB",
      "url": "https://github.com/py-pdf/pypdf/releases/tag/6.6.0"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/pypdf"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-4f6g-68pf-7vhv"
    }
  ],
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U",
      "type": "CVSS_V4"
    }
  ],
  "summary": "pypdf has possible long runtimes for malformed startxref"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…