Python tool for converting files and office documents to Markdown.
Don't have ZipConverter accept OOXML files. This will never yield a good result. (#1078)
afourney9182923375fb
diff --git a/packages/markitdown/src/markitdown/converters/_zip_converter.py b/packages/markitdown/src/markitdown/converters/_zip_converter.pyindex 026900d3..e2b5fe6d 100644--- a/packages/markitdown/src/markitdown/converters/_zip_converter.py+++ b/packages/markitdown/src/markitdown/converters/_zip_converter.py@@ -77,6 +77,10 @@ class ZipConverter(DocumentConverter):try:# Extract the zip file safelywith zipfile.ZipFile(local_path, "r") as zipObj:+ # Bail if we discover it's an Office OOXML file+ if "[Content_Types].xml" in zipObj.namelist():+ return None+# Safeguard against path traversalfor member in zipObj.namelist():member_path = os.path.normpath(os.path.join(extraction_dir, member))