Tainted flow: 'state_file' from os.environ.get (line 181, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
"""Persist state to JSON.""" STATE_DIR.mkdir(parents=True, exist_ok=True) state_file = STATE_DIR / "bounties.json" with open(state_file, "w") as f: json.dump(state, f, indent=2, default=str)- Confidence
- 84% confidence
- Finding
- The file write path is derived from `BOUNTY_STATE_DIR`, an environment variable that may be attacker-controlled in some execution contexts. This allows writes to an arbitrary filesystem location accessible to the process, which can overwrite application files, poison state, or interfere with other components if the script runs with elevated privileges or inside an automation platform.
