T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:270- Finding
Overly Broad Reading of User-Global Agent Configuration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 270-277
Vulnerability Type: Excessive access to user-global configuration files
Risk Level: MediumVulnerable Code
bash # OpenClaw 配置 cat ~/.openclaw/config.json 2>/dev/null cat ./openclaw.json 2>/dev/null # Claude Code 配置 cat ~/.claude/settings.json 2>/dev/null cat ./.claude/settings.json 2>/dev/nullTechnical Analysis
The heartbeat workflow instructs the agent to read the complete contents of user-global OpenClaw and Claude configuration files. These files can contain sensitive values unrelated to heartbeat optimization, including API credentials, private service endpoints, authentication headers, hooks, executable commands, and other user-specific configuration.
Reading entire global configuration files violates the principle of least privilege because heartbeat optimization only requires a limited subset of configuration keys. Although the audited project does not contain code that transmits these values externally, the full contents can enter the active agent context, tool transcripts, logs, or subsequent generated files.
Redirecting errors to
/dev/nullsuppresses visibility when access fails but does not reduce the amount of data accessed when the files are readable.Attack Path
- A user stores a credential or private endpoint in
~/.openclaw/config.jsonor~/.claude/settings.json. - The user invokes the heartbeat optimization workflow.
- The agent follows the documented instructions and reads each global settings file in full.
- Sensitive values become part of the agent's active context or tool history.
- A later response, diagnostic report, context snapshot, or unrelated prompt causes those values to be reproduced or persisted.
No direct network exfiltration mechanism was identified in the audited project. Exploitation therefore depends on subsequent disclosure through agent output, logs, or context pe ...[truncated 644 chars]
- A user stores a credential or private endpoint in
- Remediation
View remediation
Remediation Suggestions
- Do not read complete user-global configuration files by default.
- Request explicit user consent before accessing files under
~/.openclawor~/.claude. - Use a local structured JSON parser to extract only the heartbeat-related keys required by the workflow.
- Recursively redact fields whose names match patterns such as
token,secret,password,credential,authorization,api_key, orprivate_key. - Prevent raw configuration contents from being included in reports, logs, model prompts, or context snapshots.
- Prefer project-level configuration unless the user specifically asks to inspect global settings.
- Display the exact files and fields that will be accessed before performing the read.
- Report access failures explicitly rather than silently suppressing all errors when diagnostic information is appropriate.
