Tainted flow: 'mission_path' from os.environ.get (line 20, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
if updates: mission.update(updates) with open(mission_path / "mission.json", "w") as f: json.dump(mission, f, indent=2, ensure_ascii=False)- Confidence
- 92% confidence
- Finding
- The code updates `mission.json` by writing to `mission_path`, which is ultimately influenced by the workspace environment variable and mission metadata without any path canonicalization or containment check. If an attacker can control `AVENGERS_WORKSPACE`, `mission_id`, or the stored `mission["path"]`, they may redirect writes to arbitrary filesystem locations, causing unauthorized file overwrite or corruption.
