T01 · Skill Instruction Hijacking
- Location
SKILL.md:5- Finding
Agent Role and Workflow Hijacking Through Skill Instructions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real OpenCode workflow helper, but it installs shared scripts automatically and includes unsafe command, logging, and callback behavior that users should review before installing.
Install only if you want OpenClaw tasks delegated through these OpenCode callback scripts. Review the lifecycle hooks first, avoid using the bash-c wrapper with untrusted task text, treat session keys and task logs as sensitive, and expect task content and summaries to be written under ~/.openclaw/task-results and passed to the local callback mechanism.
SKILL.md:5Agent Role and Workflow Hijacking Through Skill Instructions
scripts/opencode-run-with-callback.sh:62Arbitrary Command Execution Through User-Controlled bash -c Input
package.json:25Shared Agent Tool Overwrite and Overbroad Removal Through Package Lifecycle Scripts
scripts/opencode-auto-callback.sh:21Sensitive Task Arguments and Outputs Stored Without Restrictive Permissions
The preuninstall lifecycle hook removes files from ~/.openclaw/scripts using a wildcard pattern, which affects user-home content outside the package directory. Automatic deletion in lifecycle hooks is risky because it can remove files without granular validation and normalizes package-managed access to persistent agent script locations; combined with shell expansion, mistakes or future path changes could broaden impact.
],
"scripts": {
"postinstall": "cp -r scripts/* ~/.openclaw/scripts/ 2>/dev/null || true",
"preuninstall": "rm -f ~/.openclaw/scripts/opencode-*.sh ~/.openclaw/scripts/README-opencode-callback.md 2>/dev/null || true"
}
}
The README's '禁止行为' section says not to analyze code, modify files, execute commands, or act on its own, presenting those as prohibited behaviors. However, later sections explicitly direct use of command-invoking callback scripts and tell opencode to review code and fix problems, which is an active contradiction in documented intent rather than a mere omission.
The README advertises automatic start/completion callbacks and result-summary extraction but does not disclose what data is transmitted, where it is sent, or what identifiers and task content may be included. In a multi-agent workflow, this can cause sensitive prompts, task metadata, summaries, or repository-derived information to be sent externally without informed consent or proper review.
The file begins with a Chinese-only title and all operational instructions are written in Chinese, which effectively imposes a specific language on users or operators. The document does not offer an alternative language, opt-in, or a justification that this skill is intended only for a Chinese-specific context.
The document repeatedly states '你是传话筒 + 协调员,不是执行者' and forbids '不自己执行命令', implying the skill should not itself run commands. However, later sections instruct invoking /home/root1/.openclaw/scripts/opencode-auto-callback.sh, cat, and ls commands directly, which is active command execution rather than mere relaying.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
**⚠️ 重要:必须使用 opencode-auto-callback.sh 脚本!**
- ❌ 错误:`nohup opencode run "..." > log 2>&1 &`(没有完成通知)
- ❌ 错误:`run-background-task.sh`(旧脚本,已废弃)
- ✅ 正确:使用 `opencode-auto-callback.sh`(自动发送开始/完成通知)
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
**⚠️ 重要:必须使用 opencode-auto-callback.sh 脚本!**
- ❌ 错误:`nohup opencode run "..." > log 2>&1 &`(没有完成通知)
- ❌ 错误:`run-background-task.sh`(旧脚本,已废弃)
- ✅ 正确:使用 `opencode-auto-callback.sh`(自动发送开始/完成通知)
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
ls -la /home/root1/.openclaw/scripts/opencode-auto-callback.sh
cat /home/root1/.openclaw/scripts/README-opencode-callback.md
The package presents itself as a usage guide/documentation package, but its install lifecycle hooks modify files under the user's home directory. That mismatch is security-relevant because users may install it expecting passive documentation while it performs persistent side effects outside the package directory.
This is a manifest file, so vague-trigger checks apply. The description says the package is a guide for getting OpenClaw to call opencode correctly, but it does not define any specific activation phrases, boundaries, or negative examples, leaving invocation scope ambiguous if this metadata is used for discovery or routing.
The natural-language description is written entirely in Chinese and does not indicate that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without opt-in is a language/locale violation.
The postinstall hook copies files into ~/.openclaw/scripts, creating installation-time persistence in a user configuration directory. This is dangerous because npm lifecycle scripts execute automatically during install, allowing silent placement of executable content that may later be invoked by the agent environment.
The README explicitly states that task results, logs, and JSON output are stored under ~/.openclaw/task-results/, but it does not warn that these artifacts and automatic callbacks may contain sensitive prompts, model output, session identifiers, or operational data. In an agent workflow, silent persistence and transmission of task data increases the risk of unintended disclosure, especially if users assume the wrapper is only orchestration glue.
The script transmits the session identifier and task status to an external callback script without any validation, user confirmation, or visibility into where the data ultimately goes. In an agent/automation context, session keys can be sensitive routing or correlation identifiers, and sending them externally expands the attack surface for tracking, leakage, or unauthorized message injection.
The script logs the task description and full command arguments to a local file, which can capture sensitive prompts, tokens, file paths, or operational details without minimization or consent. Because these logs are stored under a predictable directory in the user's home area, any local compromise, backup exposure, or overly broad file permissions can leak sensitive data.
The script extracts result text, stores it on disk, and forwards the result file through a callback path, creating both at-rest and in-transit exposure of model output. If the task output contains secrets, proprietary code, or sensitive business data, this behavior can exfiltrate that information outside the expected execution boundary, which is especially risky in an agent skill that may process confidential content automatically.
This shell script includes its title, usage examples, and later user-facing status messages entirely in Chinese. Because the file provides no opt-in, fallback language, or justification that the skill is intended only for Chinese-speaking users, it creates a natural-language locale policy concern.
The inline parameter description presents opencode_command as a literal command to run, with examples like 'opencode run ...'. In execution, the script does not run that command directly; it reconstructs a new shell command with bash -c and appends --format json, which changes the supplied command's behavior and can cause it to do something different than the documentation implies.
Natural-language policy issues include forcing a specific language without user opt-in. This document presents all operational guidance in Chinese with no indication of alternative language support or explicit justification for a language restriction.
Early workflow rules require asking for confirmation before execution and say not to act on one's own. Yet the later 'Plan 模式' section instructs the skill to analyze the existing implementation and produce a detailed plan before user confirmation, which conflicts with the earlier prohibition on self-analysis/action.
The file's natural-language instructions exclusively use Chinese, which effectively forces a specific language for users reading the skill documentation. Under the stated policy, locale or language restrictions should be opt-in or explicitly justified when the skill is region-specific.
Comments, usage text, and examples are all presented only in Chinese, and the script does not offer any locale or language selection. This is a natural-language policy concern because it forces a specific language without user opt-in or documented regional justification.
No suspicious patterns detected.