Back to skill

Security audit

Acpx Connection Troubleshooting

Security checks for vulnerabilities and agentic risk

Overview

This troubleshooting skill is mostly purpose-aligned, but it includes unsafe credential-handling instructions that can overwrite a persistent gateway token with a hardcoded token-like value.

Review this skill carefully before installing. It is aimed at legitimate acpx/OpenClaw troubleshooting, but do not run the example command with the hardcoded token value, do not paste API keys or token file contents into chat, and back up or verify any existing ~/.openclaw/gateway.token before changing it.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:45
Finding

Hardcoded Gateway Authentication Token in Troubleshooting Documentation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 45–48
Vulnerability Type: Hardcoded authentication credential
Risk Level: High

Vulnerable Code

bash
# 修复命令(替换为实际 token)
echo "5b56cfe28d8675390f3a39691e63999be50947e06dec1007" > ~/.openclaw/gateway.token

Technical Analysis

The troubleshooting documentation embeds a 48-character hexadecimal value in a copyable command that writes directly to the OpenClaw Gateway authentication-token file. The value resembles a real credential rather than an unambiguous placeholder.

Although the accompanying comment tells users to replace the token, executing the command as written stores the embedded value in ~/.openclaw/gateway.token. Publishing a potentially valid credential exposes it to every recipient of the Skill. The command can also overwrite an existing legitimate token without confirmation.

No evidence establishes that the token remains active. Nevertheless, credential-like values must be treated as compromised once distributed.

Attack Path

  1. An attacker obtains or views the distributed Skill.
  2. The attacker extracts the embedded hexadecimal token from SKILL.md.
  3. The attacker identifies a reachable OpenClaw Gateway associated with that credential.
  4. If the token is valid and sufficient for Gateway authentication, the attacker submits it during the WebSocket authentication flow.
  5. The attacker gains whatever Gateway access and operations are authorized to that token.

A separate user-impact path also exists:

  1. A user follows the troubleshooting instructions without replacing the example value.
  2. The shell redirects the embedded token into ~/.openclaw/gateway.token, overwriting any existing content.
  3. Subsequent ACP connections authenticate with the unintended token and may fail or operate under unintended authorization.

Impact Assessment

If the embedded value is an active or reused credential, its disclosure could enable unauthorized authentication to a ...[truncated 523 chars]

Remediation
View remediation

Remediation Suggestions

  1. Revoke and rotate the embedded token immediately if it was ever valid.
  2. Replace the value with an unmistakable placeholder:
bash
printf '%s\n' "YOUR_GATEWAY_TOKEN" > ~/.openclaw/gateway.token
chmod 600 ~/.openclaw/gateway.token
  1. Warn users that the command overwrites an existing file, or prevent accidental replacement:
bash
if [ -e "$HOME/.openclaw/gateway.token" ]; then
  echo "Refusing to overwrite the existing gateway token." >&2
  exit 1
fi

umask 077
printf '%s\n' "YOUR_GATEWAY_TOKEN" > "$HOME/.openclaw/gateway.token"
  1. Prefer protected interactive input so the credential is not recorded directly in shell history:
bash
mkdir -p "$HOME/.openclaw"
chmod 700 "$HOME/.openclaw"
read -rsp "Gateway token: " GATEWAY_TOKEN
printf '\n'
umask 077
printf '%s\n' "$GATEWAY_TOKEN" > "$HOME/.openclaw/gateway.token"
unset GATEWAY_TOKEN
  1. If documenting extraction from openclaw.json, avoid printing the token to terminal output or logs, validate the source file's permissions, and write the extracted value directly to a mode-600 destination.
  2. Add secret scanning to the publication workflow to reject token-like values before Skill packages are distributed.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

This example normalizes direct handling of a sensitive API key inside a user config file and may encourage copying, viewing, or sharing credential-bearing content during troubleshooting. In a support skill, embedding secret-bearing config examples increases the chance of inadvertent credential disclosure, especially if users mirror the example in logs or transcripts.

Content

Scanner excerpt · SKILL.md (reported line 32)May include surrounding context.

  • 原因:acpx 调用的是本地 CLI 配置,若 API Key 失效或端点错误,会卡在认证阶段。
json
// ~/.claude/config.json 示例
{
  "apiEndpoint": "https://coding.dashscope.aliyuncs.com/apps/anthropic",
  "apiKey": "sk-sp-[REDACTED]",

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 27)May include surrounding context.

md
| 组件 | 配置文件路径 | 用途 | 常见误区 |
|------|--------------|------|----------|
| **OpenClaw 主 Agent** | `~/.openclaw/openclaw.json` | 控制主对话流、内置模型调用、路由绑定 | 误以为修改此处会影响 `acpx claude` 的模型行为 |
| **Claude Code CLI** | `~/.claude/config.json` | 控制 `acpx claude` 的模型后端、API Key 及端点 | 误以为主 Agent 能通则 CLI 也能通(Key 权限可能不同) |
| **Gateway 认证** | `~/.openclaw/gateway.token` | ACP 桥接握手令牌 (WebSocket 认证) | 文件缺失导致 `acpx openclaw` 直接超时,而非认证错误 |

**排查原则**:

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 72)May include surrounding context.

md
| 组件 | 配置文件路径 | 用途 | 常见误区 |
|------|--------------|------|----------|
| **OpenClaw 主 Agent** | `~/.openclaw/openclaw.json` | 控制主对话流、内置模型调用、路由绑定 | 误以为修改此处会影响 `acpx claude` 的模型行为 |
| **Claude Code CLI** | `~/.claude/config.json` | 控制 `acpx claude` 的模型后端、API Key 及端点 | 误以为主 Agent 能通则 CLI 也能通(Key 权限可能不同) |
| **Gateway 认证** | `~/.openclaw/gateway.token` | ACP 桥接握手令牌 (WebSocket 认证) | 文件缺失导致 `acpx openclaw` 直接超时,而非认证错误 |

**排查原则**:

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 128)May include surrounding context.

md
| 组件 | 配置文件路径 | 用途 | 常见误区 |
|------|--------------|------|----------|
| **OpenClaw 主 Agent** | `~/.openclaw/openclaw.json` | 控制主对话流、内置模型调用、路由绑定 | 误以为修改此处会影响 `acpx claude` 的模型行为 |
| **Claude Code CLI** | `~/.claude/config.json` | 控制 `acpx claude` 的模型后端、API Key 及端点 | 误以为主 Agent 能通则 CLI 也能通(Key 权限可能不同) |
| **Gateway 认证** | `~/.openclaw/gateway.token` | ACP 桥接握手令牌 (WebSocket 认证) | 文件缺失导致 `acpx openclaw` 直接超时,而非认证错误 |

**排查原则**:

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

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.

Content

Scanner excerpt · evals/evals.json (reported line 26)May include surrounding context.

json
| 组件 | 配置文件路径 | 用途 | 常见误区 |
|------|--------------|------|----------|
| **OpenClaw 主 Agent** | `~/.openclaw/openclaw.json` | 控制主对话流、内置模型调用、路由绑定 | 误以为修改此处会影响 `acpx claude` 的模型行为 |
| **Claude Code CLI** | `~/.claude/config.json` | 控制 `acpx claude` 的模型后端、API Key 及端点 | 误以为主 Agent 能通则 CLI 也能通(Key 权限可能不同) |
| **Gateway 认证** | `~/.openclaw/gateway.token` | ACP 桥接握手令牌 (WebSocket 认证) | 文件缺失导致 `acpx openclaw` 直接超时,而非认证错误 |

**排查原则**:

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

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.

Content

Scanner excerpt · evals/evals.json (reported line 28)May include surrounding context.

json
| 组件 | 配置文件路径 | 用途 | 常见误区 |
|------|--------------|------|----------|
| **OpenClaw 主 Agent** | `~/.openclaw/openclaw.json` | 控制主对话流、内置模型调用、路由绑定 | 误以为修改此处会影响 `acpx claude` 的模型行为 |
| **Claude Code CLI** | `~/.claude/config.json` | 控制 `acpx claude` 的模型后端、API Key 及端点 | 误以为主 Agent 能通则 CLI 也能通(Key 权限可能不同) |
| **Gateway 认证** | `~/.openclaw/gateway.token` | ACP 桥接握手令牌 (WebSocket 认证) | 文件缺失导致 `acpx openclaw` 直接超时,而非认证错误 |

**排查原则**:

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

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.

Content

Scanner excerpt · references/acp-bridge-config-reference.md (reported line 11)May include surrounding context.

md
| 组件 | 配置文件路径 | 用途 | 常见误区 |
|------|--------------|------|----------|
| **OpenClaw 主 Agent** | `~/.openclaw/openclaw.json` | 控制主对话流、内置模型调用、路由绑定 | 误以为修改此处会影响 `acpx claude` 的模型行为 |
| **Claude Code CLI** | `~/.claude/config.json` | 控制 `acpx claude` 的模型后端、API Key 及端点 | 误以为主 Agent 能通则 CLI 也能通(Key 权限可能不同) |
| **Gateway 认证** | `~/.openclaw/gateway.token` | ACP 桥接握手令牌 (WebSocket 认证) | 文件缺失导致 `acpx openclaw` 直接超时,而非认证错误 |

**排查原则**:

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

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.

Content

Scanner excerpt · references/acp-bridge-config-reference.md (reported line 15)May include surrounding context.

md
| 组件 | 配置文件路径 | 用途 | 常见误区 |
|------|--------------|------|----------|
| **OpenClaw 主 Agent** | `~/.openclaw/openclaw.json` | 控制主对话流、内置模型调用、路由绑定 | 误以为修改此处会影响 `acpx claude` 的模型行为 |
| **Claude Code CLI** | `~/.claude/config.json` | 控制 `acpx claude` 的模型后端、API Key 及端点 | 误以为主 Agent 能通则 CLI 也能通(Key 权限可能不同) |
| **Gateway 认证** | `~/.openclaw/gateway.token` | ACP 桥接握手令牌 (WebSocket 认证) | 文件缺失导致 `acpx openclaw` 直接超时,而非认证错误 |

**排查原则**:

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

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.

Content

Scanner excerpt · references/acp-bridge-config-reference.md (reported line 46)May include surrounding context.

md
| 组件 | 配置文件路径 | 用途 | 常见误区 |
|------|--------------|------|----------|
| **OpenClaw 主 Agent** | `~/.openclaw/openclaw.json` | 控制主对话流、内置模型调用、路由绑定 | 误以为修改此处会影响 `acpx claude` 的模型行为 |
| **Claude Code CLI** | `~/.claude/config.json` | 控制 `acpx claude` 的模型后端、API Key 及端点 | 误以为主 Agent 能通则 CLI 也能通(Key 权限可能不同) |
| **Gateway 认证** | `~/.openclaw/gateway.token` | ACP 桥接握手令牌 (WebSocket 认证) | 文件缺失导致 `acpx openclaw` 直接超时,而非认证错误 |

**排查原则**:

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The description says the skill should trigger even when the user does not explicitly mention 'acpx', including broad phrases like 'CLI 连不上网关' or '子代理调用失败'. Those phrases are generic enough to overlap with many unrelated networking or agent failures, making invocation scope unclear.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs users to create or overwrite a persistent authentication token file and even shows a concrete token value without an explicit warning about secret handling. This can lead to credential exposure in shell history, copied transcripts, screenshots, or accidental token replacement, weakening gateway authentication hygiene.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicated finding points to the same behavior: persisting a gateway authentication token in ~/.openclaw/gateway.token without discussion of retention, rotation, or cleanup. In context, persistence is operationally useful, but still raises credential-at-rest risk if the host or home directory is exposed.

Content

Scanner excerpt · SKILL.md (reported line 115)May include surrounding context.

Gateway 认证修复

bash
# 确保目录存在
mkdir -p ~/.openclaw
# 写入 token
echo "YOUR_GATEWAY_TOKEN" > ~/.openclaw/gateway.token
chmod 600 ~/.openclaw/gateway.token

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicated finding points to the same behavior: persisting a gateway authentication token in ~/.openclaw/gateway.token without discussion of retention, rotation, or cleanup. In context, persistence is operationally useful, but still raises credential-at-rest risk if the host or home directory is exposed.

Content

Scanner excerpt · SKILL.md (reported line 115)May include surrounding context.

Gateway 认证修复

bash
# 确保目录存在
mkdir -p ~/.openclaw
# 写入 token
echo "YOUR_GATEWAY_TOKEN" > ~/.openclaw/gateway.token
chmod 600 ~/.openclaw/gateway.token

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 118)May include surrounding context.

mkdir -p ~/.openclaw

写入 token

echo "YOUR_GATEWAY_TOKEN" > ~/.openclaw/gateway.token chmod 600 ~/.openclaw/gateway.token

text

## 环境与前置条件

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This JSON file contains all sample prompts and expected responses in Chinese, which implicitly constrains the skill's behavior and evaluation to a single language. Under the policy rule, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.