Tainted flow: 'OUTPUT_FILE' from os.getenv (line 15, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
} # 保存 with open(OUTPUT_FILE, "w", encoding="utf-8") as f: json.dump(report, f, ensure_ascii=False, indent=2) print(f"\n✅ 日报已保存: {OUTPUT_FILE}")- Confidence
- 90% confidence
- Finding
- The output path is derived from the TODAY environment variable and then written with open() without validating that the value is a safe date string. An attacker who can control the environment could supply path traversal sequences or absolute paths, causing the program to overwrite arbitrary files accessible to the process.
