T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/setup.sh:53- Finding
Setup Permanently Expands Execution Approvals for File-Changing Scripts
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill fits an OpenClaw audit/optimization purpose, but its setup and cleanup flows can persistently expand agent permissions, create broad local backups, and move or delete session and memory files.
Install only if you are comfortable with a skill that can modify OpenClaw workspace instructions and execution approvals. Review setup.sh --apply before running it, keep preflight backups private, avoid --delete unless you have verified what will be removed, and consider manually approving only the read-only audit path instead of pre-approving mutating scripts.
scripts/setup.sh:53Setup Permanently Expands Execution Approvals for File-Changing Scripts
scripts/preflight.sh:16Preflight Creates Sensitive State Archives Without Enforcing Restrictive Permissions
scripts/purge-stale-sessions.sh:9Session Purge Command Also Removes Memory Files Based Solely on File Size
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
rm -rf ~/clawd/skills/inference-optimizer
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
rm -rf ~/clawd/skills/inference-optimizer
The declared purpose emphasizes runtime auditing and inference/token optimization, but the documented behavior also includes installation verification and validation of documentation and approval configuration files. While not inherently malicious, this gap weakens informed consent and can cause operators to approve broader access than intended.
The declared purpose emphasizes runtime auditing and inference/token optimization, but the documented behavior also includes installation verification and validation of documentation and approval configuration files. While not inherently malicious, this gap weakens informed consent and can cause operators to approve broader access than intended.
The declared purpose emphasizes runtime auditing and inference/token optimization, but the documented behavior also includes installation verification and validation of documentation and approval configuration files. While not inherently malicious, this gap weakens informed consent and can cause operators to approve broader access than intended.
The declared purpose emphasizes runtime auditing and inference/token optimization, but the documented behavior also includes installation verification and validation of documentation and approval configuration files. While not inherently malicious, this gap weakens informed consent and can cause operators to approve broader access than intended.
The declared purpose emphasizes runtime auditing and inference/token optimization, but the documented behavior also includes installation verification and validation of documentation and approval configuration files. While not inherently malicious, this gap weakens informed consent and can cause operators to approve broader access than intended.
This script performs destructive maintenance on session and memory data, which goes beyond the stated skill purpose of auditing runtime health and optimizing inference speed/token usage. Even in archive mode, it materially alters user/application state; in delete mode, it permanently removes data based on coarse heuristics (age and file size), creating risk of unintended data loss and operational disruption.
The --delete path directly deletes OpenClaw session JSONL files older than 24 hours and memory markdown files under 200 bytes without validating whether they are safe to remove or necessary for recovery, auditing, or ongoing workflows. Because this is packaged under an inference-optimization skill, an operator may invoke it expecting performance tuning rather than destructive cleanup, increasing the chance of accidental execution and irreversible loss of context/state.
The trigger phrase "purge sessions" is broad, natural-language text that could be invoked accidentally during ordinary conversation, especially in an agent environment that maps free-form user text to skill actions. Because this skill is operational and the phrase is tied to session archival/removal behavior, ambiguous activation increases the risk of unintended state changes or data handling actions.
The skill advertises and instructs use of shell execution, file reads/writes, and environment access, but it does not declare an explicit tool/permission scope. That creates an authorization ambiguity where a reviewer or platform may under-estimate what the skill can do, especially because the documented workflows include setup, allowlist edits, backups, and purge actions affecting local state.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
- only then context pressure, stale sessions, cache-trace, pruning, and concurrency
3. **Diagnosis rule**: Do not conclude from warnings alone. If process output is partial or truncated, report the result as inconclusive and verify installed version, service state, and logs before naming a cause.
4. **No helper-shell prelude**: For `/audit` and `/optimize`, do not run shell helper commands like `ls`, `rg`, `find`, `openclaw status`, or `openclaw gateway status` before the main audit script. If you need context first, use `read` on `MEMORY.md` or `memory_search`. The first shell exec in the optimize flow should be the audit script itself.
5. **Approval semantics**: If exec returns `allowlist miss` or `exec denied`, that is a hard deny, not a pending approval. Do not tell the user to send `/approve ...` unless the tool output explicitly contains a real approval request with an ID. If there is no ID, say there is no approval request to approve and the fix must be on the bot side.
6. **VPS gateway ownership**: On this VPS, `openclaw-gateway.service` is the authoritative gateway owner. Keep `clawdbot.service` disabled, and preserve `pass-cli run --env-file /etc/clawdbot.env.pass` inside the user service itself.
### Optimization branch
The skill instructs rewriting always-loaded workspace files such as SOUL.md, AGENTS.md, TOOLS.md, MEMORY.md, and daily memory files. Persistent modification of agent context and memory is security-sensitive because it can accidentally destroy safeguards, introduce prompt-injection persistence, or irreversibly alter future agent behavior beyond the current session.
---
## Task 2 — Rewrite workspace files
For each file identified in Task 1 with savings > 100 tokens:
The documented /audit and /optimize triggers are broad and lack clear activation constraints or negative examples, increasing the chance that an agent may invoke analysis or optimization flows too eagerly based on casual chat text. Because /optimize leads to operational actions and script execution, ambiguous triggering can result in unintended system modifications.
The preflight script goes beyond the skill's stated audit and optimize scope by performing backups, invoking setup and verification scripts, and giving purge-related operational guidance. Expanding behavior beyond the declared interface increases the attack surface and can mislead users into running privileged or state-changing actions they did not expect from an inference-optimization skill.
The script creates tar archives of entire OpenClaw and workspace directories, which may contain secrets, chat history, tokens, configs, and unrelated user data. For a skill framed as inference optimization, this broad data collection is excessive and creates confidentiality risk if the backups are later exposed, retained insecurely, or accessed by other local users.
The script prepares allowlist entries for multiple executable paths, including setup and purge actions, thereby broadening execution privileges for agents. Automatically seeding approvals is dangerous because it weakens approval boundaries and can make later command execution appear pre-authorized, especially in multi-agent or shared workspace environments.
The script injects managed command blocks into AGENTS.md and TOOLS.md, effectively registering new agent commands in workspace documentation and behavior. Even though this is framed as convenience setup, it creates persistent operational hooks not disclosed by the stated skill purpose, which increases the chance of users enabling additional capabilities without a clear security review.
When run with --apply, the setup script edits workspace AGENTS.md and TOOLS.md and also updates the execution approvals file, expanding what downstream agents may execute. This changes trust and control surfaces beyond simple inference auditing/optimization, and can silently persist new command pathways into shared workspaces if a user approves the setup without understanding the scope.
The skill advertises a /preflight command and install-check behavior that are outside the declared manifest scope of /audit and /optimize. This scope drift is dangerous because it creates hidden or unexpected execution paths, making users and reviewers less able to predict what actions the skill may perform.
No suspicious patterns detected.