Critical

Unstructured has Path Traversal via Malicious MSG Attachment that Allows Arbitrary File Write

  • Disclosed: 03.02.2026
  • Updated: 11.10.2026 15:17

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=False when processing untrusted MSG files
  • Avoid processing MSG files from untrusted sources
  • Implement additional filename validation before processing

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) unstructured < 0.18.18 0.18.18

References

CVSS score 9.8/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-22, CWE-73
Platform
Python (PyPI)
Package
unstructured
Disclosed
03.02.2026
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-558 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-gm8q-m8mv-jj5m - CC BY 4.0

Vulnerability history: unstructured

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
12.2024 09.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • Medium 1

Disclosures per year

  1. 2024: 1
  2. 2025: 0
  3. 2026: 2
  1. Critical · 9.3 CVE-2026-71428 >= 0.4.7, < 0.24.0 0.24.0
  2. Unstructured has Path Traversal via Malicious MSG Attachment that Allows Arbitrary File Write this entry
    Critical · 9.8 CVE-2025-64712 < 0.18.18 0.18.18
  3. Medium CVE-2024-46455 < 0.14.3 0.14.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.