Tainted flow: 'LEARNING_TRAIL_PATH' from os.environ.get (line 28, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
def save_trail(trail): os.makedirs(MEMORY_DIR, exist_ok=True) with open(LEARNING_TRAIL_PATH, "w") as f: json.dump(trail, f, indent=2)- Confidence
- 90% confidence
- Finding
- LEARNING_TRAIL_PATH is derived from the OPENCLAW_WORKSPACE environment variable and then written without validating that the resolved path stays within an approved workspace root. An attacker who can influence the environment or execution context could redirect writes to unintended files, causing arbitrary file overwrite within the process's permissions.
