Back to skill

Security audit

Claw2claw Filetransfer

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent file-transfer helper, but it normalizes persistent root SSH access and key installation without enough scoping or warning.

Review this skill carefully before installing. Use a dedicated unprivileged transfer account instead of root, verify exactly what SSH key will be installed and how to revoke it, prefer dry-run before sync, and avoid transferring broad paths like /home, /etc, logs, or database dumps unless the destination is trusted and the data is protected.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/commands.md:10
Finding
SSH setup defaults to persistent root-level remote access<![CDATA[ ## Vulnerability Details **File Location**: `references/commands.md:10-31`; additional occurrences in `SKILL.md:35`, `SKILL.md:77-81`, and `references/examples.md:65-74` **Vulnerability Type**: Least-privilege violation through root SSH key authorization **Risk Level**: High ### Vulnerable Code `references/commands.md:10-31`: ```bash claw2claw setup <remote-host> [user] [port] ``` ```markdown | Argument | Required | Default | Description | |----------|----------|---------|-------------| | `<remote-host>` | Yes | - | IP or hostname | | `[user]` | No | `root` | SSH username | | `[port]` | No | `22` | SSH port | ``` ```bash claw2claw setup 192.168.1.100 claw2claw setup 192.168.1.100 admin claw2claw setup 192.168.1.100 admin 2222 claw2claw setup myserver.example.com ``` ```markdown ### What Happens 1. Tests SSH connectivity 2. Adds SSH key to remote if needed 3. Saves config to `~/.claw2claw.conf` ``` `SKILL.md:35`: ```bash claw2claw setup 192.168.1.100 --user root ``` `SKILL.md:77-81`: ```bash REMOTE_HOST="192.168.1.100" # Remote IP/hostname REMOTE_USER="root" # SSH user REMOTE_PORT="22" # SSH port SSH_KEY="/path/to/key" # Custom SSH key RSYNC_BWLIMIT=1000 # KB/s limit ``` `references/examples.md:65-74`: ```markdown ## Multi-Agent Setup **Agent A:** ```bash claw2claw setup <agent-b-ip> --user root ``` **Agent B:** ```bash claw2claw setup <agent-a-ip> --user root ``` ``` ### Technical Analysis The documented `setup` workflow defaults to the `root` SSH account and states that it adds an SSH key to the remote system. The examples also recommend reciprocal root setup between two agents. This creates persistent, key-based administrative access even though ordinary file transfer generally requires access only to designated source and destination directories. This exceeds the minimum privileges necessary for the declared file-transfer functionality. A dedicated, unprivileged transfer account with narro ...[truncated 1895 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Change the default SSH user from `root` to a dedicated, unprivileged transfer account. 2. Require users to specify a remote account explicitly rather than silently selecting an administrative account. 3. Grant the transfer account access only to approved source and destination directories using ownership, groups, ACLs, a restricted shell, or a chroot environment. 4. If key installation is supported, require explicit confirmation and display the target host, account, key fingerprint, and resulting privilege level before modifying `authorized_keys`. 5. Restrict authorized keys where feasible using options such as `from=`, `restrict`, `no-agent-forwarding`, `no-port-forwarding`, `no-X11-forwarding`, and an appropriate forced command. 6. Enforce strict SSH host-key verification to reduce machine-in-the-middle risk during initial setup. 7. Store private keys with mode `0600` and configuration directories with mode `0700`; never copy private keys to remote hosts. 8. Treat root setup as an exceptional, opt-in operation accompanied by a prominent warning and additional confirmation. 9. Avoid recommending reciprocal root access between agents. Configure only the minimum transfer direction required for the workflow. 10. Document key rotation, revocation, and uninstall procedures, including removal of the corresponding remote `authorized_keys` entry. 11. Include the actual implementation in future audits so command construction, input validation, host-key handling, and key-management behavior can be verified. ]]>
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
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (19)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
## Uninstall

```bash
rm /usr/local/bin/claw2claw
rm ~/.claw2claw.conf
rm -rf ~/.claw2claw/
```
Confidence
85% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
rm /usr/local/bin/claw2claw
rm ~/.claw2claw.conf
rm -rf ~/.claw2claw/
```
Confidence
85% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
rm /usr/local/bin/claw2claw
rm ~/.claw2claw.conf
rm -rf ~/.claw2claw/
```

---
Confidence
90% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
rm /usr/local/bin/claw2claw
rm ~/.claw2claw.conf
rm -rf ~/.claw2claw/
```

---
Confidence
90% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
claw2claw send /tmp/backup-$DATE.tar.gz /backups/

# Cleanup
rm /tmp/backup-$DATE.tar.gz
```

### Add to Cron
Confidence
85% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
mkdir /tmp/js-files
cp $(find ./src -name "*.js") /tmp/js-files/
claw2claw send /tmp/js-files/ /remote/src/
rm -rf /tmp/js-files
```

---
Confidence
90% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
mkdir /tmp/js-files
cp $(find ./src -name "*.js") /tmp/js-files/
claw2claw send /tmp/js-files/ /remote/src/
rm -rf /tmp/js-files
```

---
Confidence
90% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
echo "test" > /tmp/test.txt
claw2claw send /tmp/test.txt /tmp/
claw2claw get /tmp/test.txt /tmp/
rm /tmp/test.txt
```

### Connection Test
Confidence
85% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
echo "test" > /tmp/test.txt
claw2claw send /tmp/test.txt /tmp/
claw2claw get /tmp/test.txt /tmp/
rm /tmp/test.txt
```

### Connection Test
Confidence
85% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
claw2claw send /huge-file.tar.gz /remote/

# If really stuck, delete partial and retry
ssh user@host "rm /remote/huge-file.tar.gz.part"
claw2claw send /huge-file.tar.gz /remote/
```
Confidence
85% 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).

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill encourages file transfer and bidirectional sync but does not clearly warn that these actions operate over the network and may overwrite, replicate, or delete user data on remote systems depending on rsync behavior. In an agent context, omission of that warning increases the chance of unsafe use, especially when users may assume a local-only or low-risk operation.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The quick-start example uses `--user root` for remote setup without any warning or justification, normalizing privileged remote access as the default. If copied by users or agents, this expands the blast radius of mistakes or compromise to full remote system control and unrestricted file modification.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
### Linux
```bash
# Pre-installed on most distros
sudo apt install rsync
```

### macOS
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
### Linux
```bash
# Pre-installed on most distros
sudo apt install rsync
```

### macOS
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation states that setup 'adds SSH key to remote if needed' and 'saves config to ~/.claw2claw.conf' but does not clearly warn users that it modifies remote authentication and persists connection details locally. In an agent-to-agent transfer context, undocumented credential and access changes can lead to users granting broader or more durable access than intended, especially when the default user is root.

Session Persistence

Medium
Category
Rogue Agent
Content
### Add to Cron
```bash
crontab -e
# Add: 0 2 * * * /path/to/backup-script.sh
```
Confidence
85% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The database dump example creates and transfers a plaintext SQL backup, which commonly contains sensitive application and user data, but provides no warning about confidentiality, destination trust, or secure cleanup. In this skill's context, transferring backups is expected, yet omitting safeguards makes accidental exposure more likely.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The multi-agent setup example normalizes using --user root on both sides without caution, which promotes persistent remote file-transfer capability under full administrative privileges. In a cross-machine sync tool, that materially raises the blast radius of mistakes, credential compromise, and unauthorized access.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The emergency recovery and selective transfer examples encourage broad copying of sensitive directories like /home, /var/log, and /etc without any warning about secrets, personal data, or system configuration exposure. In a file-transfer skill, this is contextually plausible, but the lack of cautions increases the chance an operator exfiltrates or mishandles high-sensitivity data during routine use.

Static analysis

No suspicious patterns detected.