Skip to content

#179- sanitize path outputs of template created and filled#180

Open
Cubix33 wants to merge 1 commit intofireform-core:mainfrom
Cubix33:sanitize-pathss
Open

#179- sanitize path outputs of template created and filled#180
Cubix33 wants to merge 1 commit intofireform-core:mainfrom
Cubix33:sanitize-pathss

Conversation

@Cubix33
Copy link

@Cubix33 Cubix33 commented Mar 4, 2026

Closes #179

🚀 Description

Fixes path traversal vulnerabilities and secures temporary file storage. Replaced insecure string slicing with pathlib for safe filename extraction, and implemented tempfile to securely manage intermediate templates outside the project root.

🛠️ Changes Proposed

  • src/file_manipulator.py: Switched to tempfile.mkstemp() to securely generate _template.pdf in the OS temp directory.
  • src/filler.py: Replaced [:-4] with pathlib.Path().stem and added auto-routing for final PDFs into an isolated outputs/ directory.

✅ PR Checklist

  • Path traversal vulnerability mitigated.
  • outputs/ directory dynamically created if missing.
  • Temporary template files are no longer stored in the project root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SECURITY]: Fix Path Traversal Vulnerability & Implement Secure File I/O

1 participant