Plattform
python
Komponente
unstructured
Behoben in
0.18.19
0.18.18
CVE-2025-64712 is a critical Path Traversal vulnerability discovered in the unstructured Python library. This flaw allows attackers to write or overwrite arbitrary files on the filesystem by crafting malicious .msg files with attachments. Versions of the library affected are those prior to 0.9.4, and a fix is available in version 0.18.18.
The vulnerability lies within the partitionmsg function when processattachments=True. An attacker can exploit this by creating a .msg file containing attachment filenames that include path traversal sequences, such as ../../../etc/cron.d/malicious. When the library processes this malicious file, it will attempt to write the attachment to the attacker-specified path. This can lead to arbitrary file overwrites, potentially allowing attackers to modify critical system configuration files or inject malicious code into cron jobs. The potential for remote code execution is significant, as attackers could overwrite binaries or scripts to gain control of the affected system. The blast radius extends to any system processing .msg files using the vulnerable library.
This vulnerability has not been publicly exploited as of the last update. It is not currently listed on the CISA KEV catalog. Public proof-of-concept code is not widely available, but the vulnerability's severity and potential impact warrant careful attention. The ease of crafting malicious .msg files and the potential for remote code execution suggest a medium probability of exploitation if the vulnerability becomes more widely known.
Organizations and developers using the unstructured Python library to process email attachments, particularly those handling untrusted email sources, are at significant risk. Systems with older versions of the library (≤0.9.3) and those lacking robust input validation are especially vulnerable. Shared hosting environments where multiple applications share the same filesystem are also at increased risk.
• python / server:
import os
import hashlib
def check_attachment_filename(filename):
# Check for path traversal sequences
if "../" in filename:
print(f"Potential path traversal detected in filename: {filename}")
return True
return False
# Example usage
filename = "../../../etc/cron.d/malicious.txt"
if check_attachment_filename(filename):
print("Malicious filename detected!")disclosure
Exploit-Status
EPSS
0.12% (32% Perzentil)
CISA SSVC
CVSS-Vektor
The primary mitigation is to upgrade to version 0.18.18 or later of the unstructured library. If upgrading is not immediately feasible due to compatibility issues or breaking changes, consider disabling the process_attachments=True option in the library's configuration. This will prevent the processing of attachments, effectively eliminating the path traversal risk. Additionally, implement strict input validation on any .msg files processed by the application, sanitizing filenames to prevent path traversal sequences. Monitor system logs for unusual file access patterns or unexpected file modifications. After upgrading, confirm the fix by attempting to process a test .msg file with a deliberately malicious filename containing path traversal sequences; the library should reject the operation.
Aktualisieren Sie die `unstructured`-Bibliothek auf Version 0.18.18 oder höher. Dies behebt die Path-Traversal-Schwachstelle beim Verarbeiten bösartiger MSG-Dateien. Führen Sie `pip install --upgrade unstructured` aus, um zu aktualisieren.
Schwachstellenanalysen und kritische Warnungen direkt in deinen Posteingang.
CVE-2025-64712 is a critical Path Traversal vulnerability in the unstructured Python library that allows attackers to overwrite files by crafting malicious .msg attachments.
You are affected if you are using unstructured versions less than or equal to 0.9.3 and process email attachments.
Upgrade to version 0.18.18 or later. If upgrading is not possible, disable attachment processing or implement strict input validation.
There are no confirmed active exploits at this time, but the vulnerability's potential for remote code execution makes it a high-priority concern.
Refer to the unstructured project's release notes and security advisories on their GitHub repository for the latest information.
Lade deine Abhängigkeitsdatei hoch und erfahre sofort, ob dich diese und andere CVEs treffen.
Lade deine requirements.txt-Datei hoch und wir sagen dir sofort, ob du betroffen bist.