Tainted flow: 'config_json' from os.environ.get (line 74, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
"""保存配置文件""" # 使用 JSON 而非 YAML,减少依赖 config_json = CONFIG_FILE.with_suffix('.json') with open(config_json, 'w') as f: json.dump(config, f, indent=2, ensure_ascii=False) print(f"✓ 已保存配置: {config_json}")- Confidence
- 87% confidence
- Finding
- The file write target is derived from WORKSPACE_DIR, which comes from an environment variable and is not validated or constrained to a trusted base path. If an attacker can influence the process environment, they can redirect config writes to arbitrary filesystem locations reachable by the process, leading to unintended file overwrite or data placement.
