Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ def _validate_file_paths(source_filename: str, output_pdf_filename: str) -> Tupl

# Ensure paths are within expected directories to prevent path traversal
base_path = os.path.abspath(convert_vars.BASE_PATH)
if not source_path.startswith(base_path):
if not source_path.startswith(base_path + os.sep):
return False, f"Source path outside base directory: {source_path}", ""
if not output_dir.startswith(base_path):

if not output_dir.startswith(base_path + os.sep):
return False, f"Output directory outside base directory: {output_dir}", ""

return True, source_path, output_dir
Expand Down
Loading