CVE-2026-22690

5.3 MEDIUM

📋 TL;DR

This vulnerability in pypdf allows attackers to craft malicious PDF files that cause excessive processing time when parsed in non-strict mode. The attack works by omitting the /Root entry while using large /Size values, leading to potentially long runtimes for invalid files. This affects any application using pypdf versions before 6.6.0 to process untrusted PDF files.

💻 Affected Systems

Products:
  • pypdf
Versions: All versions before 6.6.0
Operating Systems: All platforms running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects non-strict reading mode. Strict mode (default in some configurations) is not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Denial of service through resource exhaustion - malicious PDFs could cause pypdf processes to consume excessive CPU/time, potentially crashing applications or making services unavailable.

🟠

Likely Case

Degraded performance or temporary unavailability of services processing PDFs, requiring manual intervention to terminate hung processes.

🟢

If Mitigated

Minimal impact if strict mode is used or input validation prevents processing of malformed PDFs.

🌐 Internet-Facing: MEDIUM - Web applications accepting PDF uploads could be targeted for DoS attacks, but impact is limited to performance degradation rather than data compromise.
🏢 Internal Only: LOW - Internal systems processing PDFs could experience performance issues, but attack requires PDF processing capability and non-strict mode.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires only crafting a malformed PDF file. No authentication or special privileges needed if application processes PDFs.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.6.0

Vendor Advisory: https://github.com/py-pdf/pypdf/security/advisories/GHSA-4xc4-762w-m6cg

Restart Required: No

Instructions:

1. Update pypdf using pip: 'pip install --upgrade pypdf==6.6.0' 2. Verify the update with: 'pip show pypdf' 3. Test PDF processing functionality after update.

🔧 Temporary Workarounds

Enable strict mode

all

Use strict=True parameter when creating PdfReader objects to reject malformed PDFs early

reader = PdfReader(pdf_file, strict=True)

Input validation

all

Validate PDF files before processing, checking for basic structure and size limits

🧯 If You Can't Patch

  • Implement strict mode for all PDF processing (reader = PdfReader(file, strict=True))
  • Add timeout mechanisms for PDF processing operations
  • Limit PDF file sizes and implement rate limiting for PDF uploads/processing

🔍 How to Verify

Check if Vulnerable:

Check pypdf version with: 'python -c "import pypdf; print(pypdf.__version__)"' or 'pip show pypdf'

Check Version:

python -c "import pypdf; print(pypdf.__version__)"

Verify Fix Applied:

Confirm version is 6.6.0 or higher using version check command

📡 Detection & Monitoring

Log Indicators:

  • Long-running PDF processing tasks
  • High CPU usage by Python processes handling PDFs
  • Application timeouts or crashes during PDF parsing

Network Indicators:

  • Multiple large PDF uploads to web applications
  • Unusual PDF file patterns in upload traffic

SIEM Query:

Process logs showing python processes with high CPU duration (>30s) AND command containing 'pypdf' or PDF-related operations

🔗 References

📤 Share & Export