Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-70559

CVE-2025-70559: pdfminer.six RCE Vulnerability

CVE-2025-70559 is a remote code execution flaw in pdfminer.six caused by insecure deserialization in CMap loading. Attackers can execute arbitrary code via malicious pickle files. This guide covers technical details, versions, and fixes.

Published:

CVE-2025-70559 Overview

CVE-2025-70559 is an insecure deserialization vulnerability affecting pdfminer.six, a popular Python library for extracting text and information from PDF documents. The vulnerability exists in the CMap loading mechanism where the library uses Python pickle to deserialize CMap cache files without proper validation. An attacker with the ability to place a malicious pickle file in a location accessible to the application can trigger arbitrary code execution or privilege escalation when the file is loaded by a trusted process.

This vulnerability is particularly concerning as it represents an incomplete patch to CVE-2025-64512, indicating that previous remediation efforts failed to fully address the underlying security issue.

Critical Impact

Successful exploitation allows arbitrary code execution and potential privilege escalation through malicious pickle file deserialization in the CMap cache loading mechanism.

Affected Products

  • pdfminer.six versions prior to 20251230

Discovery Timeline

  • 2026-02-03 - CVE-2025-70559 published to NVD
  • 2026-02-04 - Last updated in NVD database

Technical Details for CVE-2025-70559

Vulnerability Analysis

The vulnerability stems from the unsafe use of Python's pickle module for deserializing CMap cache files within pdfminer.six. Python's pickle serialization format is inherently unsafe when processing untrusted data, as it can execute arbitrary Python code during the deserialization process. The CMap loading mechanism in pdfminer.six failed to implement adequate validation before deserializing these cache files, creating an opportunity for attackers to inject malicious payloads.

This issue is a bypass of the fix implemented for CVE-2025-64512, suggesting that the original patch did not comprehensively address all attack vectors related to pickle deserialization in the CMap caching functionality.

Root Cause

The root cause is the use of Python's pickle.load() or equivalent deserialization functions on CMap cache files without proper input validation or integrity verification. Python pickle is known to be unsafe for deserializing untrusted data because a malicious pickle payload can contain instructions to instantiate arbitrary Python objects and execute code during unpickling. The incomplete patch from CVE-2025-64512 left residual code paths that still permitted unsafe deserialization.

Attack Vector

The attack requires an adversary to place a crafted malicious pickle file in a location where pdfminer.six will attempt to load it as a CMap cache file. This could occur through:

  1. Local file manipulation - An attacker with local access writes a malicious pickle file to the CMap cache directory
  2. Application vulnerabilities - Chaining with other vulnerabilities (e.g., path traversal, file upload) to plant the malicious file
  3. Shared environment exploitation - In multi-tenant environments where cache directories may be accessible to multiple users

When a legitimate application process using pdfminer.six loads the poisoned cache file, the malicious pickle payload executes with the privileges of the running process. The vulnerability mechanism centers on the trust placed in cached CMap files without verifying their integrity or source. For detailed technical information, refer to the GitHub Security Advisory.

Detection Methods for CVE-2025-70559

Indicators of Compromise

  • Unexpected or modified files in pdfminer.six CMap cache directories
  • Unusual pickle files appearing in application data directories
  • Process execution anomalies originating from Python processes using pdfminer.six
  • File integrity monitoring alerts for CMap cache locations

Detection Strategies

  • Monitor file system activity for unexpected writes to pdfminer.six cache directories
  • Implement application-level logging to track CMap cache file loading operations
  • Deploy endpoint detection rules to identify suspicious Python pickle deserialization patterns
  • Use code analysis tools to identify unsafe pickle usage in applications consuming pdfminer.six

Monitoring Recommendations

  • Enable file integrity monitoring (FIM) on directories where pdfminer.six stores cache files
  • Configure SIEM rules to alert on anomalous file creation patterns in Python library directories
  • Monitor for unusual child process spawning from applications that process PDF files
  • Review application logs for errors or exceptions related to CMap loading failures

How to Mitigate CVE-2025-70559

Immediate Actions Required

  • Upgrade pdfminer.six to version 20251230 or later immediately
  • Audit existing CMap cache directories and remove any suspicious or unverified pickle files
  • Implement strict file permissions on cache directories to prevent unauthorized writes
  • Consider disabling CMap caching if not critical to application functionality until patching is complete

Patch Information

The vulnerability is addressed in pdfminer.six version 20251230 and later. Organizations should update to this version or newer to remediate the vulnerability. The fix properly addresses the insecure deserialization issue that remained after the incomplete patch for CVE-2025-64512. For additional details, see the pdfminer.six Security Advisory.

Workarounds

  • Restrict file system permissions on CMap cache directories to prevent unauthorized write access
  • Deploy application sandboxing to limit the impact of potential code execution
  • Implement file integrity monitoring to detect unauthorized modifications to cache files
  • If possible, configure the application to avoid using the vulnerable caching mechanism until a patch can be applied
bash
# Example: Restrict permissions on pdfminer cache directory
chmod 700 ~/.cache/pdfminer/
chown $(whoami):$(whoami) ~/.cache/pdfminer/

# Verify no unexpected files exist in cache
ls -la ~/.cache/pdfminer/

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.