Back to skill

Security audit

OpenClaw CLAUDE BRIDGE

Security checks for vulnerabilities and agentic risk

Overview

This Claude CLI bridge has a coherent purpose, but it gives broad local read/edit/shell power and builds executable shell scripts from prompts in unsafe ways.

Install only for a trusted, sandboxed environment. Treat this as a powerful local automation bridge, not a simple text connector: it can read files, edit files, run shell commands, and may send code or prompts through the configured Claude provider/proxy. Review or remove packaged task scripts, avoid untrusted prompt content, and restrict Claude tools and working directories before use.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
claude_bridge.py:55
Finding

Shell Command Injection Through Unsafely Embedded Prompts

Content
View full analysis
"{RESULT_DIR / f'{task_id}.txt'}" 2>&1 ``` ### Technical Analysis The application inserts the task prompt directly into a generated Bash script. It escapes only double quotation marks, which is insufficient for content placed inside a double-quoted shell argument. Bash continues to interpret command substitution, backticks, variable expansion, and some backslash sequences inside double quotes. Consequently, prompt content such as `$(command)` or a backtick command is evaluated by Bash before the prompt is passed to the Claude CLI. The generated script is subsequently executed with: ```python result = subprocess.run( ["bash", str(script_file)], capture_output=True, text=True, timeout=timeout ) ``` Using an argument array for the outer `subprocess.run()` call does not mitigate the vulnerability because the generated file is explicitly interpreted by Bash. ### Attack Path 1. An attacker supplies a malicious prompt through the command-line `create` operation or any API that reaches `create_task()`. 2. The prompt contains shell syntax, for example `$(touch /tmp/bridge-pwned)`. 3. `create_task()` embeds that syntax in the double-quoted `claude -p` argument of an executable shell script. 4. The user or application invokes `execute_task_local()` for the generated task. 5. Bash performs command substitution before starting the Claude CLI. 6. The injected command runs with the operating-system privileges of the bridge process. This exploitation path does not depend on persuading the language model to call a tool and therefore bypasses Claude CLI tool-permission controls. ### Impact Assessment Successful exploitation permits arbitrary command execution under the account running the bridge. Dependi ...[truncated 365 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
claude_bridge.py:29
Finding

Path Traversal in Task and Result Identifiers

Content
View full analysis
Remediation
View remediation
str: if not TASK_ID_PATTERN.fullmatch(task_id): raise ValueError("Invalid task identifier") return task_id ``` Use a containment check as a second line of defense: ```python def safe_child(base: Path, filename: str) -> Path: base = base.resolve() candidate = (base / filename).resolve() if candidate.parent != base: raise ValueError("Path escapes the approved directory") return candidate ``` Additional controls should include: 1. Generate identifiers internally with `uuid.uuid4()` rather than accepting caller-selected identifiers. 2. Apply validation consistently in creation, execution, status, and result-reading functions. 3. Refuse symbolic links and verify file type before execution. 4. Open newly created files with exclusive creation semantics where overwriting is not required. 5. Avoid making generated files executable when direct subprocess invocation can replace shell scripts. 6. Add tests for `../`, absolute paths, repeated separators, symbolic links, encoded separators, and excessively long identifiers. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
claude_bridge.py:55
Finding

Excessive Default Claude CLI Tool Permissions

Content
View full analysis
"{RESULT_DIR / f'{task_id}.txt'}" 2>&1 ``` The same unrestricted tool set is present in every generated task script under `tasks/*.sh`, including tasks intended only to inspect or analyze files. A stored task also explicitly requests broad access: ```json { "id": "fix_web_ui_full_access", "prompt": "You now have full filesystem access. Repair the Web UI and directly modify files and start the server to verify the repair." } ``` The quotation above is an English rendering of the stored task instruction; the underlying artifact is written in another language. ### Technical Analysis All task types receive `Read`, `Edit`, and `Bash` permissions by default. This includes operations such as code generation, data analysis, and read-only code review that do not inherently require arbitrary file modification or command execution. The bridge provides no task-specific permission policy, workspace path allowlist, command allowlist, approval boundary, or separation between read-only and mutating operations. A malicious, compromised, or simply incorrect prompt can therefore induce actions beyond the legitimate scope of the requested task. This finding is separate from the direct shell-injection vulnerability. Even after shell-safe subprocess invocation is implemented, the language model would retain broad authority to execute Bash commands and alter files. ### Attack Path 1. An untrusted user submits a task description or data-analysis request containing adversarial instructions. 2. The bridge creates and runs the task without classifying its required privileges. 3. The Claude CLI receives `Read`, `Edit`, and `Bash` permissions automatically. 4. The model follows the supplied or indirectly encountered inst ...[truncated 998 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (116)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is described as a simple bridge, but the documentation shows it executes tasks locally, uses filesystem paths, and writes output/status files without any declared permission model. This can mislead users about the breadth of local effects and creates a path to unreviewed command execution and persistent changes on disk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The generated command grants the Claude CLI the Bash tool in addition to Read and Edit, which allows arbitrary shell-command execution on the local machine. In a bridge skill, this is especially dangerous because user-supplied prompts can influence the downstream agent to execute local commands, inspect files, modify code, or interact with the environment well beyond a simple text bridge.

Content

No source excerpt is available for this finding.

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
91% confidence
Finding

The skill routes user content to an external/local model provider (Claude CLI) and gives it powerful tools without prominent disclosure or granular consent. Even though using another provider may be the intended purpose of the bridge, it is security-relevant because sensitive prompts, code, and local context may be exposed to another execution environment that can read, edit, and run shell commands.

Content

Scanner excerpt · claude_bridge.py (reported line 55)May include surrounding context.

python
echo ""

# 执行 Claude Code
claude -p "{prompt.replace('"', '\\"')}" --allowedTools "Read,Edit,Bash" > "{RESULT_DIR / f'{task_id}.txt'}" 2>&1

# 标记完成
echo '{{"status": "completed", "completed_at": "'$(date -Iseconds)'"}}' > "{RESULT_DIR / f'{task_id}.json'}"

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

The skill explicitly delegates analysis of a local source tree to an external model/CLI provider, which can increase data exposure risk if sensitive source code is transmitted outside the local trust boundary. In this context, the danger is elevated because the prompt requests deep analysis of an entire codebase and the manifest does not clearly communicate that broad code inspection and possible provider handling will occur.

Content

Scanner excerpt · tasks/analyze_claude_code_source.sh (reported line 17)May include surrounding context.

sh
echo ""

# 执行 Claude Code
claude -p "请深度分析 /Users/mars/.openclaw/workspace/claude-code-source/ 目录下的 Claude Code 源码。

分析要求:

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
95% confidence
Finding

The script sends a local source file to an external CLI/model provider (claude) and explicitly permits tools including Read, Edit, and Bash. In the context of a bridge skill to a local Claude CLI, this expands the trust boundary and can expose local code or enable unintended model-driven file/system actions, especially since the target path is hard-coded and the invocation is non-interactive.

Content

Scanner excerpt · tasks/analyze_commands_system.sh (reported line 16)May include surrounding context.

sh
echo ""

# 执行 Claude Code
claude -p "请分析 /Users/mars/.openclaw/workspace/claude-code-source/src/commands.ts 文件。

重点关注:
1. Slash命令系统架构

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
91% confidence
Finding

The skill routes local source code to an external model provider via the claude CLI, selecting an external AI system to process a specific file. This is dangerous because the file contents may contain proprietary code, credentials, or internal design details, and the transfer happens implicitly within the skill without any visible data-classification check, consent gate, or provider-boundary warning.

Content

Scanner excerpt · tasks/analyze_query_engine.sh (reported line 15)May include surrounding context.

sh
echo ""

# 执行 Claude Code
claude -p "请分析 /Users/mars/.openclaw/workspace/claude-code-source/src/QueryEngine.ts 文件。

重点关注:
1. Query Engine 的核心架构

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · tasks/analyze_tools_system.sh (reported line 16)May include surrounding context.

sh
echo ""

# 执行 Claude Code
claude -p "请分析 /Users/mars/.openclaw/workspace/claude-code-source/src/tools.ts 文件。

重点关注:
1. 工具系统的架构设计

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The task requests only read-only source analysis, yet it grants the Claude CLI both Edit and Bash capabilities. This violates least privilege and creates unnecessary ability for the invoked agent to modify files or execute shell commands in the local environment, which materially increases risk if the model is prompted unexpectedly, compromised, or the task content changes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The task directs the agent to read and modify a source file in a different skill workspace (a-stock-monitor), which is outside the stated purpose of a local Claude CLI bridge. This creates a cross-skill modification channel that can be abused to tamper with unrelated code, expand persistence, or bypass normal review boundaries.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The task grants arbitrary file-editing behavior across workspaces without justification tied to the bridge’s declared function. A bridge skill should not implicitly authorize reading and rewriting unrelated local files, because that enables unauthorized code changes, supply-chain tampering, and lateral impact across other skills/projects.

Content

No source excerpt is available for this finding.

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

The script delegates file-reading and code-editing decisions to an external model/provider via the local Claude CLI, creating a trust boundary where sensitive project contents and write actions depend on another tool's behavior. In this context, the risk is elevated because the model is authorized with Read, Edit, and Bash capabilities against local files, including a different skill workspace.

Content

Scanner excerpt · tasks/fix_db_cache_002.sh (reported line 14)May include surrounding context.

sh
echo ""

# 执行 Claude Code
claude -p "读取文件 /Users/mars/.openclaw/workspace/skills/a-stock-monitor/scripts/stock_cache_db.py。

找到所有使用 sqlite3.connect() 但没有使用 with 语句的地方。
将类似:

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

This duplicate EA5 finding points to the same claude -p invocation that sends instructions and grants editing capability to an external model-backed CLI. Given the bridge skill context, the provider selection is more dangerous because it is embedded in an automation path that can silently modify unrelated local code and emit status artifacts.

Content

Scanner excerpt · tasks/fix_db_kairos_001.sh (reported line 13)May include surrounding context.

sh
echo ""

# 执行 Claude Code
claude -p "读取文件 /Users/mars/.openclaw/workspace/skills/kairos-mode/setup_trading_monitors.py,检查第20行附近的数据库连接代码。

当前代码:
    conn = sqlite3.connect(db_path)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

This duplicate EA5 finding points to the same claude -p invocation that sends instructions and grants editing capability to an external model-backed CLI. Given the bridge skill context, the provider selection is more dangerous because it is embedded in an automation path that can silently modify unrelated local code and emit status artifacts.

Content

Scanner excerpt · tasks/fix_db_kairos_001.sh (reported line 13)May include surrounding context.

sh
echo ""

# 执行 Claude Code
claude -p "读取文件 /Users/mars/.openclaw/workspace/skills/kairos-mode/setup_trading_monitors.py,检查第20行附近的数据库连接代码。

当前代码:
    conn = sqlite3.connect(db_path)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

The script delegates code reading and editing to an external model/CLI without visible trust controls, sandboxing, or path restrictions, and includes write-capable tools. In this context, the danger is heightened because the external model is instructed to modify a different local project, which can leak source content to the provider or cause unauthorized code changes depending on the CLI's configuration.

Content

Scanner excerpt · tasks/fix_db_memory_003.sh (reported line 14)May include surrounding context.

sh
echo ""

# 执行 Claude Code
claude -p "读取文件 /Users/mars/.openclaw/workspace/skills/agent-memory/src/memory.py。

这个文件有多个 sqlite3.connect() 调用(约20处),但没有使用 with 语句。