T05 · Unauthorized Access and Privilege Escalation
- Location
- SKILL.md:37
- Finding
- Overbroad Autonomous Collection of Sensitive OpenClaw Data## Vulnerability Details **File Location**: `SKILL.md`, lines 37 and 93–101 **Vulnerability Type**: Excessive access to sensitive configuration, operational, and identity data **Risk Level**: Medium ### Vulnerable Code ```markdown > Collect all data autonomously. Never ask the human to execute commands. ``` ```markdown | `DATA.openclaw_json` | direct read `$OPENCLAW_HOME/openclaw.json` | Raw config for cross-validation | | `DATA.cron` | direct read `$OPENCLAW_HOME/cron/*.json` | Scheduled task definitions | | `DATA.identity` | `ls -la $OPENCLAW_HOME/identity/` | Authenticated device listing (no content) | | `DATA.gateway_err_log` | `tail -200 $OPENCLAW_HOME/logs/gateway.err.log` | Recent gateway errors (redacted) | | `DATA.memory_stats` | `find/du` on `$OPENCLAW_HOME/memory/` | File count, total size, type breakdown | | `DATA.heartbeat` | direct read `$OPENCLAW_HOME/workspace/HEARTBEAT.md` | Last heartbeat timestamp + content | | `DATA.models` | direct read `$OPENCLAW_HOME/agent/models.json` | Model contextWindow, maxTokens per model | | `DATA.cache` | `openclaw cache stats` | Cache size, history count, index size | | `DATA.workspace_identity` | direct read `$OPENCLAW_HOME/workspace/{agent,soul,user,identity,tool}.md` | Presence + word count + content depth of 5 identity files | ``` ### Technical Analysis The Skill instructs the agent to collect system data autonomously and directly read raw OpenClaw configuration, scheduled-task definitions, logs, heartbeat content, model configuration, and workspace identity documents. Reading the full contents of heartbeat and identity files is broader than necessary for checks limited to presence, freshness, size, or structural health. Raw configuration files and logs may contain credentials, identifiers, endpoint details, user information, or operational metadata. Although the Skill separately requires redaction before output, it does not define collection-time field allowlist ...[truncated 2076 chars]
- Remediation
- ## Remediation Suggestions 1. Replace full-file collection with strict field allowlists containing only values required for each health check. 2. Check workspace identity documents using metadata such as existence, size, permissions, and modification time; do not read their contents by default. 3. Parse `openclaw.json` locally and remove tokens, passwords, API keys, cookies, private endpoints, and unrelated fields before passing results to the agent. 4. Sanitize gateway logs before loading them into the model context, using explicit patterns for credentials, authorization headers, URLs with secrets, and personal identifiers. 5. Require explicit user consent before reading heartbeat content, cron definitions, raw configuration, or workspace identity documents. 6. Keep raw collected data out of persistent reports. Reports should contain only derived health findings and sanitized metrics. 7. Apply restrictive permissions to the report directory and define a retention or automatic-deletion policy. 8. Add tests using synthetic secrets to verify that sensitive values cannot reach agent output or generated Markdown and HTML reports.
