Back to skill

Security audit

TTS Media Route Fix

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to support a legitimate OpenClaw repair workflow, but it needs Review because it edits installed gateway code and handles bearer tokens in ways that can expose credentials.

Install only if you intend to let an agent perform OpenClaw gateway maintenance. Use it in a controlled environment, confirm exact files before patching, keep backups, avoid running the helper as root, do not pass real bearer tokens on the command line, and use HTTPS or loopback-only HTTP for verification.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/verify_tts_media_route.sh:5
Finding

Bearer Token Exposure Through Command-Line Arguments and Unencrypted HTTP

Content
View full analysis
" >&2 echo "Example: $0 http://127.0.0.1:15443 abc123 9f2c... /tmp/tts_headers.txt" >&2 exit 2 fi BASE_URL="$1" TOKEN="$2" TTS_ID="$3" HEADERS_OUT="$4" URL="${BASE_URL%/}/media/tts/${TTS_ID}.mp3" curl -sS -D "$HEADERS_OUT" \ -H "Authorization: Bearer ${TOKEN}" \ ``` The associated documentation also recommends sending the token to a generic plaintext HTTP endpoint in `SKILL.md`, lines 75–77: ```bash curl -i -H "Authorization: Bearer " \ "http://:/media/tts/.mp3" \ --range 0-127 ``` ### Technical Analysis The verification script requires the bearer token to be supplied as a positional command-line argument. Depending on the operating system and shell environment, command-line arguments can be exposed through process inspection facilities such as `ps` or `/proc`, terminal logging, shell history, audit logs, and command wrappers. The script accepts an unrestricted `base_url`, including plaintext HTTP URLs and remote hosts. The bearer token is placed directly in the `Authorization` header without checking the URL scheme or destination. When HTTP is used across a non-loopback network, the token can be intercepted by an attacker able to observe or modify network traffic. If an untrusted URL is supplied, the destination server directly receives the credential. ### Attack Path 1. An operator invokes the script with a valid gateway bearer token as its second positional argument. 2. A local attacker monitors process arguments, process-auditing output, terminal records, or other command logging while the script is running. 3. Alternatively, the operator uses an HTTP endpoint on a non-loopback interface, as permit ...[truncated 769 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/verify_tts_media_route.sh:18
Finding

Predictable Shared Temporary File Allows Symlink Overwrite and Verification Races

Content
View full analysis
&2 exit 3 fi if [[ "$ctype" != "audio/mpeg"* ]]; then echo "FAIL: expected Content-Type audio/mpeg, got '$ctype'" >&2 exit 4 fi if file /tmp/tts-sample.bin | grep -qiE 'HTML|text'; then ``` ### Technical Analysis The response body is always written to the fixed path `/tmp/tts-sample.bin`. Shared temporary directories are generally writable by multiple local users, so an attacker can predict and pre-create this path. The script does not atomically create the file, verify its ownership or type, reject symbolic links, or use a private temporary directory. Consequently, `curl -o` can follow an attacker-created symbolic link and truncate or overwrite the link target, provided the invoking user has permission to write that target. The fixed name also creates a race between concurrent invocations. One process can overwrite the sample while another process is validating it, producing inaccurate verification results. The downloaded media sample is not removed after execution, leaving response data in a predictable location. ### Attack Path 1. A local attacker anticipates that a more privileged user will run the verification script. 2. The attacker creates `/tmp/tts-sample.bin` as a symbolic link to a file writable by the invoking user. 3. The privileged user runs the script. 4. `curl -o /tmp/tts-sample.bin` follows the symbolic link and truncates or replaces the target with downloaded response byte ...[truncated 900 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs the agent to run shell commands that modify installed production dist files, restart services, and make authenticated curl requests, but it does not declare any tool scope such as permissions or allowed-tools. This creates an authorization and safety gap: an agent or execution framework may expose shell access more broadly than intended, enabling file tampering, service disruption, or accidental execution in the wrong environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script requires a Bearer token as a positional command-line argument, which can expose the secret through process listings, shell history, audit logs, or orchestration tooling that records invoked commands. In this skill’s context, the token is used to access protected media routes, so accidental disclosure could let another local user or monitoring system replay the credential against the service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/verify_tts_media_route.sh (reported line 16)May include surrounding context.

sh
HEADERS_OUT="$4"
URL="${BASE_URL%/}/media/tts/${TTS_ID}.mp3"

curl -sS -D "$HEADERS_OUT" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Range: bytes=0-127" \
  "$URL" \