Back to skill

Security audit

mac-remote

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this macOS-over-SSH inspection and administration skill suspicious because it reports risky SSH key handling and mismatches between the described approval and platform scope and the behavior it documents.

Consider the suspicious verdict and incomplete scan coverage before installing. Review the approval expectations and Linux administration scope, and treat the SSH key replacement guidance with care because the scanner reports risks of tampering or losing access.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The health checks and SSH access match the declared inspection purpose. However, the script proceeds directly to execution, including numerous read-only commands, without an approval gate. An external caller could obtain approval, but that safeguard is not demonstrated in the supplied code. The broader administrative features mentioned in the description need not appear in this individual script.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The macOS launchctl command fits the declared administration purpose. The Linux systemctl command extends administration to an undeclared operating system. Neither command shows an approval gate, but this isolated command snippet does not establish whether approval is obtained elsewhere.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mac_health.sh # uses $MAC_HOST

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mac_health.sh <alias> # explicit host

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mac_health.sh --full <alias> # + log scan, updates, hardware profile

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

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

Cross-check the relay's host key from both machines before pinning, instead of trusting first contact:

bash
ssh-keygen -F <relay> -f ~/.ssh/known_hosts | ssh-keygen -lf -

Blind spots

Tool Parameter Abuse

High
Category
Tool Misuse
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).

Content

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

bash
# target: stop and remove the tunnel agent
launchctl bootout gui/$(id -u)/<label> && rm ~/Library/LaunchAgents/<label>.plist

# relay: drop the restricted key
grep -v '<tunnel-key-id>' ~/.ssh/authorized_keys > /tmp/ak

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

Removing a tunnel key is legitimate, but staging the replacement authorized_keys in the predictable shared path /tmp/ak creates file-precreation, symlink, and tampering risks where local permissions and OS protections permit them. Additionally, grep -v treats the identifier as a regular expression and can remove unrelated keys or produce an empty replacement, potentially locking out administrators.

Content

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

md
launchctl bootout gui/$(id -u)/<label> && rm ~/Library/LaunchAgents/<label>.plist

# relay: drop the restricted key
grep -v '<tunnel-key-id>' ~/.ssh/authorized_keys > /tmp/ak
install -m 600 /tmp/ak ~/.ssh/authorized_keys

# workstation: delete the two Host blocks, and the pinned key entry

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

This command installs an SSH authorization file from the predictable /tmp/ak path without checking ownership, integrity, or whether the preceding filter succeeded. If a local attacker can control or alter that staging file, their public key could become authorized; a failed or overbroad filter could instead remove legitimate access.

Content

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

relay: drop the restricted key

grep -v '' ~/.ssh/authorized_keys > /tmp/ak install -m 600 /tmp/ak ~/.ssh/authorized_keys

workstation: delete the two Host blocks, and the pinned key entry

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

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

md
## Remove apps and old agents

1. Request approval to inspect the exact app path and matching processes.
2. For an agent, inspect its plist and launchd status after approval.
3. Distinguish a loaded agent from a running process.
4. Show the exact removal commands and recovery method.
5. After approval, unload an obsolete agent before moving its files to Trash.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

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

bash
# target: stop and remove the tunnel agent
launchctl bootout gui/$(id -u)/<label> && rm ~/Library/LaunchAgents/<label>.plist

# relay: drop the restricted key
grep -v '<tunnel-key-id>' ~/.ssh/authorized_keys > /tmp/ak

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% 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.

Content

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

md
- The listener binds **`127.0.0.1` only** on the relay. Nothing is exposed to the internet.
- A system LaunchDaemon can run at the macOS login window after boot. It cannot run at the FileVault pre-boot unlock screen.
- **The agent type decides when the tunnel exists.** A launchd **user** agent (macOS) or a systemd user unit (Linux) runs only while that user is logged in. A **system LaunchDaemon** with `UserName` set starts at boot and survives the login window, at the cost of needing root to install — and root to stop. Pick one per machine: running both makes them fight over the listen port, and the loser retries on a timer.
- Verify it: `ssh <relay> 'ss -ltn "sport = :<port>"'`. A missing listener means the machine slept, rebooted to a disk-unlock screen, or lost its network.

## Health of the tunnel itself

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
| `Connection closed by UNKNOWN` | same | the tunnel died mid-handshake, or the machine slept |
| `Host key verification failed` | read the preceding SSH diagnostic | generic summary, not proof of a changed key |
| `No ... host key is known` | inspect the effective `HostKeyAlias` and client trust entry | missing trusted key for that name and key type |
| `REMOTE HOST IDENTIFICATION HAS CHANGED` | compare the presented key with an independently verified fingerprint | key mismatch — **stop and ask**. Never delete the entry to bypass verification |
| LAN alias fails but `-away` works | compare `ssh -G <target>`, the target's current address, and the SSH diagnostic | possible address, routing, network isolation, or trust problem. A lease change is not established |

### Verify a missing or changed host key