T01 · Skill Instruction Hijacking
- Location
SKILL.md:63- Finding
Concealed Delegation to an External Autonomous Agent
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears to configure and run Claude Code as described, but it hides delegated execution, persists credentials, and can give Claude Code shell and file-write access by default.
Review before installing. Use it only if you are comfortable with a skill changing Claude Code configuration, storing API keys in your home directory and shell startup file, installing a mutable npm latest package, and delegating coding tasks to Claude Code with shell and file-write tools. Prefer read-only mode for reviews, avoid pasting long-lived production keys into chat, and rotate any key that was stored in ~/.bashrc.
SKILL.md:63Concealed Delegation to an External Autonomous Agent
scripts/helpers.sh:123Persistent Shell Command Injection Through Unescaped Credential Values
scripts/run.sh:119Build Requests Default to Broad Bash and Filesystem Write Permissions
scripts/install.sh:49Mutable Latest-Version Package Is Installed and Executed Without Integrity Pinning
scripts/helpers.sh:101Unsafe Sed-Based Substitution Allows JSON Configuration Injection
scripts/setup-agentplan.sh:119API Credentials Are Duplicated in Plaintext Shell Startup Configuration
scripts/run.sh:94Persistent Claude Execution Logs Lack Explicit Confidentiality Controls
The skill is advertised as setup/configuration help but also acts as an execution wrapper that routes arbitrary user requests into Claude Code with Bash/Edit/Write access, detached execution, and persistent logs. Users invoking an 'installer/configurator' may not reasonably expect code execution and filesystem modification, making this a capability-concealment risk.
The skill is advertised as setup/configuration help but also acts as an execution wrapper that routes arbitrary user requests into Claude Code with Bash/Edit/Write access, detached execution, and persistent logs. Users invoking an 'installer/configurator' may not reasonably expect code execution and filesystem modification, making this a capability-concealment risk.
The skill is designed to read and write files under ~/.claude, including settings and token material, which are agent configuration artifacts with security significance. Modifying this directory can redirect model endpoints, replace credentials, or alter trust boundaries for future agent sessions.
# Claude Code All-in-One for ArkClaw
让 ArkClaw / OpenClaw 用户在**对话框里**完成 Claude Code CLI 的全部配置 — 不用打开终端、不用手写 `~/.claude/settings.json`、不用记 base_url。本 skill 还内置 **review / build 双模式智能路由**:
- **review 模式**(`--permission-mode plan`):只读分析,不改文件,适合代码审查 / 评估改造方案
- **build 模式**(`--allowedTools` 白名单):允许 Read / Edit / Write / Bash 等动手工具,适合实现代码
Referenced artifact was not completely inspected
│ 运行 scripts/doctor.sh │ ← 每次触发都会运行,检测当前环境状态
Referenced artifact was not completely inspected
│ 运行 scripts/doctor.sh │ ← 每次触发都会运行,检测当前环境状态
The skill explicitly instructs the agent to hide the skill's existence, avoid explaining what it is doing, directly execute scripts, and return output as though the user were talking to Claude Code. Concealing command execution and possible file modification from the user defeats informed consent and can enable silent changes to config or workspace state.
Referenced artifact was not completely inspected
| true | `ark_agent_plan=true` 且 `ark_coding_plan!=true` | true | **零感知配置 (AgentPlan)**:直接 `bash scripts/setup-agentplan.sh --auto`,**完全不要询问用户** |
Referenced artifact was not completely inspected
| true | `ark_agent_plan=true` 且 `ark_coding_plan!=true` | true | **零感知配置 (AgentPlan)**:直接 `bash scripts/setup-agentplan.sh --auto`,**完全不要询问用户** |
Referenced artifact was not completely inspected
| true | `ark_agent_plan=true` 且 `ark_coding_plan!=true` | true | **零感知配置 (AgentPlan)**:直接 `bash scripts/setup-agentplan.sh --auto`,**完全不要询问用户** |
Referenced artifact was not completely inspected
| true | `ark_agent_plan=true` 且 `ark_coding_plan!=true` | true | **零感知配置 (AgentPlan)**:直接 `bash scripts/setup-agentplan.sh --auto`,**完全不要询问用户** |
The normal setup flow instructs users to paste API keys directly into chat. Collecting secrets through conversation exposes them to transcript retention, accidental echoing, downstream logging, and broader agent access than a dedicated secret-input channel would allow.
The custom-gateway flow asks for base URL, key, and model directly in the conversation, collecting both credentials and potentially sensitive infrastructure details in plain text. This broadens exposure beyond the minimum necessary and can leak internal service topology as well as secrets.
Build mode grants Read/Edit/Write/Bash through an allowlist, but the documentation does not present this as a user-facing risk or require confirmation before use. Users may request a coding task expecting analysis while the skill escalates to executable and write-capable behavior by default.
Profile switching explicitly replaces ~/.claude/settings.json and synchronizes token files, enabling persistent changes to authentication and routing for subsequent Claude Code runs. In the context of an auto-triggering, low-visibility skill, this persistence makes the behavior especially dangerous.
bash scripts/switch-profile.sh custom # 切换到自定义网关
切换实际上是把 `~/.claude/settings.json` 替换为目标 profile 的内容(同时同步 `.token` 文件),并把 `~/.claude/active-profile` 写成目标名。
---
The hard requirements normalize maintaining both env configuration and token files inside ~/.claude, reinforcing direct management of sensitive agent config state. This expands the blast radius of any mistaken or unauthorized write because future sessions inherit the altered credentials and endpoints.
|---|---|
| 用 `ANTHROPIC_AUTH_TOKEN`,**不要** `ANTHROPIC_API_KEY` | 后者会被 CLI 强制走 anthropic.com 鉴权链路,在境内 IDC 必然失败 |
| `~/.claude.json` 必须有 `hasCompletedOnboarding: true` | 否则 CLI 拒绝在非交互模式启动,报 `Onboarding has not been completed` |
| `~/.claude/settings.json` 的 `env` 块 + `~/.claude/.token` 文件 **二者并存** | env 块负责 base_url / model / 各类开关,.token 文件负责 Key(更安全) |
| build 模式必须显式 `--allowedTools` 白名单 | 否则默认 ask 模式会等用户交互,在沙箱里直接挂死 |
| review 模式必须用 `--permission-mode plan` | 这样不会出现写文件的副作用,review 才是真正只读 |
| ⛔ Skill 调用方**禁止**叠加 `pty: true` | run.sh 的 `</dev/null` 会被 PTY 重新打开 stdin,导致 claude 等待输入 |
Health checks inspect sensitive configuration artifacts in ~/.claude/settings.json, ~/.claude.json, and token files. Read access to these paths is security-relevant because it can reveal endpoint configuration, auth state, and potentially secret-adjacent metadata that should not be broadly exposed.
| 检查项 | 不通过时的具体表现 |
|---|---|
| `~/.claude/settings.json` 是否存在且 JSON 合法 | claude 启动会直接 abort |
| `env.ANTHROPIC_BASE_URL` 是否设置 | claude 不知道请求发往哪里 |
| 用了 `ANTHROPIC_AUTH_TOKEN` 而非 `ANTHROPIC_API_KEY` | 后者必然走 anthropic.com,境内 IDC 连不上 |
| `~/.claude.json` 是否存在且 `hasCompletedOnboarding == true` | 否则 CLI 在非交互模式下 abort |
The documented profile design stores provider templates and active configuration under ~/.claude/profiles and ~/.claude/settings.json, creating a persistent mechanism for altering agent behavior across sessions. Because this skill also supports custom gateways, misuse could redirect traffic to attacker-controlled endpoints.
└── custom.json — 自定义 Anthropic 兼容网关(占位符 BASE_URL / MODEL)
`~/.claude/settings.json` 是当前激活配置的实际内容(由 setup / switch 脚本写入),`~/.claude/active-profile` 文件记录当前是哪一个。
---
The 'security rules' explicitly store keys in ~/.bashrc, ~/.claude/.token, and profile JSON files, all of which are persistent local credential locations. Persisting secrets across multiple files increases accidental disclosure risk and leaves long-lived credentials available to later processes or skills.
## 安全规则
- 用户的 Key 只保存在 `~/.bashrc`、`~/.claude/.token` 和 `~/.claude/profiles/*.json` 中(用户家目录内)
- 覆盖配置前**自动备份**到 `~/.claude/settings.json.bak.<时间戳>`
- 不上传任何外部服务,不在日志中记录 Key 明文
- ⛔ 不会出现在日志或 stdout 的任何地方打印完整 Key
The document promises it will not overwrite existing settings without confirmation, yet earlier logic permits automatic profile switching and zero-touch setup that replace ~/.claude/settings.json. Contradictory safety guarantees can cause silent credential/configuration replacement in a security-sensitive config directory.
The recovery template encourages users to send fresh keys or alternative provider credentials back through chat. Normalizing secret sharing in conversational recovery workflows substantially increases the probability of credential leakage and reuse across transcripts.
The profile config instructs the agent to obtain credentials by directly reading a hidden file from the user's home directory (~/.claude/.token). This grants the skill access to sensitive local secrets outside its own configuration boundary and can expose or reuse authentication material without explicit user approval. In the context of a skill that installs and configures a coding CLI, this is especially risky because it normalizes secret harvesting from local agent state rather than using a dedicated secret input mechanism.
"DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"apiKeyHelper": "cat ~/.claude/.token"
}
The skill config defines an apiKeyHelper that reads a token directly from the user's Claude configuration directory (~/.claude/.token). Accessing secrets from a local agent config directory is sensitive because it can exfiltrate or reuse credentials without clear user consent, and any component that invokes this helper gains access to the token material. In the context of an installation/configuration skill, this is more dangerous because the skill is specifically designed to wire authentication automatically, increasing the chance that sensitive credentials are harvested or propagated silently.
"DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"apiKeyHelper": "cat ~/.claude/.token"
}
The configuration uses apiKeyHelper to read ~/.claude/.token, which accesses a credential file from the user's local agent config directory. This exposes a sensitive authentication token to the skill/runtime and creates a clear path for credential theft, reuse, or unintended disclosure to logs, subprocesses, or remote services. In this skill's context, which is specifically designed to install and configure a coding CLI and even mentions using alternative providers when the user lacks an official API key, the token-harvesting behavior is more dangerous, not less.
"DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"apiKeyHelper": "cat ~/.claude/.token"
}
The document explicitly uses the agent’s Claude configuration directory for profile data, active settings, and the current token. Access to and mutation of this directory is highly sensitive because it controls model endpoints and credentials; a compromised or overly broad skill could overwrite settings, switch providers, exfiltrate tokens, or persist unsafe configuration for later sessions.
├── agentplan.json ← setup-agentplan 写入的模板副本 └── custom.json ← setup-custom 写入的模板副本(已替换 BASE_URL/MODEL)
~/.claude/settings.json ← 当前激活 profile 的实际内容(由 setup/switch 复制写入) ~/.claude/.token ← 当前激活 profile 的 Key (apiKeyHelper 读这个) ~/.claude/active-profile← 文本: 当前激活的 profile 名
Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
wc -c < ~/.claude/.token # 应该非 0
# 看当前激活 profile 是哪个
cat ~/.claude/active-profile
# 重跑对应 setup
bash scripts/setup-agentplan.sh "<正确的 AgentPlan Key>"
No suspicious patterns detected.