Back to skill

Security audit

Trackyard

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Trackyard music search/download wrapper, but its download command can write to any caller-supplied writable path without containment or overwrite protection.

Install only if you are comfortable granting this skill network access to Trackyard with your API key and local file write capability. Prefer using the default filename in a safe working directory, avoid passing absolute or parent-directory paths to --output, and consider requiring a fix that confines downloads to a dedicated folder and refuses overwrites by default.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/trackyard.sh:151
Finding
Caller-Controlled Download Path Allows Arbitrary File Overwrite<![CDATA[ ## Vulnerability Details **File Location**: `scripts/trackyard.sh`, lines 151–202 **Vulnerability Type**: Unrestricted file write and overwrite **Risk Level**: Medium ### Vulnerable Code ```bash cmd_download() { local track_id="" local duration="" local hit_point="" local output="" while [[ $# -gt 0 ]]; do case "$1" in --duration) duration="$2"; shift 2 ;; --hit-point) hit_point="$2"; shift 2 ;; --output) output="$2"; shift 2 ;; -*) echo "Unknown option: $1" >&2; exit 1 ;; *) track_id="$1"; shift ;; esac done if [[ -z "$track_id" ]]; then echo "Error: track ID required" >&2 exit 1 fi # Build request body local body body=$(jq -n --arg id "$track_id" '{track_id: $id}') if [[ -n "$duration" ]]; then body=$(echo "$body" | jq --argjson d "$duration" '. + {duration_seconds: $d}') fi if [[ -n "$hit_point" ]]; then body=$(echo "$body" | jq --argjson h "$hit_point" '. + {hit_point_seconds: $h}') fi # Determine output filename if [[ -z "$output" ]]; then # Get track title for filename local title title=$(curl -sS -X POST "$BASE_URL/search" \ -H "Authorization: Bearer $TRACKYARD_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"query\":\"$track_id\",\"limit\":1}" | jq -r '.tracks[0].title // "track"' 2>/dev/null || echo "track") # Sanitize filename output=$(echo "$title" | tr ' ' '_' | tr -cd '[:alnum:]_-').mp3 fi echo "Downloading to: $output" >&2 curl -sS -X POST "$BASE_URL/download-track" \ -H "Authorization: Bearer $TRACKYARD_API_KEY" \ -H "Content-Type: application/json" \ -d "$body" \ --output "$output" echo "Downloaded: $output" } ``` ### Technical Analysis The `--output` argument is accepted as an unrestricted caller-controlled filesystem path. Although automatically generated filenames are sanitized, explicitly supplied output values receive no equivalent validation. The value is pas ...[truncated 2068 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Confine downloads to a dedicated directory under the project or user data directory. 2. Treat `--output` as a basename rather than a general path: - Reject absolute paths. - Reject `/`, `\`, `..`, control characters, and empty names. - Enforce an expected extension such as `.mp3`. 3. Canonicalize the destination directory and verify that the resolved path remains beneath the approved download root. 4. Refuse to overwrite existing files by default. Require an explicit, clearly documented `--force` option if replacement is necessary. 5. Reject symbolic-link destinations and validate the parent directory before writing. 6. Download to a securely created temporary file in the approved directory, validate HTTP status and expected content type, and then atomically rename it to the final destination. 7. Add `curl --fail-with-body` or equivalent HTTP error handling so error responses are not silently saved as successful media files. A safe design should resemble: ```bash download_dir="${TRACKYARD_DOWNLOAD_DIR:-$PWD/downloads}" mkdir -p -- "$download_dir" name="${output:-track.mp3}" if [[ "$name" == /* || "$name" == *"/"* || "$name" == *"\\"* || "$name" == *".."* || "$name" != *.mp3 ]]; then echo "Error: output must be a safe .mp3 filename" >&2 exit 1 fi destination="$download_dir/$name" if [[ -e "$destination" || -L "$destination" ]]; then echo "Error: destination already exists" >&2 exit 1 fi temporary=$(mktemp "$download_dir/.trackyard.XXXXXX") trap 'rm -f -- "$temporary"' EXIT curl --fail-with-body -sS -X POST "$BASE_URL/download-track" \ -H "Authorization: Bearer $TRACKYARD_API_KEY" \ -H "Content-Type: application/json" \ -d "$body" \ --output "$temporary" mv -- "$temporary" "$destination" trap - EXIT ``` ]]>
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 (6)

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill invokes shell capabilities via `scripts/trackyard.sh` and declares runtime requirements (`curl`, `jq`, and an API key), but it does not declare any explicit tool scope such as `permissions` or `allowed-tools`. That mismatch can cause the agent platform to grant broader-than-necessary execution ability or make security review and policy enforcement harder, increasing the risk of unintended command execution or data handling beyond the minimal need.

External Transmission

Medium
Category
Data Exfiltration
Content
#!/usr/bin/env bash
set -euo pipefail

BASE_URL="https://api.trackyard.com/api/external/v1"

check_api_key() {
  if [[ -z "${TRACKYARD_API_KEY:-}" ]]; then
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
'{query: $query, limit: $limit, offset: $offset}')
  fi

  curl -sS -X POST "$BASE_URL/search" \
    -H "Authorization: Bearer $TRACKYARD_API_KEY" \
    -H "Content-Type: application/json" \
    -d "$body" | jq .
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
'{query: $query, limit: $limit, offset: $offset}')
  fi

  curl -sS -X POST "$BASE_URL/search" \
    -H "Authorization: Bearer $TRACKYARD_API_KEY" \
    -H "Content-Type: application/json" \
    -d "$body" | jq .
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
echo "Downloading to: $output" >&2

  curl -sS -X POST "$BASE_URL/download-track" \
    -H "Authorization: Bearer $TRACKYARD_API_KEY" \
    -H "Content-Type: application/json" \
    -d "$body" \
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Low
Confidence
78% confidence
Finding
This shell script performs a file write by downloading remote content directly to a local path with `--output`, which is a safety-relevant operation under the audit criteria. Although it prints the destination filename at L191, there is no broader warning in the command help or comments that the `download` command will create or overwrite a local file.

Static analysis

No suspicious patterns detected.