Tainted flow: 'output_path' from os.environ.get (line 279, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
output_path = OUTPUT_DIR / f"mistakes_{timestamp}{ext}" output_path.parent.mkdir(parents=True, exist_ok=True) with open(output_path, 'w', encoding='utf-8') as f: f.write(content) return f"✅ 已导出到: {output_path}"- Confidence
- 94% confidence
- Finding
- The export destination is influenced by `WORKSPACE` and can also be set directly via the `output_file` parameter, then written with `open()` after creating parent directories. If an attacker or untrusted caller controls either path source, they can cause arbitrary file write within the process permissions, potentially overwriting application files or writing sensitive study data to unintended locations.
