# CVE-2025-64512: pdfminer.six vulnerable to Arbitrary Code Execution via Crafted PDF Input

> Attackers can execute arbitrary code by providing a malicious PDF that triggers unsafe pickle deserialization in pdfminer.six.

- **Severity:** High 8.6 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 10 Nov 2025
- **Updated:** 8 Jan 2026
- **Also known as:** DEBIAN-CVE-2025-64512, DLA-4374-1, DSA-6062-1, GHSA-wf5f-4jwr-ppcp, PYSEC-2026-1762, ROOT-APP-PYPI-CVE-2025-64512, ROOT-APP-PYPI-GHSA-wf5f-4jwr-ppcp, UBUNTU-CVE-2025-64512, openSUSE-SU-2025:15727-1

## What is CVE-2025-64512?

CVE-2025-64512 is a high-severity unsafe deserialization vulnerability in Debian Debian Linux, published on 10 Nov 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

Pdfminer.six is a community maintained fork of the original PDFMiner, a tool for extracting information from PDF documents. Prior to version 20251107, pdfminer.six will execute arbitrary code from a malicious pickle file if provided with a malicious PDF file. The `CMapDB._load_data()` function in pdfminer.six uses `pickle.loads()` to deserialize pickle files. These pickle files are supposed to be part of the pdfminer.six distribution stored in the `cmap/` directory, but a malicious PDF can specify an alternative directory and filename as long as the filename ends in `.pickle.gz`. A malicious, zipped pickle file can then contain code which will automatically execute when the PDF is processed. Version 20251107 fixes the issue.

Weakness: CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2025-64512?

3 open source packages ship an affected version, including pdfminer-six and pdfminer.six. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pdfminer-six` | PyPI | All versions | 20251107 |
| `pdfminer-six` | PyPI | All versions | 20251107 |
| `pdfminer.six` | PyPI | All versions | 20251107 |
| `python-pdfminer.six` | openSUSE:Tumbleweed | All versions | 20251107-1.1 |

Products: Debian Debian Linux, Pdfminer Pdfminer.six.

## How do I fix CVE-2025-64512?

Upgrade pdfminer-six to 20251107 or later.

## Is CVE-2025-64512 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-64512 exists.

Public exploit code:

- A Proof-of-Concept for CVE-2025-64512 using a polyglot file. (github_poc): https://github.com/luigigubello/CVE-2025-64512-Polyglot-PoC
- CVE-2025-64512: pdfminer.six pickle deserialization rce; .pickle.gz + pdf generator w/ custom payloads (github_poc): https://github.com/matesz44/CVE-2025-64512
- CLI wrapper around the official PoC for CVE-2025-64512 — pdfminer.six insecure pickle deserialization via crafted PDF (RCE) (github_poc): https://github.com/BardLaudian/CVE-2025-64512
- PoC script for CVE-2025-64512 (github_poc): https://github.com/joeack123/PoC-for-CVE-2025-64512
- CVE-2025-64512 - pdfminer.six Remote Code Execution Exploit (github_poc): https://github.com/MehdiChyhab/CVE-2025-64512-exploit
- Exploit for CVE-2025-64512 to get a reverse shell. (github_poc): https://github.com/stoic-crawler/CVE-2025-64512

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-64512 and fix it if it is affected.

What it is: CVE-2025-64512 is a high-severity unsafe deserialization vulnerability in Debian Debian Linux, published on 10 Nov 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-64512 exists.

Affected packages and fixed versions:
- pdfminer-six (PyPI): affected all versions; fixed in 20251107
- pdfminer-six (PyPI): affected all versions; fixed in 20251107
- pdfminer.six (PyPI): affected all versions; fixed in 20251107

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-64512/ (Markdown: https://insights.sbomify.com/CVE-2025-64512/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-64512
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-64512
- OSV: https://osv.dev/vulnerability/CVE-2025-64512

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-64512/
Summaries are generated and may contain mistakes; the official description above is the record.
