Back to skill

Security audit

Local Llama TTS

Security checks for vulnerabilities and agentic risk

Overview

This skill is a small local text-to-speech wrapper with disclosed behavior, though users should be careful about unverified model downloads and a shell argument handling bug.

Reasonable to install if you trust the model sources and use it locally. Prefer pinned downloads with published SHA-256 checksums, and avoid passing untrusted speaker filenames until the script uses an argument array and validates option values.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tts-local.sh:29
Finding
Argument Injection Through Unquoted Speaker Parameter Expansion<![CDATA[ ## Vulnerability Details **File Location**: `scripts/tts-local.sh`, lines 29-53 **Vulnerability Type**: Argument injection caused by unsafe shell word splitting **Risk Level**: Medium ### Vulnerable Code ```bash while [[ "$#" -gt 0 ]]; do case $1 in -o|--output) OUTPUT="$2"; shift ;; -s|--speaker) SPEAKER_PARAM="--tts-speaker-file $2"; shift ;; -t|--temp) TEMP="$2"; shift ;; -h|--help) usage ;; *) TEXT="$1" ;; esac shift done if [ -z "$TEXT" ]; then usage fi # Run llama-tts llama-tts \ -m "$MODEL" \ -mv "$VOCODER" \ -p "$TEXT" \ -o "$OUTPUT" \ --temp "$TEMP" \ --repeat-penalty "$REP_PENALTY" \ --repeat-last-n "$REP_LAST_N" \ --top-k "$TOP_K" \ --top-p "$TOP_P" \ --min-p "$MIN_P" \ $SPEAKER_PARAM ``` ### Technical Analysis The speaker option and its user-controlled value are concatenated into the scalar variable `SPEAKER_PARAM`. The variable is subsequently expanded without quotation. Bash applies word splitting and pathname expansion to an unquoted variable expansion. Consequently, whitespace in the supplied speaker value produces additional command-line arguments rather than remaining part of a single filename. An attacker who can control the speaker argument can inject additional options accepted by `llama-tts`. For example, a caller could pass a single shell-quoted value containing extra arguments: ```bash scripts/tts-local.sh --speaker 'reference.wav -o /tmp/alternate.wav' 'text' ``` The wrapper can expand that value into arguments equivalent to: ```text --tts-speaker-file reference.wav -o /tmp/alternate.wav ``` The exact result depends on how `llama-tts` handles duplicate options and option ordering. This flaw does not directly cause arbitrary shell command execution because shell metacharacters introduced through variable expansion are not reparsed as shell syntax. It is nevertheless a command-line argument injection vulnerability. Th ...[truncated 1623 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Represent optional arguments as a Bash array so each value retains its argument boundary: ```bash SPEAKER_ARGS=() while [[ "$#" -gt 0 ]]; do case "$1" in -o|--output) [[ $# -ge 2 ]] || { echo "Error: $1 requires a value." >&2 usage } OUTPUT="$2" shift 2 ;; -s|--speaker) [[ $# -ge 2 ]] || { echo "Error: $1 requires a value." >&2 usage } SPEAKER_ARGS=(--tts-speaker-file "$2") shift 2 ;; -t|--temp) [[ $# -ge 2 ]] || { echo "Error: $1 requires a value." >&2 usage } TEMP="$2" shift 2 ;; -h|--help) usage ;; --) shift TEXT="$*" break ;; -*) echo "Error: unknown option: $1" >&2 usage ;; *) TEXT="$1" shift ;; esac done llama-tts \ -m "$MODEL" \ -mv "$VOCODER" \ -p "$TEXT" \ -o "$OUTPUT" \ --temp "$TEMP" \ --repeat-penalty "$REP_PENALTY" \ --repeat-last-n "$REP_LAST_N" \ --top-k "$TOP_K" \ --top-p "$TOP_P" \ --min-p "$MIN_P" \ "${SPEAKER_ARGS[@]}" ``` Additionally: - Validate that the speaker file exists, is a regular file, and is readable. - Validate output paths according to the intended trust boundary. - Validate temperature as a numeric value within the supported range. - Reject unknown options rather than treating them as text. - Use `set -euo pipefail` where compatible to make parsing and execution failures explicit. ]]>

T08 · Insecure Dependencies

Note
Location
SKILL.md:32
Finding
Model and Vocoder Downloads Are Not Pinned or Integrity-Verified<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 32-35 **Vulnerability Type**: Unverified mutable third-party artifacts **Risk Level**: Low ### Vulnerable Documentation ```markdown 1. **Model:** Download from [OuteAI/OuteTTS-1.0-0.6B-GGUF](https://huggingface.co/OuteAI/OuteTTS-1.0-0.6B-GGUF/resolve/main/OuteTTS-1.0-0.6B-Q4_K_M.gguf?download=true) 2. **Vocoder:** Download from [ggml-org/WavTokenizer](https://huggingface.co/ggml-org/WavTokenizer/resolve/main/WavTokenizer-Large-75-Q5_1.gguf?download=true) (Note: Felix uses a Q4_0 version, Q5_1 is linked here as a high-quality alternative). Place files in `/data/public/machine-learning/models/text-to-speach/` or update `scripts/tts-local.sh`. ``` ### Technical Analysis The installation instructions reference artifacts through the mutable `main` branch and do not provide cryptographic hashes, signatures, immutable repository revisions, or a verification procedure. A mutable reference can resolve to different content over time. If an upstream account, repository, hosting path, or download connection is compromised, users following these instructions have no documented way to detect artifact substitution before the files are parsed by `llama-tts`. The documented vocoder is also inconsistent with the script: - Documentation links `WavTokenizer-Large-75-Q5_1.gguf`. - The script expects `WavTokenizer-Large-75-Q4_0.gguf`. This discrepancy may encourage manual renaming or substitution and makes it more difficult for users to verify that the artifact in use is the intended version. ### Attack Path 1. An upstream artifact referenced through `resolve/main` is replaced, compromised, or unintentionally changed. 2. A user follows `SKILL.md` and downloads the current artifact. 3. No checksum or signature verification is performed. 4. The downloaded file is placed in the configured model directory, potentially after being renamed to match the hardcoded path. 5. The wrapper invokes `llama-tts`, whi ...[truncated 971 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Pin each download URL to an immutable repository commit or release revision rather than `main`. - Publish the expected SHA-256 digest for every model and vocoder file. - Require users to verify the digest before invoking `llama-tts`. - Where available, verify a publisher signature in addition to the checksum. - Make the documented vocoder filename and quantization match the file hardcoded in `scripts/tts-local.sh`. - Record artifact provenance, exact revision, expected size, and license in the setup instructions. Example verification workflow: ```bash echo '<EXPECTED_SHA256> OuteTTS-1.0-0.6B-Q4_K_M.gguf' | sha256sum --check - echo '<EXPECTED_SHA256> WavTokenizer-Large-75-Q4_0.gguf' | sha256sum --check - ``` The placeholders must be replaced with hashes calculated from reviewed, trusted copies of the exact pinned artifacts. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.