Unstructured has Path Traversal via Malicious MSG Attachment that Allows Arbitrary File Write
Critical severity
GitHub Reviewed
Published
Feb 3, 2026
in
Unstructured-IO/unstructured
•
Updated Feb 4, 2026
Description
Published to the GitHub Advisory Database
Feb 3, 2026
Reviewed
Feb 3, 2026
Published by the National Vulnerability Database
Feb 4, 2026
Last updated
Feb 4, 2026
A Path Traversal vulnerability in the
partition_msgfunction 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 withprocess_attachments=True, the library writes the attachment to anattacker-controlled path, potentially leading to:
Affected Functionality
The vulnerability affects the MSG file partitioning functionality when
process_attachments=Trueis 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:
process_attachments=Falsewhen processing untrusted MSG filesReferences