Tainted flow: 'out' from os.environ.get (line 59, credential/environment) → pathlib.Path.write_text (file write)
Medium
- Category
- Data Flow
- Content
out = Path(output_path) out.parent.mkdir(parents=True, exist_ok=True) out.write_text(html, encoding="utf-8") print(f"✅ 报告已生成: {out}") print(f" 公司: {our_company} ({our_short})")- Confidence
- 95% confidence
- Finding
- The script writes attacker-controlled content to an attacker-controlled path via environment variables without validation. If this skill runs in an automated agent or shared environment, a user can overwrite arbitrary writable files or place HTML output in sensitive locations, which is especially risky because the generated file may contain unescaped user-controlled HTML/JS content from the template substitutions.
