CVE-2025-64712 is a critical-severity (CVSS 9.8) Path Traversal vulnerability in unstructured. A fix is available for unstructured — see the affected versions and patch details below.
Unstructured has Path Traversal via Malicious MSG Attachment that Allows Arbitrary File Write
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-64712.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
unstructuredReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
A Path Traversal vulnerability in the partition_msg function allows an attacker to write or overwrite arbitrary files on the filesystem when processing malicious MSG files with attachments.
Impact
An attacker can craft a malicious .msg file with attachment filenames containing path traversal sequences (e.g.,
../../../etc/cron.d/malicious). When processed with process_attachments=True, the library writes the attachment to an
attacker-controlled path, potentially leading to:
- Arbitrary file overwrite
- Remote code execution (via overwriting configuration files, cron jobs, or Python packages)
- Data corruption
- Denial of service
Affected Functionality
The vulnerability affects the MSG file partitioning functionality when process_attachments=True is enabled.
Vulnerability Details
The library does not sanitize attachment filenames in MSG files before using them in file write operations, allowing directory traversal sequences to escape the intended output directory.
Workarounds
Until patched, users can:
- Set
process_attachments=Falsewhen processing untrusted MSG files - Avoid processing MSG files from untrusted sources
- Implement additional filename validation before processing
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | unstructured | all versions | 0.18.18pip install --upgrade 'unstructured==0.18.18' |
Affected Products
unstructuredunstructuredDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for unstructured, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update unstructured to 0.18.18 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-64712 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Frequently Asked Questions
Is CVE-2025-64712 in your dependencies?
Find it across PyPI, including transitive dependencies.