Tainted flow: 'report_file' from input (line 243, user input) → open (file write)
Medium
- Category
- Data Flow
- Content
# 保存报告 report_file = f"competitor_analysis_{my_asin}.txt" with open(report_file, 'w', encoding='utf-8') as f: f.write(report) print(f"\n报告已保存: {report_file}")- Confidence
- 92% confidence
- Finding
- The filename is built directly from the user-controlled ASIN (`my_asin`) and then passed to `open(..., 'w')` without sanitization. An attacker can supply path traversal sequences or special path values so the program writes the report outside the intended directory, potentially overwriting arbitrary files accessible to the process.
