Back to skill

Security audit

Claude Code Bridge

Security checks for vulnerabilities and agentic risk

Overview

This skill openly provides remote Claude Code terminal control from chat, but its broad passthrough, raw history exposure, weak session isolation, and persistent logs need careful review before installation.

Install only if you intend to give trusted chat participants remote control over a local Claude Code terminal. Avoid group chats and sensitive repositories unless access is tightly controlled, treat approvals as permission to run local commands or change files, and consider fixing session ID hashing, transcript permissions, CLAUDE_BIN launch handling, and generic key injection 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
scripts/cc-bridge.sh:27
Finding

Environment-Controlled Command Injection Through CLAUDE_BIN

Content
View full analysis
" start ``` 4. `do_start` interpolates the malicious value into `launch_cmd`. 5. The nested `bash --login -c` evaluates the injected syntax. 6. The attacker's comm ...[truncated 614 chars]
Remediation
View remediation
&2 return 1 } [[ -f "$CLAUDE_BIN" && -x "$CLAUDE_BIN" ]] || { echo "[cc-bridge] CLAUDE_BIN is not an executable file" >&2 return 1 } tmux new-session -d -s "$TMUX_NAME" -x 220 -y 50 \ env -u CLAUDECODE -u CLAUDE_CODE TERM=xterm-256color \ "$CLAUDE_BIN" ``` - If a login shell is strictly required, supply the executable through a positional parameter rather than interpolating it: ```bash tmux new-session -d -s "$TMUX_NAME" -x 220 -y 50 \ bash --login -c 'unset CLAUDECODE CLAUDE_CODE; export TERM=xterm-256color; exec "$1"' \ cc-bridge "$CLAUDE_BIN" ``` - Consider removing the environment override entirely when runtime configurability is unnecessary. - Run the bridge under a dedicated, least-privileged operating-system account. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/cc-bridge.sh:42
Finding

Session Identifier Collisions Allow Cross-Chat Session Access

Content
View full analysis
Remediation
View remediation
&2 exit 1 fi ``` - Do not use truncation alone to construct a security-sensitive identifier. - Derive the tmux name from a collision-resistant digest of the complete channel and chat identifier: ```bash SESSION_HASH="$(printf '%s' "$SESSION_ID" | sha256sum | awk '{print $1}')" TMUX_NAME="ccb_${SESSION_HASH:0:32}" ``` On systems without `sha256sum`, use an equivalent trusted hashing utility. - Include both the channel and full chat identifier in the hashed input, with unambiguous separators. - Store a protected ownership record mapping the generated tmux name to the exact original identifier. - Before every action, verify that the requesting conversation matches the ownership record. - Reject empty identifiers and fail closed if ownership metadata is missing or inconsistent. - Add tests covering punctuation variants, identifiers longer than 20 characters, Unicode input, empty input, and deliberately colliding prefixes. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/cc-bridge.sh:28
Finding

Terminal Transcripts May Be Created With Excessive Filesystem Permissions

Content
View full analysis
"$LOG_FILE" echo "0" > "$OFFSET_FILE" ``` ```bash # 通过 pipe-pane 把所有输出追加到日志(用于 wait_for_stable_output 的 size 检测) tmux pipe-pane -t "$TMUX_NAME" -o "cat >> '$LOG_FILE'" ``` ### Technical Analysis The bridge stores Claude Code terminal output in persistent log files under `$HOME/.openclaw/cc-bridge`. Neither the directory nor the files are assigned explicit restrictive permissions, and the script does not set a secure `umask`. Their effective permissions therefore depend on the environment from which OpenClaw was launched. With a permissive or common `umask`, the directory and transcript files may be readable by other local users or service accounts. The logs can contain source code, command output, file contents, project paths, operational details, and secrets accidentally displayed by Claude Code or subprocesses. The offset files are less sensitive, but they share the same insecure creation pattern. In addition, storing a complete stream through `tmux pipe-pane` expands the amount of sensitive data retained on disk. ### Attack Path 1. OpenClaw starts the bridge under an account with a permissive `umask`. 2. The script creates the state directory, transcript, and offset files without explicit ...[truncated 913 chars]
Remediation
View remediation
"$OFFSET_FILE" chmod 600 "$OFFSET_FILE" ``` - Verify that `$STATE_DIR` is owned by the current user and is not a symbolic link before writing files. - Minimize transcript retention. If logs are needed only for output-stability detection, consider a mechanism that does not persist complete terminal contents. - Delete logs promptly when sessions end and implement bounded rotation for crashed or abandoned sessions. - Document that terminal output may contain secrets and avoid printing credentials in Claude Code sessions. - Run OpenClaw under a dedicated account whose home directory is not accessible to unrelated users. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs the agent to route every incoming message to a persistent CLI session whenever CC mode is active, effectively turning the chat channel into a remote terminal input path. Because the same session persists across turns and users can later inspect state via peek/history, accidental secrets, unrelated chat content, or prior session data can be exposed or acted upon out of context.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill exposes raw terminal screen and history contents back into chat through plain-language workflows, which can leak secrets, file contents, command output, environment data, or prior conversation context. In group chats or shared channels, this materially increases the chance of unauthorized disclosure beyond the original terminal environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly markets arbitrary message forwarding into a real interactive Claude Code terminal session, but does not prominently warn that this gives remote chat participants a path to trigger command execution, file reads/writes, git operations, and other host-side actions through the bridged CLI. In the context of group chats or compromised messaging accounts, this can materially increase the chance of unsafe use because users may treat the bridge like a harmless chatbot rather than remote terminal control.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README describes features like peek/history and relaying terminal output back to chat channels, but does not clearly warn that terminal contents, conversation history, file excerpts, command output, secrets, and other sensitive local data may be transmitted through third-party messaging services. This omission is risky because users may unknowingly expose private project data or credentials to external chat infrastructure, chat logs, or other chat participants.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill advertises remote approval handling for Claude Code actions but does not clearly warn that approvals may authorize system-modifying operations such as file edits, command execution, or other tool actions. A user approving from a chat app may not understand the scope of what they are authorizing, increasing the risk of unsafe remote actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill transparently forwards ordinary chat messages into a persistent Claude Code terminal session, but the description does not clearly warn users that their messages may be injected into a live CLI and retained in terminal/session history. This creates a consent and data-exposure risk because users may share sensitive content in chat without realizing it is being passed to tools and exposed in ongoing terminal context.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The long-task workflow explicitly tells the agent to inspect active terminal state and provide progress updates from CLI output back into chat. This increases the exposure window for sensitive intermediate output and may reveal partial results, internal paths, or tool output that was never intended for broad chat distribution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation explicitly says that all messages in CC mode are forwarded to Claude Code and that users can approve command execution and file read/write actions, but it does not clearly warn about privacy, data exfiltration, or system-impact risks. In this skill’s context, bridging a chat interface to a persistent CLI session increases danger because users may casually send sensitive data or approve destructive actions from a mobile or group chat without understanding the consequences.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This shell script includes natural-language usage text entirely in Chinese, including invocation guidance such as the expected phrases for starting or stopping the session. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

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 operations that turn the chat bridge into a remote terminal/TUI controller, not just a Claude Code session manager. In this skill context, any chat-originated user who can invoke the bridge may manipulate the live CLI state machine and approve, cancel, navigate, or trigger actions that exceed the manifest’s narrower approval-and-message-routing purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The messages instruct users to send Chinese phrases like "关闭cc" and "启动cc" to control the skill, which imposes a language-specific interaction pattern. Because no language choice or justification is provided, this conflicts with the language/locale policy for natural-language behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The do_key handler permits broad special-key injection including navigation keys, control keys, and alt/meta combinations into a persistent tmux-hosted Claude Code session. This effectively grants remote interactive control over the terminal UI, enabling bypass of intended approval workflows, unintended command execution paths, or manipulation of prior prompts/history through a chat interface that may be weaker than a local shell trust boundary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

SQP-3 covers natural-language policy violations across all file types, including forcing a specific language without user opt-in. This usage file presents all instructions and interaction guidance only in Chinese, with no indication of alternate language support or user choice.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.