Tainted flow: 'output_path' from os.environ.get (line 885, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
os.makedirs(out_dir, exist_ok=True) output_path = os.path.join(out_dir, os.path.basename(args.output)) with open(output_path, "w", encoding="utf-8") as f: f.write(html) print(f"[OK] HTML报告已生成: {output_path}")- Confidence
- 89% confidence
- Finding
- The script derives the output directory from the environment variable EUREKA_PYTHON_OUTPUT_DIR and then writes a file there without validating that the resolved path stays within an approved workspace. In a multi-tenant or untrusted execution environment, an attacker who can influence environment variables could redirect report output to unintended filesystem locations, causing unauthorized file creation or overwriting of writable files.
