Details
---
Recommended Fix
Add filename sanitization in download_media.py after line 151:
file_name = file_name or media_file_name or ""
# Add this sanitization block:
if file_name:
# Remove any path components, keeping only the basename
file_name = os.path.basename(file_name)
# Remove null bytes which could cause issues
file_name = file_name.replace('\x00', '')
# Handle edge cases
if not file_name or file_name in ('.', '..'):
file_name = ""
This ensures that only the filename component is used, stripping any directory traversal sequences or absolute paths.
---
Thank you for your time in reviewing this report. Please let me know if you need any additional information or clarification.