9.8critical
Unstructured has Path Traversal via Malicious MSG Attachment that Allows Arbitrary File Write
- Severity
- 9.8critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.69% (higher than 53% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-gm8q-m8mv-jj5mPYSEC-2026-558
Description
The unstructured library provides open-source components for ingesting and pre-processing images and text documents, such as PDFs, HTML, Word docs, and many more. Prior to version 0.18.18, 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. This issue has been patched in version 0.18.18.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unstructured-IO unstructured | < 0.18.18 | CVE List |
| unstructured (PyPI) | before 0.18.18 | GitHub Advisory Database, PyPA Advisory Database |
| unstructured unstructured | before 0.18.18 | NVD |
All scores
| GitHub_M | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| PyPA Advisory Database | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
What each source says
CVE List
The unstructured library provides open-source components for ingesting and pre-processing images and text documents, such as PDFs, HTML, Word docs, and many more. Prior to version 0.18.18, 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. This issue has been patched in version 0.18.18.
GitHub Advisory Database
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
NVD (es)
La librería 'unstructured' proporciona componentes de código abierto para la ingesta y el preprocesamiento de imágenes y documentos de texto, como PDF, HTML, documentos de Word y muchos más. Antes de la versión 0.18.18, una vulnerabilidad de salto de ruta en la función 'partition_msg' permite a un atacante escribir o sobrescribir archivos arbitrarios en el sistema de archivos al procesar archivos MSG maliciosos con archivos adjuntos. Este problema ha sido parcheado en la versión 0.18.18.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-64712 changed 2026-02-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-gm8q-m8mv-jj5m changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2025-64712 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2026-558 changed 2026-07-13 | CC-BY-4.0 |