Back to skill

Security audit

Clawshorts Pkg

Security checks for vulnerabilities and agentic risk

Overview

ClawShorts matches its stated purpose, but it installs an always-on local daemon with Fire TV control and ships a real command-injection flaw in a fallback script.

Install only if you are comfortable enabling ADB on a trusted home network and running a persistent local service that can inspect Fire TV UI state and force-stop YouTube. Before broad use, remove or fix the deprecated bash daemon argument handling and replace fixed /tmp UI files with private temporary files. Use the documented uninstall command when you no longer need the limiter, and review the stored ~/.clawshorts history/log files.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/clawshorts-daemon.sh:28
Finding

Python Code Injection Through an Unvalidated Device Address

Content
View full analysis
255 for o in ip.split('.')): sys.exit(1) " 2>/dev/null } ``` ### Technical Analysis The function inserts the untrusted `ip` shell variable directly into dynamically generated Python source: ```python ip = '$ip' ``` Validation only occurs after Python has parsed and begun executing the generated program. An argument containing a single quote can terminate the intended Python string and introduce additional Python statements. For example, a conceptual argument shaped like the following can execute a command before the regular-expression validation fails: ```text x'; __import__("os").system("id"); # ``` The resulting Python source begins as: ```python ip = 'x'; __import__("os").system("id"); #' ``` Consequently, this is not merely a validation bypass. It is arbitrary Python and operating-system command execution. The vulnerable fallback can be reached when the Python daemon is not executable or when `FORCE_BASH_DAEMON=1` is used. ### Attack Path 1. An attacker causes a user or automation process to invoke `clawshorts-daemon.sh` with a crafted device-address argument. 2. The shell assigns the argument to `IPS` and passes each resulting value to `validate_ip`. 3. `validate_ip` interpolates the value into the source string supplied to `python3 -c`. 4. A quote in the argument terminates the intended Python string. 5. Injected Python statements execute before the subsequent IP checks reject the value. 6. The injected code can invoke operating-system commands with the identity and environment of t ...[truncated 798 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/clawshorts-daemon.sh:103
Finding

Predictable Shared Temporary File in the Bash Daemon

Content
View full analysis
/dev/null | grep -q youtube; then log "[WATCH] YouTube on $ip" adb -s "$ip:5555" shell uiautomator dump /sdcard/ui.xml 2>/dev/null adb -s "$ip:5555" pull /sdcard/ui.xml /tmp/ui.xml 2>/dev/null pct=$(python3 -c " import re try: c=open('/tmp/ui.xml').read() ``` ### Technical Analysis The daemon always pulls device-controlled XML into the fixed path `/tmp/ui.xml`. Shared temporary directories are normally writable by other local users. A predictable filename allows another local process to create, replace, or race that path before the ADB write and subsequent Python read. There is no check that the destination is a regular file owned by the current user, no protection against symbolic links, and no private temporary directory. Depending on how `adb pull` opens the destination, a pre-created symbolic link may cause a user-writable target file to be overwritten or truncated. A race can also replace the XML before Python reads it. Because this file feeds the deprecated fallback's Shorts detection logic, poisoned content can alter whether usage is counted or YouTube is force-stopped. ### Attack Path 1. A local attacker predicts that the daemon will use `/tmp/ui.xml`. 2. The attacker creates a symbolic link at that path to a file writable by the ClawShorts user, or repeatedly replaces the path during polling. 3. The daemon executes `adb pull` without validating the destination. 4. The destination target may be overwritten, or the attacker replaces the downloaded file before `open('/tmp/ui.xml').read()`. 5. For content replacement, the attacker supplies crafted bounds data that influences the computed width percentage. 6. The fallback daemon can consequently ...[truncated 637 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/clawshorts/device_monitor.py:127
Finding

Predictable Shared Temporary File in Live Device Status Polling

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (86)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding indicates undeclared installation of persistent services, global symlink creation, and broader device management than the metadata claims. Those actions alter the host system and expand control surface beyond simple Shorts quota checks, which can surprise users and create persistence or misuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

This finding indicates undeclared installation of persistent services, global symlink creation, and broader device management than the metadata claims. Those actions alter the host system and expand control surface beyond simple Shorts quota checks, which can surprise users and create persistence or misuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

This finding indicates undeclared installation of persistent services, global symlink creation, and broader device management than the metadata claims. Those actions alter the host system and expand control surface beyond simple Shorts quota checks, which can surprise users and create persistence or misuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This finding indicates undeclared installation of persistent services, global symlink creation, and broader device management than the metadata claims. Those actions alter the host system and expand control surface beyond simple Shorts quota checks, which can surprise users and create persistence or misuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding indicates undeclared installation of persistent services, global symlink creation, and broader device management than the metadata claims. Those actions alter the host system and expand control surface beyond simple Shorts quota checks, which can surprise users and create persistence or misuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding indicates undeclared installation of persistent services, global symlink creation, and broader device management than the metadata claims. Those actions alter the host system and expand control surface beyond simple Shorts quota checks, which can surprise users and create persistence or misuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding indicates undeclared installation of persistent services, global symlink creation, and broader device management than the metadata claims. Those actions alter the host system and expand control surface beyond simple Shorts quota checks, which can surprise users and create persistence or misuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding indicates undeclared installation of persistent services, global symlink creation, and broader device management than the metadata claims. Those actions alter the host system and expand control surface beyond simple Shorts quota checks, which can surprise users and create persistence or misuse risks.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/clawshorts.sh (reported line 83)May include surrounding context.

sh
install_adb() {
    echo "Installing ADB..."
    if command -v apt-get &> /dev/null; then
        sudo apt-get update -qq && sudo apt-get install -y adb
    elif command -v brew &> /dev/null; then
        brew install android-platform-tools
    else

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 · scripts/clawshorts.sh (reported line 215)May include surrounding context.

sh
rm -f "$plist"
    else
        systemctl --user disable --now clawshorts.service 2>/dev/null || true
        rm -f "${HOME}/.config/systemd/user/clawshorts.service"
        systemctl --user daemon-reload 2>/dev/null || true
    fi
    cmd_stop

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 · README.md (reported line 32)May include surrounding context.

md
1. On your Fire TV: **Settings → My Fire TV → About → Network**
2. Look for **IP Address** (like `192.168.1.100`)
3. Write it down

### Step 2 — Enable ADB Debugging

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 123)May include surrounding context.

"ADB not found" — Install ADB on your computer:

bash
brew install android-platform-tools  # Mac
sudo apt install adb                # Linux

"Daemon not running" — Start it:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares executable shell entrypoints and references file read/write locations, but does not declare any tool scope or permissions boundaries. That makes the operational capability opaque to reviewers and increases the chance an agent could invoke filesystem or shell actions beyond what users reasonably expect.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The skill explicitly uses a LaunchAgent plist and stores ongoing state in a local database and log, indicating persistent background execution and session/state retention. Persistence is not inherently malicious, but it is security-relevant because it survives beyond a single user request and can continue monitoring devices or affecting system behavior without fresh invocation.

Content

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

md
- Device config + history: `~/.clawshorts/clawshorts.db` (SQLite)
- Daemon log: `~/.clawshorts/daemon.log`
- LaunchAgent: `~/Library/LaunchAgents/com.fink.clawshorts.plist`

## Requirements

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 · README.md (reported line 158)May include surrounding context.

Symptom: The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

Root Cause: The LaunchAgent plist uses ThrottleInterval inside KeepAlive, which conflicts with launchd's restart behavior.

Bad plist configuration:

xml

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 · TROUBLESHOOTING.md (reported line 9)May include surrounding context.

Symptom: The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

Root Cause: The LaunchAgent plist uses ThrottleInterval inside KeepAlive, which conflicts with launchd's restart behavior.

Bad plist configuration:

xml

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 · TROUBLESHOOTING.md (reported line 11)May include surrounding context.

Symptom: The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

Root Cause: The LaunchAgent plist uses ThrottleInterval inside KeepAlive, which conflicts with launchd's restart behavior.

Bad plist configuration:

xml

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 · TROUBLESHOOTING.md (reported line 162)May include surrounding context.

Symptom: The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

Root Cause: The LaunchAgent plist uses ThrottleInterval inside KeepAlive, which conflicts with launchd's restart behavior.

Bad plist configuration:

xml

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 · TROUBLESHOOTING.md (reported line 167)May include surrounding context.

Symptom: The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

Root Cause: The LaunchAgent plist uses ThrottleInterval inside KeepAlive, which conflicts with launchd's restart behavior.

Bad plist configuration:

xml

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 · TROUBLESHOOTING.md (reported line 168)May include surrounding context.

Symptom: The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

Root Cause: The LaunchAgent plist uses ThrottleInterval inside KeepAlive, which conflicts with launchd's restart behavior.

Bad plist configuration:

xml

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 · TROUBLESHOOTING.md (reported line 190)May include surrounding context.

Symptom: The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

Root Cause: The LaunchAgent plist uses ThrottleInterval inside KeepAlive, which conflicts with launchd's restart behavior.

Bad plist configuration:

xml

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 · TROUBLESHOOTING.md (reported line 201)May include surrounding context.

Symptom: The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

Root Cause: The LaunchAgent plist uses ThrottleInterval inside KeepAlive, which conflicts with launchd's restart behavior.

Bad plist configuration:

xml

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 · TROUBLESHOOTING.md (reported line 203)May include surrounding context.

Symptom: The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

Root Cause: The LaunchAgent plist uses ThrottleInterval inside KeepAlive, which conflicts with launchd's restart behavior.

Bad plist configuration:

xml

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 · scripts/clawshorts.sh (reported line 146)May include surrounding context.

sh
**Symptom:** The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

**Root Cause:** The LaunchAgent plist uses `ThrottleInterval` inside `KeepAlive`, which conflicts with launchd's restart behavior.

**Bad plist configuration:**
```xml

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 · scripts/clawshorts.sh (reported line 148)May include surrounding context.

sh
**Symptom:** The ClawShorts daemon restarts every 30-90 seconds, cycling continuously. Logs show "Shutdown requested (signal 15)" followed by immediate restart.

**Root Cause:** The LaunchAgent plist uses `ThrottleInterval` inside `KeepAlive`, which conflicts with launchd's restart behavior.

**Bad plist configuration:**
```xml