CVE-2026-102995: pypdf: Possible large memory usage for large /ToUnicode streams (Follow-up 2)

Published Sep 30, 2026
·
Updated

Impact

An attacker who uses this vulnerability can craft a PDF which leads to large memory consumption. This requires parsing the /ToUnicode entry of a font with unusually large values, for example during text extraction.

Patches

This has been fixed in pypdf==6.18.1.

Workarounds

If you cannot upgrade yet, consider applying the changes from PR #4071.

Other sources

pypdf is a free and open-source pure-python PDF library. Prior to 6.18.1, a crafted PDF can place unusually large source-code or destination-string tokens in a font /ToUnicode mapping, causing pypdf/cmap.py parsebfchar to decode and retain oversized values during operations such as text extraction and consume excessive memory. This is a second follow-up to earlier /ToUnicode resource-consumption fixes and is limited to the remaining token-length path. This issue is fixed in version 6.18.1.

— MITRE

Affected Software

2 affected componentsFixes available
pypi/pypdf<6.18.1
pip/pypdf<6.18.1
6.18.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pypdf to a version that resolves this vulnerability.

    Fixed in 6.18.1
  2. Upgrade

    Upgrade pypdf to a version that resolves this vulnerability.

    Fixed in 6.18.1
  3. Compensating control

    If upgrading is not yet possible, apply the changes from PR #4071 as a workaround.

Event History

Sep 30, 2026
CVE Published
via MITRE·08:01 PM
Data Sourced
via MITRE·08:01 PM
DescriptionWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness
Oct 1, 2026
Advisory Published
via GitHub·03:06 PM
Data Sourced
via GitHub·03:06 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using pypdf versions prior to 6.18.1 are affected when they parse attacker-controlled PDFs and process a font's /ToUnicode mapping. Text-extraction workflows are specifically identified as an operation that can trigger the issue.

2

What does an attacker need to do to exploit it?

An attacker needs to supply a crafted PDF containing unusually large source-code or destination-string tokens in a font /ToUnicode mapping. No privileges or user interaction are indicated by the supplied CVSS vector.

3

What is the impact of successful exploitation?

Parsing the malicious mapping can cause pypdf to decode and retain oversized values, leading to excessive memory consumption. This can affect availability of the process handling the PDF.

4

What can be done if upgrading is not immediately possible?

Apply the changes from PR #4071 as a workaround. Otherwise, reduce exposure by avoiding processing untrusted PDFs in affected text-extraction or other parsing workflows until the fix can be deployed.

5

How can I determine whether the fix is installed?

Check the installed pypdf version. The issue is fixed in pypdf 6.18.1; versions earlier than 6.18.1 are affected.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203