T09 · Insecure Skill Coding Practices
- Location
scripts/generate_workflow_blueprint.py:16- Finding
Dry-run mode performs unrestricted filesystem writes
- Content
View full analysis
None: output_path.parent.mkdir(parents=True, exist_ok=True) if fmt == "json": output_path.write_text(json.dumps(result, indent=2), encoding="utf-8") return if fmt == "md": details = result["details"] lines = [ f"# {result['summary']}", "", f"- status: {result['status']}", f"- workflow_name: {details['workflow_name']}", f"- trigger: {details['trigger']}", "", "## Steps", ] for step in details["steps"]: lines.append(f"- {step['order']}. {step['name']} ({step['type']})") output_path.write_text("\n".join(lines) + "\n", encoding="utf-8") return with output_path.open("w", newline="", encoding="utf-8") as handle: writer = csv.DictWriter(handle, fieldnames=["order", "name", "type", "on_failure"]) writer.writeheader() writer.writerows(result["details"]["steps"]) ``` ```python render(result, Path(args.output), args.format) ``` ### Technical Analysis The `--dry-run` option explicitly promises execution “without side effects,” but it does not control the call to `render()`. Every execution therefore creates missing parent directories and writes to or truncates the path supplied through `--output`, including when `--dry-run` is e ...[truncated 2339 chars]- Remediation
View remediation
