Back to skill

Security audit

Claw Connector

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its collaboration purpose, but it has review-worthy risks around peer-controlled text entering agent context, confusing proposal actions, and relay-token controls.

Review before installing. Use this only with peers you trust, avoid putting secrets in task handoffs or proposals, prefer a virtual environment with pinned dependencies, and be aware that generated address tokens and public IP hints are shared through the relay. The prompt-injection and proposal-action mismatch should be fixed before relying on it for sensitive work.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T01 · Skill Instruction Hijacking

Error
Location
hooks/diplomat-bootstrap/handler.ts:40
Finding

Persistent Prompt Injection Through Peer-Controlled Bootstrap Context

Content
View full analysis
str: """Strip Unicode direction-override characters. SECURITY T1.""" return "".join(ch for ch in text if ord(ch) not in _DIRECTION_OVERRIDES) def strip_control_characters(text: str) -> str: """Strip null bytes and non-printable control characters.""" return "".join( ch for ch in text if ch == "\n" or ch == "\t" or (not unicodedata.category(ch).startswith("C")) ) def sanitize_string(text: str) -> str: """Full sanitization pipeline for untrusted peer strings. SECURITY T1.""" if not isinstance(text, str): raise ValueError("Expected string input") result = strip_direction_overrides(text) result = strip_control_characters(result) return result ``` ```typescript // hooks/diplomat-bootstrap/handler.ts:40-87 const peers = peersData.peers ?? []; if (peers.length > 0) { const peerLines = peers.map(p => { const fingerprint = (p.pubkey ?? '').slice(0, 12) + '…'; const stale = p.relay_token_stale ? ' ⚠ address may be stale' : ''; const seen = (p.last_seen ?? '').slice(0, 10); return ` • ${truncate(p.alias, 20)} | key:${fingerprint} | last seen ${seen}${stale}`; }); blocks.push( `[claw-bond] ${peers.length} connected peer${peers.length === 1 ? '' : 's'}:\n` + peerLines.join('\n') ); } let memory = ''; try { memory = await ctx.workspace.read('MEMORY.md'); } catch { /* MEMORY.md may not exist on fresh install */ } if (memory) { const section = extractSection(memory, '## Diplomat Commitments'); if (section) { const active = parseActiveEntries(section); if (active.length > 0) { const n = act ...[truncated 2792 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:4
Finding

Unpinned Third-Party Dependencies Installed from a Mutable Package Index

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (57)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code chunk is only a transcript/log inspection utility (claw_log.py). It reads session data from skills/claw-bond/ledger.json, formats timestamps and deadlines, lists sessions, and prints detailed transcript information or raw JSON. While the displayed data relates to negotiation sessions, the code itself does not let agents negotiate or coordinate in real time, does not send or receive messages, does not establish peer connections, does not implement encryption, and does not issue reminder notifications. Its primary purpose is observability/auditing of past sessions, which is materially narrower and different from the declared operational skill description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This code chunk does not match the declared primary purpose. The description emphasizes real-time inter-agent negotiation, commitment coordination, relay-assisted connectivity, and encrypted messaging. In contrast, the code only scans a local MEMORY.md file and writes local reminder alerts to cron_alerts.json for later display. While deadline reminders are mentioned in the description, this chunk implements only that limited reminder behavior and none of the core communication or negotiation capabilities. It also relies on cron execution and a heartbeat hook trigger pathway, which is materially different from the declared real-time peer-to-peer messaging behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description emphasizes a live agent-to-agent negotiation/coordination system with encrypted messaging and relay-based connection setup. The supplied code instead performs local context augmentation on session bootstrap: it reads peer metadata from a JSON file and commitment entries from MEMORY.md, formats summaries, and injects them into the session. That is materially different from the claimed primary functionality and includes an undeclared trigger (agent:bootstrap). While the displayed data relates to peers and commitments, the code itself does not implement negotiation, communication, reminders, relay setup, or encryption.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a collaboration/messaging skill centered on agent negotiation and encrypted peer-to-peer coordination. This code chunk instead implements operational startup monitoring for a background listener: it verifies installation, checks whether listener.py is running using a PID file and process.kill(pid, 0), cleans stale PID state, writes a start-request flag file, and injects a prompt telling the agent/user how to launch the listener. That is a materially different primary purpose from the declared user-facing functionality. While such listener management could support the broader system, this chunk itself exposes undeclared capabilities and an unrelated trigger (gateway:startup) compared with the declared behavior. Therefore this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description presents the skill as a real-time agent-to-agent negotiation and coordination system with relay setup and end-to-end encryption. This code chunk instead acts as a notification hook: on each human message, it reads persisted local files and emits reminders or prompts about commitments, proposals, handoffs, and connection approvals. Some of these notifications support the declared domain (commitment tracking, deadline reminders, negotiation-related prompts), so the code is related. However, the primary behavior here is not real-time peer-to-peer negotiation itself; it is a message-triggered poll/display layer over local state. Important described capabilities—relay connection setup and end-to-end encryption—are not present in this chunk. The trigger is also materially different from an implicit networking/real-time negotiation mechanism, since it runs on every human message. Therefore this chunk does not accurately match the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description claims a full negotiation and communication skill with relay connection setup and end-to-end encrypted messaging. The supplied code chunk does not implement any of those core capabilities. Instead, it only provides local utility functions for parsing stored commitment and ledger data. While this may support commitment tracking/reminder features as part of a larger system, the actual behavior of this chunk is materially narrower and different from the declared purpose, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The code only implements the inbound listener side of the system, not the full real-time peer-to-peer negotiation/commitment tracking/deadline reminder behavior described. Its primary behavior is to stay connected to a relay, accept inbound connections, perform encrypted Noise_XX handshakes, verify trust, quarantine unknown peers, and persist proposals or handoff data for later human review. That human approval and pending-approval workflow is a significant undeclared capability and materially changes the operational model from direct agent-to-agent negotiation. Also, the code supports HANDOFF/context passing in addition to negotiation, which is not reflected in the declared description. The encryption and relay aspects do align, but overall the description does not accurately represent this chunk's actual role and capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The core declared behavior is broadly accurate: the code does support real-time negotiation/coordination, commitment tracking, deadline reminders, relay-assisted setup, and encrypted messaging using Noise over WebSockets. However, the description omits several materially significant capabilities beyond simple negotiation. In particular, the code includes a dedicated HANDOFF command and protocol message for sending completed work plus context to another agent, which is a separate workflow not mentioned in the description. It also manages identity and connectivity infrastructure: generating/storing cryptographic keys, creating/revoking shareable address tokens, approving/denying connection requests, maintaining peer registries, and reading trust data from AGENTS.md. Additionally, it writes to multiple workspace resources such as MEMORY.md, HEARTBEAT.md, archive.md, daily logs, and cron instruction files, despite declared permissions being empty. These are substantial undeclared capabilities/resources, so this is a description-behavior mismatch even though the main negotiation claims are mostly true.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents an application-level collaboration skill: agents negotiate tasks, track commitments, and receive deadline reminders. The supplied code is instead infrastructure for transport and rendezvous: it reserves relay tokens, accepts connection requests, approves/denies sessions, and bridges WebSocket frames between peers. While the description’s claim that a relay is used for connection setup and that messages are end-to-end encrypted is consistent with the code comments and behavior, the main advertised capabilities are not implemented here. Additionally, the code exposes undeclared network utility behavior such as returning the caller’s public IP and managing relay token lifecycle. Therefore the description materially overstates and mischaracterizes what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents an operational skill that lets agents negotiate and coordinate tasks securely in real time. The supplied code chunk does not implement that runtime behavior; instead, it is a QA/integration test script for such a skill. Its primary purpose is to validate structure, commands, identity/key management, token validation, peer/session lifecycle behavior, scheduling, and security properties by invoking another script (negotiate.py), editing test fixture files, and summarizing results. Although the tests reference negotiation, relay setup, deadlines, and encryption, this chunk itself is not the negotiation skill and adds undeclared capabilities related to automated testing and filesystem inspection. Therefore the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `listener.py` — background inbound relay listener. Started manually by the user or agent (`python3 listener.py &` in terminal). The `diplomat-gateway` hook on

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `listener.py` — background inbound relay listener. Started manually by the user or agent (`python3 listener.py &` in terminal). The `diplomat-gateway` hook on

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The notification says a trusted peer is proposing a deal and asks what the user wants to do, but the '[accept]' action shown is '/claw-diplomat checkin ... done', which semantically corresponds to reporting task completion rather than accepting a proposal. This is an active contradiction between the inline UX/documented intent and the actual command presented to the user.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · relay/README.md (reported line 16)May include surrounding context.

bash
# 1. Clone or copy this directory onto your server
# 2. Configure environment
cp .env.example .env
# Edit .env — set RELAY_SECRET to a strong random value

# 3. Start

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · relay/README.md (reported line 17)May include surrounding context.

md
# claw-diplomat relay — docker-compose.yml
# Self-hosted relay for claw-diplomat peer sessions.
# Usage:
#   cp .env.example .env   # then fill in RELAY_SECRET
#   docker compose up -d

services:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · relay/docker-compose.yml (reported line 4)May include surrounding context.

yaml
# claw-diplomat relay — docker-compose.yml
# Self-hosted relay for claw-diplomat peer sessions.
# Usage:
#   cp .env.example .env   # then fill in RELAY_SECRET
#   docker compose up -d

services:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · relay/docker-compose.yml (reported line 22)May include surrounding context.

yaml
# claw-diplomat relay — docker-compose.yml
# Self-hosted relay for claw-diplomat peer sessions.
# Usage:
#   cp .env.example .env   # then fill in RELAY_SECRET
#   docker compose up -d

services:

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code exposes sensitive state-changing HTTP endpoints to any client who knows or can obtain a token, despite the documentation implying admin operations are protected by RELAY_SECRET. In particular, /reserve/{token}/revoke is completely unauthenticated, and approve/deny rely only on possession of a bearer token in the query string, enabling unauthorized revocation or session-manipulation if tokens leak via logs, referrers, browser history, or observation.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · test_integration.py (reported line 85)May include surrounding context.

python
def run_cmd(args: list, ws: str, timeout=20, stdin="") -> tuple[int, str]:
    env = {**os.environ, "DIPLOMAT_WORKSPACE": ws}
    try:
        r = subprocess.run(
            [sys.executable, str(NEGOTIATE)] + args,

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · test_integration.py (reported line 866)May include surrounding context.

python
# Inject a session with adversarial proposal text
        inject_session(ws, peer_alias="Attacker",
                       final_terms={
                           "my_tasks": ["$(rm -rf /tmp/evil)"],
                           "your_tasks": ["`id`"],
                           "deadline": "2099-01-01T00:00:00+00:00",
                           "checkin_at": "2099-01-01T00:00:00+00:00",

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · test_integration.py (reported line 866)May include surrounding context.

python
# Inject a session with adversarial proposal text
        inject_session(ws, peer_alias="Attacker",
                       final_terms={
                           "my_tasks": ["$(rm -rf /tmp/evil)"],
                           "your_tasks": ["`id`"],
                           "deadline": "2099-01-01T00:00:00+00:00",
                           "checkin_at": "2099-01-01T00:00:00+00:00",

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · test_integration.py (reported line 866)May include surrounding context.

python
# Inject a session with adversarial proposal text
        inject_session(ws, peer_alias="Attacker",
                       final_terms={
                           "my_tasks": ["$(rm -rf /tmp/evil)"],
                           "your_tasks": ["`id`"],
                           "deadline": "2099-01-01T00:00:00+00:00",
                           "checkin_at": "2099-01-01T00:00:00+00:00",

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares broad capabilities in metadata and documentation—shell install commands, network access to a relay, and extensive file writes—but does not declare a restrictive tool scope. In an agent environment, missing permissions boundaries increases the blast radius if the skill is invoked unexpectedly or if later implementation drifts, because the agent may assume it can read, write, and execute more than users realize.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.