Back to skill

Security audit

claude-code-bridge

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-coherent, but needs review because it exposes a chat-controlled persistent local Claude Code terminal and has a confirmed startup command-injection risk.

Install only if you intentionally want chat users on those channels to control a local Claude Code terminal. Use sandbox mode or a low-privilege account, avoid sensitive directories, restrict who can message the bot, avoid project-wide approvals unless you understand the requested action, and treat /cc peek/history output as potentially sensitive. The startup command-injection and session-collision issues should be fixed before use in shared, remote, or multi-user environments.

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
scripts/claude-code-bridge.sh:136
Finding

Shell Command Injection Through the Working Directory Argument

Content
View full analysis
"$SANDBOX_FLAG" else # Expand ~ to $HOME workdir="${workdir/#\~/$HOME}" fi # Verify that the directory exists if [[ ! -d "$workdir" ]]; then echo "[claude-code-bridge] ❌ Directory does not exist: $workdir" rm -f "$SANDBOX_FLAG" return 1 fi # Record the working directory echo "$workdir" > "$WORKDIR_FILE" # Build startup command local launch_cmd launch_cmd="cd '$workdir' && unset CLAUDECODE CLAUDE_CODE; export TERM=xterm-256color; exec '$CLAUDE_BIN'" # Start Claude inside tmux tmux new-session -d -s "$TMUX_NAME" -x 220 -y 50 "bash --login -c '$launch_cmd'" ``` ### Technical Analysis The working directory is derived from the third command-line argument, which the Skill instructions populate from a path supplied through a chat message. Although the script verifies that the path identifies an existing directory, it later interpolates that value into a shell command using manually constructed single quotes. A single quote inside the directory name can terminate the intended quoting context. Subsequent shell metacharacters in that directory name can then become executable shell syntax when the generated string is evaluated by `bash --login -c`. There are two nested levels of shell command interpretation: 1. `launch_cmd` embeds `workdir` and `CLAUDE_BIN` in a command string. 2. That command string is embedded again in the argument passed to `bash --login -c`. The directory existence check does not prevent exploitation because Unix file names may legally contain qu ...[truncated 2019 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/claude-code-bridge.sh:42
Finding

Cross-Chat Session Access Through Colliding Session Identifiers

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/claude-code-bridge.sh:31
Finding

Sensitive Claude Code Transcripts Stored Without Enforced Private Permissions

Content
View full analysis
"$WORKDIR_FILE" # Clear old log > "$LOG_FILE" echo "0" > "$OFFSET_FILE" ``` ```bash tmux pipe-pane -t "$TMUX_NAME" -o "cat >> '$LOG_FILE'" ``` ### Technical Analysis The script creates a state directory and several files without setting a restrictive `umask` or explicitly applying secure modes. The effective permissions therefore depend on the environment inherited by the script. Under a common `umask` of `022`: - Newly created directories are commonly mode `0755`. - Newly created regular files are commonly mode `0644`. This can allow other local users to traverse the state directory and read terminal transcripts or metadata. The transcript is generated by `tmux pipe-pane` and may contain source code, command output, file contents, error messages, tokens printed by tools, or other sensitive project information. The working-directory file also discloses project locations. The sandbox marker identifies temporary directories, while the output offset reveals less sensitive operational state. Although `do_stop` removes these files, they remain present for the lifetime of the session and may persist if the p ...[truncated 1341 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explicitly advertises that the skill exposes a real interactive terminal over chat and supports command execution, file writes, and Git operations, but it does not prominently warn users about the security consequences of granting remote chat-originated access to a persistent local CLI session. This is dangerous because operators may deploy it without understanding that any compromise of the chat account, channel, bot routing, or authorization logic could translate into local code execution and data modification on the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly routes every incoming message to a persistent Claude Code session whenever CC mode is active, but the documentation does not clearly warn users that ordinary chat messages will be forwarded into that live CLI context. This creates a serious risk of unintended command execution, sensitive data exposure, and confusion about when the user is talking to OpenClaw versus controlling an active coding agent, especially across messaging platforms where users may casually send unrelated content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The startup flow allows launching Claude Code in a user-specified working directory, including paths like home or project directories, without clearly warning that the connected agent may read, modify, or delete files there. In this skill's context, that omission is especially dangerous because the bridge connects remote chat input to a persistent CLI agent, so a mistaken or socially engineered directory choice could expose sensitive local data or permit destructive file operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The approval-flow section explains how to translate user responses into approval choices, but it does not clearly warn that approving a prompt may authorize impactful tool actions such as running commands, modifying files, or accessing sensitive project resources. Because approvals are being relayed through chat rather than a local interactive terminal, users may approve actions with reduced context, making accidental over-authorization more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The guide explicitly tells users that Claude Code may request approval for command execution and file read/write operations, but it does not clearly warn that approving these actions can expose sensitive data, modify important files, or execute harmful commands on the host system. In this skill’s context, that omission is more dangerous because all chat messages in CC mode are forwarded into a persistent CLI session, increasing the chance that a user casually approves risky actions from a messaging interface without full situational awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Comments and user-visible status/error strings throughout the script are written in Chinese, and there is no mechanism to select another language or opt in to this locale. This can violate language/locale policy where tools must not force a specific language on users without choice or clear justification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script exposes interrupt and especially key actions that let a chat-originated request inject control keys directly into the tmux-backed Claude Code session. In this skill context, the bridge is reachable from messaging channels and is meant to proxy natural-language interaction plus approval handling, so arbitrary key injection materially expands the attack surface by allowing out-of-band control of the terminal UI and approval flows beyond the declared purpose.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
88% confidence
Finding

The script defaults to using the caller-supplied or current working directory and only enters sandbox mode when --sandbox is explicitly requested or no directory is provided. For a chat-triggered bridge to a powerful coding agent, making non-sandbox execution the default increases the chance that untrusted or accidental prompts operate directly on real user files and repositories.

Content

Scanner excerpt · scripts/claude-code-bridge.sh (reported line 137)May include surrounding context.

sh
# 解析工作目录参数
    local workdir="${MESSAGE:-}"
    local is_sandbox=0

    if [[ "$workdir" == "--sandbox" || -z "$workdir" ]]; then
        # 沙盒模式:创建临时目录

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script pipes the full tmux pane output into a persistent log file under ~/.openclaw/claude-code-bridge without notifying the user that Claude responses and terminal content are being retained. In a chat-bridge context, that output may include secrets, file contents, prompts, tokens, or sensitive operational data, creating avoidable local data exposure and retention risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The peek and history actions expose captured terminal content back through the chat interface, which can surface secrets or private data present in the Claude Code session. In this multi-channel messaging context, that is especially risky because anyone with access to the chat control path may retrieve prior terminal output that was not intended to be re-shared.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

do_key() accepts a broad set of navigation and control sequences (ctrl+*, alt+*, arrows, tab, escape) and forwards them to the live Claude Code terminal. Because this skill bridges remote chat platforms to a persistent interactive session, that capability can be abused to manipulate the TUI, alter prompts, confirm actions, interrupt safeguards, or access interface states that simple message forwarding would not expose.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.