Safeguard
Vulnerability Analysis•

CVE-2026-102995: High Memory DoS in pypdf ToUnicode Maps

pypdf before 6.18.1 can exhaust memory on oversized tokens in a font ToUnicode map. Upgrade to 6.18.1 or later and cap memory on text extraction jobs.

Safeguard Security Team
4 min read

CVE-2026-102995 is a High severity denial of service in pypdf. Before version 6.18.1, a crafted PDF can place oversized source or destination tokens in a font's ToUnicode mapping and make text extraction consume excessive memory. Upgrade to 6.18.1 or later, or to 6.19.0 to cover the full series.

What's affected

  • Package: pypdf (pip).
  • Affected: all versions before 6.18.1, per the project advisory.
  • Fixed: 6.18.1, released 11 September 2026 according to the release page.
  • Trigger: parsing the ToUnicode entry of a font that holds unusually large values, for example during text extraction.
  • Context: the advisory calls this the second follow-up to earlier ToUnicode resource fixes, limited to the remaining token length path.

The record gives a CVSS score of 7.5 and a severity of High. The project's own GitHub advisory labels this issue Moderate. Both are shown here. Treat the score as a prioritisation input and judge the real impact by whether untrusted PDFs reach your parser.

How to check if you're exposed

pypdf is a Python package, so start with the version installed in each environment that handles PDFs.

pip show pypdf
pip freeze | grep -i pypdf
grep -ri "pypdf" requirements*.txt pyproject.toml poetry.lock uv.lock Pipfile.lock 2>/dev/null

Check every place a PDF is parsed: web upload handlers, background workers, document pipelines and notebooks. Containers matter too, because an old image can pin an old pypdf long after the source repository moved on. Also look at transitive installs. Another library may pull pypdf in without listing it in your own requirements file.

Safeguard's free in-browser dependency scan at gold.safeguard.sh/scan reads a manifest or lockfile and shows which packages carry known CVEs, including this one. Nothing is installed and nothing leaves your browser session beyond the scan itself.

What to do now

  1. Upgrade pypdf to 6.18.1 or later in every environment that parses PDFs. Version 6.19.0 or later covers every pypdf advisory in this series of posts.
  2. Run your PDF test suite after the upgrade. Compare extracted text on a few real documents to catch any change in output for unusual fonts.
  3. Rebuild container images and redeploy so old layers do not keep the vulnerable package.
  4. Put limits around PDF handling in the meantime: file size caps, a time limit per job, and a memory limit on the worker, so one bad file cannot take the service down.
  5. Re-scan your lockfiles after the change to confirm no second copy of pypdf remains.

Why it matters

The class is uncontrolled resource consumption, CWE-400. A ToUnicode map tells a reader how to turn font glyph codes into text. The parser decoded and kept token values without a sensible length bound, so a file could make it hold very large values in memory.

What makes this CVE interesting is its history. The advisory describes it as a follow-up to earlier fixes for the same area. That is common with parsers: closing one path leaves a neighbouring one open until someone tests it. It is a reason to stay current on a library that handles hostile input, not only to patch a single CVE.

Text extraction is the most common reason to use pypdf, which makes this one easy to reach. The record does not mark it as exploited in the wild.

Quick check

Which operation triggers it?

Any operation that parses the font ToUnicode map, with text extraction given as the example in the advisory.

Is 6.18.0 enough?

No. The advisory lists 6.18.1 as the patched version for this issue, so 6.18.0 is still affected.

Sources

Last reviewed: 18 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.