Back to skill

Security audit

Audio Reply

Security checks for vulnerabilities and agentic risk

Overview

This audio TTS skill is coherent, but it needs Review because its examples can pass user or fetched text into shell-style commands without a safe argument boundary.

Review before installing. Use only public, non-sensitive URLs, and only run this skill if you are comfortable with uv downloading and executing the local TTS package. The main fix needed is to require TTS text to be passed as literal data, not interpolated into shell source; URL fetching should also validate redirects and resolved addresses, and broad triggers should be narrowed or confirmed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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

Error
Location
SKILL.md:83
Finding
Untrusted TTS text may be interpolated into a shell command<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 83-96 **Vulnerability Type**: Command injection through unsafe shell argument construction **Risk Level**: High ### Vulnerable Code ```bash Always delete temporary files after playback. Generated audio or referenced text may be retained by the chat client history, so avoid processing sensitive sources. ```bash # Generate with unique filename and play OUTPUT_FILE="/tmp/audio_reply_$(date +%s)" uv run mlx_audio.tts.generate \ --model mlx-community/chatterbox-turbo-fp16 \ --text "Your response text" \ --play \ --file_prefix "$OUTPUT_FILE" # ALWAYS clean up after playing rm -f "${OUTPUT_FILE}"*.wav 2>/dev/null ``` ``` The same unsafe command-construction pattern also appears in the TTS example at `SKILL.md:50-57` and the example workflow at `SKILL.md:114-128`. ### Technical Analysis The Skill instructs the agent to fetch webpage content or generate a response and substitute that content into the `--text` argument of a shell command. The documentation does not require use of a structured process API, argument array, securely created input file, or another mechanism that keeps content separate from shell syntax. If an implementation constructs the displayed command as a string and replaces `"Your response text"` with fetched or user-controlled content, shell-significant characters can break the intended quoting context. Command substitutions such as `$(...)` and backticks are evaluated even within double quotes when they appear in shell source. Embedded quotes can also terminate the argument and introduce redirections, separators, or additional commands. The instruction stating that commands from fetched content must not be executed is a policy guardrail, but it does not technically prevent indirect execution caused by unsafe shell interpolation. ### Attack Path 1. An attacker publishes a public webpage containing shell syntax in article text, such as command substitution or a ...[truncated 1454 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Never construct shell source by concatenating or interpolating fetched, generated, or user-provided text. 2. Invoke the TTS program through a structured process-execution API that accepts an argument array. Pass the entire response as one literal argument without invoking a shell. 3. If supported by MLX Audio, write the text to a securely created temporary file and pass the file path through a dedicated input-file option. 4. Create temporary files with unpredictable names and restrictive permissions, such as through `mktemp` with an appropriate `umask`, rather than using a timestamp alone. 5. If shell use cannot be eliminated, place dynamic data in positional parameters supplied separately to a fixed script. Do not evaluate, reparse, or embed those parameters in generated shell code. 6. Add an explicit implementation requirement that shell tools must not be used to interpolate TTS text. 7. Add regression tests containing double quotes, single quotes, backticks, command substitutions, newlines, redirections, and command separators. Verify that all test strings are delivered literally to the TTS process and that no secondary command runs. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:20
Finding
URL filtering does not require redirect and resolved-address validation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 20-25 **Vulnerability Type**: Incomplete SSRF protection for public URL fetching **Risk Level**: Medium ### Vulnerable Code ```markdown 1. Only fetch `http://` or `https://` URLs. 2. Never fetch local/private/network-internal targets: - hostnames: `localhost`, `*.local` - loopback/link-local/private IP ranges (`127.0.0.0/8`, `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `169.254.0.0/16`, `::1`, `fc00::/7`) 3. Refuse URLs that include credentials or obvious secrets (userinfo, API keys, signed query params, bearer tokens, cookies). 4. If a link appears private/authenticated/sensitive, do not fetch it. Ask the user for a public redacted URL or a pasted excerpt instead. ``` The associated fetch instruction at `SKILL.md:35` is: ```markdown 1. Validate URL against Safety Guardrails, then fetch content with WebFetch ``` ### Technical Analysis The Skill attempts to prevent server-side request forgery by rejecting explicit private and local destinations. However, the documented validation is primarily based on the supplied URL and hostname. It does not require: - Resolution and classification of every IPv4 and IPv6 destination address before connection. - Revalidation after DNS resolution changes. - Destination pinning between validation and connection. - Validation of every HTTP redirect target. - A strict redirect limit. - Rejection of alternative or ambiguous IP address representations. - Explicit blocking of cloud metadata and platform-specific internal endpoints. Consequently, an apparently public hostname can pass the initial textual checks and then resolve to a private address. A public endpoint can also return a redirect to an internal service after the original URL has been approved. DNS rebinding or time-of-check/time-of-use behavior may similarly cause the address used for the connection to differ from the address considered during validation. Some WebFetch implementati ...[truncated 1657 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse URLs with a standards-compliant URL parser and permit only HTTP and HTTPS. 2. Reject URL user information, malformed hosts, noncanonical address forms, and disallowed ports where they are unnecessary. 3. Resolve the hostname immediately before connecting and inspect every returned IPv4 and IPv6 address. 4. Reject loopback, unspecified, private, link-local, multicast, reserved, carrier-grade NAT, documentation, and other non-global address ranges. 5. Explicitly deny cloud metadata destinations and platform-specific internal hostnames. 6. Ensure the connection is made only to a previously validated address, while preserving the expected hostname for TLS verification, to reduce DNS rebinding and time-of-check/time-of-use risk. 7. Disable redirects by default. If redirects are required, set a low maximum and repeat complete scheme, hostname, credential, DNS, address, and port validation for every redirect target. 8. Apply outbound network controls so the fetching component cannot connect to private, loopback, link-local, or metadata networks even if application-level validation fails. 9. Document and verify the SSRF protections supplied by WebFetch rather than relying solely on natural-language guardrails. 10. Add tests for redirects to private hosts, mixed IPv4/IPv6 results, DNS rebinding, encoded IP representations, and metadata-service destinations. ]]>
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
--model mlx-community/chatterbox-turbo-fp16 \
     --text "Here's what I found... [article summary]" \
     --play --file_prefix /tmp/audio_reply_1706123456
4. Delete: rm -f /tmp/audio_reply_1706123456*.wav
5. Confirm: "Done reading the article to you."
```
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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
--model mlx-community/chatterbox-turbo-fp16 \
     --text "Hey! So I can help you with all kinds of things..." \
     --play --file_prefix /tmp/audio_reply_1706123789
3. Delete: rm -f /tmp/audio_reply_1706123789*.wav
4. (No text output needed - audio IS the response)
```
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).

Vague Triggers

Medium
Confidence
93% confidence
Finding
The documented triggers are very broad natural-language phrases like "speak" and "say it," which can easily appear in ordinary conversation and cause unintentional activation of the skill. In a voice/output-generating skill, ambiguous activation increases the chance of accidental network fetches or local command execution paths being reached without clear user intent.

Skill Enumeration

Medium
Category
Agent Snooping
Content
2. **Copy the skill to your Claude Code skills directory**:
   ```bash
   mkdir -p ~/.claude/skills/audio-reply
   cp SKILL.md ~/.claude/skills/audio-reply/
   ```
Confidence
85% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Session Persistence

Medium
Category
Rogue Agent
Content
2. **Copy the skill to your Claude Code skills directory**:
   ```bash
   mkdir -p ~/.claude/skills/audio-reply
   cp SKILL.md ~/.claude/skills/audio-reply/
   ```
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.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The phrase "voice reply" is somewhat ambiguous and may match user language that is not intended to invoke this skill. While less risky than the shorter triggers, ambiguity still increases the chance of accidental activation and unnecessary tool use.

Natural-Language Policy Violations

Low
Confidence
61% confidence
Finding
The usage section presents only English trigger phrases and natural-language commands, which may indicate the skill expects interaction in a specific language. There is no documentation stating whether other languages are supported or whether English-only behavior is an intentional, justified constraint.

Vague Triggers

Low
Confidence
78% confidence
Finding
The phrase "voice reply" is somewhat ambiguous and may match user language that is not intended to invoke this skill. While less risky than the shorter triggers, ambiguity still increases the chance of accidental activation and unnecessary tool use.

Static analysis

No suspicious patterns detected.