Tainted flow: 'output_path' from os.environ.get (line 133, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
print(f"Total: {len(all_nodes)}, Unique: {len(unique)}, Protocols: {protocols}") result = {"scraped_at": datetime.now().isoformat(), "total": len(unique), "protocols": protocols, "nodes": unique} os.makedirs(os.path.dirname(output_path), exist_ok=True) with open(output_path, 'w', encoding='utf-8') as f: json.dump(result, f, ensure_ascii=False, indent=2) print(f"Saved {len(unique)} nodes to {output_path}")- Confidence
- 92% confidence
- Finding
- The script builds the output file path from the OPENCLAW_WORKSPACE environment variable and then writes to it without validating or constraining the destination. If an attacker can influence the environment, they can redirect writes to arbitrary filesystem locations, causing unintended file overwrite or data placement outside the expected workspace.
