Tainted flow: 'filepath' from os.environ.get (line 20, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
*自动生成* """ with open(filepath, "w", encoding="utf-8") as f: f.write(content) return {"status": "ok", "file": str(filepath)}- Confidence
- 89% confidence
- Finding
- The write path is derived from the OPENCLAW_WORKSPACE environment variable, so an attacker who can influence the process environment can redirect writes outside the intended workspace. That can lead to unauthorized file creation or overwrite in arbitrary locations accessible to the process, especially because the code creates parent directories and writes without constraining the resolved path.
