CVE-2025-64712: Unstructured Path Traversal Vulnerability
CRITICALCVE-2025-64712 is a CRITICAL (CVSS 9.8) path traversal vulnerability (CWE-73: External Control of File Name or Path) affecting Unstructured libraries in the PyPI ecosystem. The issue involves unstructured has path traversal via malicious msg attachment that allows arbitrary file write. Remediation is available by upgrading affected packages to version 0.18.18.
CVE-2025-64712 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2025-64712
To remediate this vulnerability, upgrade all affected Unstructured dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install unstructured>=0.18.18
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show unstructured
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-64712, inspect your installed packages using pip:
pip show unstructured
Analyze the terminal output to locate any version of Unstructured in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.18.18), your application is affected.
Note: The pip show unstructured command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Unstructured, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-64712 Affected Unstructured Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
unstructured
|
PyPI |
< 0.18.18
|
0.18.18
|
References
Frequently Asked Questions
What is CVE-2025-64712?
Which Unstructured versions are affected?
What version fixes CVE-2025-64712?
Is unstructured affected?
What is the CVSS score of CVE-2025-64712?
What CWE is associated with CVE-2025-64712?
How can I check PyPI dependencies for CVE-2025-64712?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gm8q-m8mv-jj5m",
"modified" : "2026-02-04T19:53:04Z",
"published" : "2026-02-03T17:43:56Z",
"aliases" : [ "CVE-2025-64712" ],
"summary" : "Unstructured has Path Traversal via Malicious MSG Attachment that Allows Arbitrary File Write",
"details" : "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.\n\n ## Impact\n An attacker can craft a malicious .msg file with attachment filenames containing path traversal sequences (e.g.,\n `../../../etc/cron.d/malicious`). When processed with `process_attachments=True`, the library writes the attachment to an\n attacker-controlled path, potentially leading to:\n\n - Arbitrary file overwrite\n - Remote code execution (via overwriting configuration files, cron jobs, or Python packages)\n - Data corruption\n - Denial of service\n\n ## Affected Functionality\n The vulnerability affects the MSG file partitioning functionality when `process_attachments=True` is enabled.\n\n ## Vulnerability Details\n The library does not sanitize attachment filenames in MSG files before using them in file write operations, allowing directory\n traversal sequences to escape the intended output directory.\n\n ## Workarounds\n Until patched, users can:\n - Set `process_attachments=False` when processing untrusted MSG files\n - Avoid processing MSG files from untrusted sources\n - Implement additional filename validation before processing",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "unstructured"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.18.18"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.18.17"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Unstructured-IO/unstructured/security/advisories/GHSA-gm8q-m8mv-jj5m"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-64712"
}, {
"type" : "WEB",
"url" : "https://github.com/Unstructured-IO/unstructured/commit/b01d35b2373fd087d2e15162b9c021663c97155d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Unstructured-IO/unstructured"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-73" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-03T17:43:56Z",
"nvd_published_at" : "2026-02-04T18:16:07Z"
}
}