Back to skill

Security audit

Ressemble TTS e STT

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Resemble AI text-to-speech and speech-to-text skill, with expected third-party API use but some privacy and script-hardening caveats.

Install only if you are comfortable sending the text you synthesize and the audio files you transcribe to Resemble AI using your API key. Avoid confidential, regulated, or highly personal content unless Resemble's terms fit your needs, and consider hardening the TTS script's temporary-file handling and JSON payload construction.

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/tts.sh:10
Finding
Predictable Temporary File Allows Symlink-Based File Overwrite<![CDATA[ ## Vulnerability Details **File Location**: `scripts/tts.sh`, lines 10–37 **Vulnerability Type**: Predictable and insecure temporary-file creation **Risk Level**: Medium ### Vulnerable Code ```bash OUTPUT_FILE="/tmp/resemble_$(date +%s).mp3" if [[ -z "${RESEMBLE_API_KEY:-}" ]]; then echo "Missing RESEMBLE_API_KEY" exit 1 fi echo "🔊 Generating speech..." RESPONSE=$(curl -s -X POST "https://f.cluster.resemble.ai/synthesize" \ -H "Authorization: Bearer $RESEMBLE_API_KEY" \ -H "Content-Type: application/json" \ -d "{ \"voice_uuid\": \"$VOICE_UUID\", \"data\": \"$TEXT\", \"output_format\": \"mp3\" }") SUCCESS=$(echo "$RESPONSE" | jq -r '.success') if [[ "$SUCCESS" != "true" ]]; then echo "TTS failed:" echo "$RESPONSE" exit 1 fi echo "$RESPONSE" | jq -r '.audio_content' | base64 -d > "$OUTPUT_FILE" ``` ### Technical Analysis The output filename is derived solely from the current Unix timestamp with one-second precision. It is therefore predictable and can also collide when multiple instances execute during the same second. The file is opened using ordinary shell redirection without exclusive creation, ownership verification, or symbolic-link protection. If an attacker can create the predicted path before redirection occurs, the path may point to another file through a symbolic link. The shell then follows that link and truncates the destination before writing the decoded audio. Operating-system protections such as Linux `fs.protected_symlinks` may prevent some cross-user attacks in sticky directories. However, this does not eliminate same-user attacks, collisions between concurrent processes, or risk on systems without equivalent protections. ### Attack Path 1. An attacker determines or predicts the second in which the TTS script will run. 2. The attacker creates `/tmp/resemble_<timestamp>.mp3` as a symbolic link to a target file writable by the account executing the script. 3. The TTS request completes successf ...[truncated 828 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Create the output through `mktemp` rather than constructing a predictable path: ```bash umask 077 OUTPUT_FILE=$(mktemp --tmpdir resemble_XXXXXXXX.mp3) trap 'rm -f -- "$OUTPUT_FILE"' EXIT ``` If the generated file must remain available after the script exits, clear the cleanup trap only after successful generation: ```bash umask 077 OUTPUT_FILE=$(mktemp --tmpdir resemble_XXXXXXXX.mp3) trap 'rm -f -- "$OUTPUT_FILE"' EXIT printf '%s' "$RESPONSE" | jq -er '.audio_content' | base64 --decode > "$OUTPUT_FILE" trap - EXIT printf 'MEDIA:%s\n' "$OUTPUT_FILE" ``` Additional hardening should include: - Use a private output directory owned by the executing account where possible. - Set restrictive permissions with `umask 077`. - Do not rely on timestamps, process IDs, or random values generated without atomic file creation. - Retain shell quoting around all path references. - Define and document a secure cleanup policy for generated audio. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tts.sh:20
Finding
Unescaped User Input Permits JSON Request Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/tts.sh`, lines 20–27 **Vulnerability Type**: Improper construction of a JSON request from user-controlled input **Risk Level**: Medium ### Vulnerable Code ```bash RESPONSE=$(curl -s -X POST "https://f.cluster.resemble.ai/synthesize" \ -H "Authorization: Bearer $RESEMBLE_API_KEY" \ -H "Content-Type: application/json" \ -d "{ \"voice_uuid\": \"$VOICE_UUID\", \"data\": \"$TEXT\", \"output_format\": \"mp3\" }") ``` ### Technical Analysis Both `TEXT` and `VOICE_UUID` originate from command-line arguments and are inserted directly into a JSON string. They are not encoded according to JSON string rules. Characters such as double quotes, backslashes, newlines, and other control characters can terminate or alter the intended JSON value. A crafted argument can therefore produce malformed JSON or inject additional properties into the request body. Shell command substitution is not re-evaluated after variable expansion, so this flaw does not directly provide local shell command execution. The injection occurs in the JSON request sent to the Resemble AI endpoint. Whether injected properties are acted upon depends on the remote API’s schema and duplicate-property handling. ### Attack Path 1. An attacker supplies crafted text or a crafted voice UUID containing JSON syntax. 2. The script interpolates that input directly into the JSON document. 3. The resulting body contains attacker-injected properties or invalid JSON. 4. The body is sent with the legitimate Resemble API credential. 5. The remote service may reject the request, interpret unintended fields, or apply attacker-selected values if those fields are supported. For example, an input containing a closing quote followed by an additional property can change the structure of the outbound request rather than remaining a literal text value. ### Impact Assessment The immediate and reliably achievable impact is request corruption an ...[truncated 491 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Construct the payload with a JSON-aware tool rather than string interpolation: ```bash PAYLOAD=$(jq -n \ --arg voice_uuid "$VOICE_UUID" \ --arg data "$TEXT" \ '{ voice_uuid: $voice_uuid, data: $data, output_format: "mp3" }') RESPONSE=$(curl --silent --show-error --fail-with-body \ -X POST "https://f.cluster.resemble.ai/synthesize" \ -H "Authorization: Bearer $RESEMBLE_API_KEY" \ -H "Content-Type: application/json" \ --data-binary "$PAYLOAD") ``` Further hardening should include: - Validate `VOICE_UUID` against the exact format required by the API before sending it. - Apply reasonable length limits to text input. - Use `jq -e` when parsing responses so missing or invalid fields cause a controlled failure. - Configure Curl connection and overall request timeouts. - Avoid printing complete remote error responses if they could contain sensitive account or request information. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The declared description says the skill provides both Text-to-Speech and Speech-to-Text integration. However, the supplied code chunk only implements Speech-to-Text behavior via Resemble AI's STT API. There is no Text-to-Speech functionality in this code. Resource access and external service usage are consistent with the description, but the declared purpose overstates the implemented capabilities in this chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description says the skill provides both Text-to-Speech and Speech-to-Text integration. However, the supplied code chunk only implements Text-to-Speech. It sends text to Resemble AI's /synthesize endpoint, receives audio content, decodes it, and saves an MP3 file. There is no speech input handling, transcription logic, or call to any speech-to-text API. This is a material description-to-behavior mismatch because one of the core declared capabilities is absent.

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill appears to rely on shell-capable behavior while declaring no explicit tool scope or permissions. Missing scope boundaries can enable broader-than-expected execution paths and reduce reviewability, which is risky for a skill that handles API keys and sends data to external services.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The markdown omits a clear warning that user text and audio are transmitted to a third-party API, which creates a privacy and consent risk. In a voice-processing skill, this is especially important because prompts and recordings may contain sensitive personal, business, or biometric data, and users may not realize it leaves the local environment.

External Transmission

Medium
Category
Data Exfiltration
Content
echo "🔊 Generating speech..."

RESPONSE=$(curl -s -X POST "https://f.cluster.resemble.ai/synthesize" \
  -H "Authorization: Bearer $RESEMBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
Confidence
93% confidence
Finding
The curl request transmits the full user-supplied text and API credentials to an external service endpoint, which is expected for this integration but still creates a real data exfiltration surface. In the context of a speech-synthesis skill, this is less suspicious than in an unrelated skill, but it remains security-relevant because users may not realize their input leaves the local environment.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This script sends arbitrary user-provided text to Resemble AI's external API without any explicit privacy notice, consent prompt, or data handling warning. If users pass sensitive, proprietary, or regulated content, that data is transmitted off-host to a third party, which can create confidentiality, compliance, and privacy risks even though the behavior appears intentional for TTS functionality.

Static analysis

No suspicious patterns detected.