Python tool for converting files and office documents to Markdown.
Safeguard against path traversal for ZipConverter
fix: prevent path traversal vulnerabilities in ZipConverter Added a secure check for path traversal vulnerabilities in the ZipConverter class. Now validates extracted file paths using `os.path.commonprefix` to ensure all files remain within the intended extraction directory. Raises a `ValueError` if a path traversal attempt is detected. - Normalized file paths using `os.path.normpath`. - Added specific exception handling for `zipfile.BadZipFile` and traversal errors. - Ensured cleanup of extracted files after processing when `cleanup_extracted` is enabled.
J
Joel Esler committed
6e4caac70d63c87a532be773b2dc3f330f9fdbda
Parent: 1deaba1