Tainted flow: 'output_path' from input (line 357, user input) → open (file write)
Medium
- Category
- Data Flow
- Content
) output_path = os.path.join(os.path.expanduser("~/Desktop"), f"{project}_全案方案.md") with open(output_path, "w", encoding="utf-8") as f: f.write(content) print(f"✓ 全案方案已生成: {output_path}")- Confidence
- 94% confidence
- Finding
- The output filename incorporates unsanitized user input from `project`, and `os.path.join` does not prevent path traversal if the filename component contains separators such as `../` or an absolute path. A user can cause the program to write outside the intended Desktop directory and overwrite arbitrary files accessible to the current user.
