PyPI: pdfminer-six
CVE-2025-64512
Safety vulnerability ID: SFTY-20251107-87478
Safety legacy ID: pyup.io-81486
Affected versions of the pdfminer.six package are vulnerable to Deserialization of Untrusted Data due to the CMapDB._load_data() method invoking pickle.loads() on a PDF-controlled CMap file path. The CMapDB._load_data() routine constructs a *.pickle.gz filename from the /Encoding CMap name and joins it with a directory, but attacker-chosen or absolute paths can be resolved and the gzip content is passed directly to pickle.loads(), enabling execution of pickled objects.
Overview
Arbitrary Code Execution in pdfminer.six via Crafted PDF Input
Advisory
Affected versions of the pdfminer.six package are vulnerable to Deserialization of Untrusted Data due to the CMapDB._load_data() method invoking pickle.loads() on a PDF-controlled CMap file path. The CMapDB._load_data() routine constructs a *.pickle.gz filename from the /Encoding CMap name and joins it with a directory, but attacker-chosen or absolute paths can be resolved and the gzip content is passed directly to pickle.loads(), enabling execution of pickled objects.
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20251107-87478/CVE-2025-64512
- https://github.com/pdfminer/pdfminer.six/security/advisories/GHSA-wf5f-4jwr-ppcp
- https://github.com/pdfminer/pdfminer.six/commit/b808ee05dd7f0c8ea8ec34bdf394d40e63501086
- https://nvd.nist.gov/vuln/detail/CVE-2025-64512
- https://github.com/pdfminer/pdfminer.six/releases/tag/20251107
- https://lists.debian.org/debian-lts-announce/2025/11/msg00017.html
- https://lists.debian.org/debian-lts-announce/2026/01/msg00005.html
- https://github.com/advisories/GHSA-wf5f-4jwr-ppcp
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
