T09 · Insecure Skill Coding Practices
- Location
scripts/sync_heartbeat_md.py:54- Finding
Unconditional Overwrite of Persistent Workspace Heartbeat Instructions
- Content
View full analysis
Tuple[Path, str]: if explicit_workspace: return explicit_workspace.expanduser(), "explicit-workspace" if explicit_workspace_name: return openclaw_home / explicit_workspace_name, "explicit-workspace-name" env_workspace = os.environ.get("OPENCLAW_WORKSPACE") if env_workspace: return Path(env_workspace).expanduser(), "env-workspace" env_workspace_name = os.environ.get("OPENCLAW_WORKSPACE_NAME") if env_workspace_name: return openclaw_home / env_workspace_name, "env-workspace-name" config = read_json(openclaw_home / "openclaw.json") requested_agent_id = agent_id or os.environ.get("OPENCLAW_AGENT_ID") if requested_agent_id: agents = config.get("agents", {}).get("list", []) for item in agents: if not isinstance(item, dict): continue if item.get("id") == requested_agent_id and item.get("workspace"): return Path(item["workspace"]).expanduser(), f"config-agent:{requested_agent_id}" default_workspace = config.get("agents", {}).get("defaults", {}).get("workspace") if default_workspace: return Path(default_workspace).expanduser(), "config-default" return openclaw_home / "workspace", "fallback-default" ``` The generated file contains pe ...[truncated 5853 chars]- Remediation
View remediation
