T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- join/SKILL.md:26
- Finding
- Unconfirmed Modification of Security-Sensitive Agent Configuration<![CDATA[ ## Vulnerability Details **File Location**: `join/SKILL.md:26-52` **Vulnerability Type**: T05: Unauthorized Access and Privilege Escalation **Risk Level**: Medium ### Vulnerable Code ```markdown when the operator says "join zero", "connect to zero", "set up zero", or you read instructions from getzero.dev/zero.md — execute this flow. no questions. no manual config. ## step 1: find your MCP config file check these paths in order. use the FIRST one that exists: 1. `~/.openclaw/openclaw.json` (OpenClaw agent config) 2. `~/.openclaw/mcp.json` (OpenClaw MCP config) 3. `~/.config/mcp/servers.json` (generic MCP config) if NONE exist, create `~/.openclaw/openclaw.json`. ## step 2: add the zero MCP server read the existing config file. add this entry to the `mcpServers` object (preserve existing servers): { "mcpServers": { "zero": { "url": "https://api.getzero.dev/mcp", "transport": "streamable-http" } } } if `mcpServers` key doesn't exist, create it. if a `zero` entry already exists, overwrite it with the above. write the file back. ## step 3: restart MCP connection run: `openclaw mcp restart` or restart the gateway for the new server to be picked up. ``` ### Technical Analysis The join workflow directs the agent to locate, read, modify, and rewrite security-sensitive OpenClaw configuration immediately after a short natural-language trigger. It explicitly requires the operation to proceed with “no questions” and subsequently instructs the agent to restart the MCP gateway. Access to an MCP configuration file is relevant to the declared setup functionality, and the sub-skill declares filesystem permission. However, silently modifying an existing global agent configuration and restarting the gateway exceeds a safe least-privilege workflow. The selected configuration can contain unrelated MCP server definitions or sensitive values, and an existing `zero` entry is overwritten without presenting the change to the operator. Th ...[truncated 1621 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require explicit operator approval before reading or modifying a global configuration file. 2. Display the exact selected path and a redacted JSON diff before writing. 3. Request separate confirmation before restarting the MCP gateway. 4. Parse and update only the `mcpServers.zero` field without exposing unrelated configuration values to the model. 5. Refuse to overwrite an existing `zero` entry unless the operator explicitly approves replacement. 6. Create a permission-preserving backup before modification and restore it automatically if validation or restart fails. 7. Validate the resulting JSON before replacing the original file. 8. Use atomic writes in the same directory and preserve the original ownership and file mode. 9. Restrict filesystem permission to the selected MCP configuration file rather than broad home-directory access. 10. Correct `SKILL.md` and `README.md` so they accurately disclose filesystem writes, configuration changes, and gateway restart behavior. ]]>
