Back to skill

Security audit

Inworld TTS

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Inworld.ai text-to-speech wrapper, but users should avoid sending confidential text and should protect the API key.

Install only if you are comfortable sending the text you synthesize to Inworld.ai. Use a narrowly scoped API key, avoid putting secrets or private content in the text, and store the key in a protected secret store or a permission-restricted env file rather than a general shell profile.

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:38
Finding
Unvalidated CLI Arguments Permit JSON Request Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/tts.sh`, lines 38–48 **Vulnerability Type**: Unsafe JSON construction using unvalidated user-controlled values **Risk Level**: Medium ### Vulnerable Code ```bash PAYLOAD=$(cat <<EOF { "text": $(echo "$TEXT" | jq -Rs .), "voice_id": "$VOICE", "audio_config": { "audio_encoding": "MP3", "speaking_rate": $RATE }, "temperature": $TEMP, "model_id": "$MODEL" } EOF ) ``` ### Technical Analysis The script safely encodes `TEXT` with `jq`, but directly interpolates the user-controlled `VOICE`, `MODEL`, `RATE`, and `TEMP` arguments into a JSON document. `VOICE` and `MODEL` are placed inside JSON strings without JSON escaping. An argument containing quotation marks and additional JSON syntax can terminate the original string and inject new properties. `RATE` and `TEMP` are inserted as unrestricted raw JSON values, allowing a caller to introduce unexpected JSON structures or additional fields. The resulting payload is transmitted to the Inworld API using the victim's `INWORLD_API_KEY`. This issue does not result in shell command execution because the variables remain quoted when passed to `curl`, but it allows manipulation of the authenticated API request and can also produce malformed requests. ### Attack Path 1. An attacker gains the ability to influence arguments passed to `tts.sh`, such as through an application or Agent that invokes the script with untrusted synthesis options. 2. The attacker supplies a crafted `--voice`, `--model`, `--rate`, or `--temp` argument containing JSON syntax. 3. The script interpolates the value into `PAYLOAD` without appropriate encoding or type validation. 4. The modified payload is sent to `https://api.inworld.ai` under the configured API credential. 5. Depending on what the API accepts, the request may contain unintended fields, consume API quota, generate unexpected output, or fail in an attacker-controlled manner. ### Impact Assessment The vuln ...[truncated 475 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Construct the complete payload through `jq` rather than interpolating values into a here-document. Pass strings using `--arg` and validated numeric values using `--argjson`. For example: ```bash [[ "$RATE" =~ ^([0-9]+([.][0-9]+)?|[.][0-9]+)$ ]] || { echo "Invalid speaking rate" >&2; exit 1; } [[ "$TEMP" =~ ^([0-9]+([.][0-9]+)?|[.][0-9]+)$ ]] || { echo "Invalid temperature" >&2; exit 1; } awk -v value="$RATE" 'BEGIN { exit !(value >= 0.5 && value <= 2.0) }' || { echo "Speaking rate must be between 0.5 and 2.0" >&2; exit 1; } awk -v value="$TEMP" 'BEGIN { exit !(value >= 0.1 && value <= 2.0) }' || { echo "Temperature must be between 0.1 and 2.0" >&2; exit 1; } PAYLOAD=$(jq -n \ --arg text "$TEXT" \ --arg voice "$VOICE" \ --arg model "$MODEL" \ --argjson rate "$RATE" \ --argjson temp "$TEMP" \ '{ text: $text, voice_id: $voice, audio_config: { audio_encoding: "MP3", speaking_rate: $rate }, temperature: $temp, model_id: $model }') ``` Also validate voice and model identifiers against documented formats or an allowlist when possible. Reject missing values for options such as `--voice` before attempting to read `$2`. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:21
Finding
Documentation Encourages Persistent Plaintext API-Key Storage Without Safeguards<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 21 **Vulnerability Type**: Insecure credential-storage guidance **Risk Level**: Low ### Vulnerable Documentation ```markdown For persistence, add to `~/.bashrc` or `~/.clawdbot/.env`. ``` ### Technical Analysis The setup documentation recommends persisting the Inworld API credential in shell initialization or environment files but does not instruct users to restrict file permissions, avoid version control, prevent shell-history exposure, or use a dedicated secret manager. Both suggested locations commonly store plaintext data. `~/.bashrc` may also be read by unrelated shell processes and included in diagnostic archives or workstation backups. The security of `~/.clawdbot/.env` depends on its ownership and permissions, which the documentation does not establish. The project does not automatically access, modify, or exfiltrate these files. Therefore, this is insecure credential-handling guidance rather than unauthorized credential access or a system-persistence mechanism. ### Attack Path 1. A user follows the documentation and stores `INWORLD_API_KEY` in `~/.bashrc` or `~/.clawdbot/.env`. 2. The target file has overly broad permissions, is copied into a backup or support archive, or is accidentally committed to a repository. 3. Another local user, process, collaborator, or repository viewer obtains the plaintext credential. 4. The exposed key is used to make unauthorized requests to the Inworld API until it is revoked or expires. ### Impact Assessment Successful exposure permits API access within the permissions assigned to the Inworld key, potentially including unauthorized voice queries or TTS requests and associated quota or billing consumption. This guidance does not itself provide elevated local privileges, execute at startup as a backdoor, or disclose the credential remotely. The impact depends on file permissions, the surrounding host environment, and the scope and lifetime ...[truncated 19 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Prefer runtime secret injection from an operating-system credential store, deployment secret manager, or similarly protected facility. Avoid recommending `~/.bashrc` as the default location for long-lived credentials. If a dedicated environment file must be used: 1. Create a dedicated file rather than placing the key in a general shell initialization file. 2. Restrict the directory and file permissions: ```bash mkdir -p ~/.clawdbot chmod 700 ~/.clawdbot touch ~/.clawdbot/.env chmod 600 ~/.clawdbot/.env ``` 3. Ensure the file is owned by the intended user. 4. Exclude it from version control and avoid copying it into logs, support bundles, or shared backups. 5. Use a narrowly scoped API key with only the permissions required for TTS. 6. Document key revocation and rotation procedures. 7. Warn users that entering an export command directly into an interactive shell may retain the credential in shell history. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Credential Access

High
Category
Privilege Escalation
Content
## Setup

1. Get API key from https://platform.inworld.ai
2. Generate key with "Voices: Read" permission
3. Copy the "Basic (Base64)" key
4. Set environment variable:
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill clearly instructs users to run shell commands and execute a script, but its metadata declares no `permissions` or `allowed-tools` scope. That creates an authorization and transparency gap: an agent or user may not be warned that shell capability is required, increasing the chance of unintended command execution in environments that rely on declared tool scopes for safety.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation describes converting arbitrary text to speech through Inworld's API but does not prominently warn that provided text is transmitted to a third-party service and that generated audio is saved to disk. This omission can lead users to expose sensitive or regulated content without informed consent, especially in agent settings where prompts may contain private data.

External Transmission

Medium
Category
Data Exfiltration
Content
)

if [[ "$STREAM" == "true" ]]; then
  curl -s --request POST \
    --url "https://api.inworld.ai/tts/v1/voice:stream" \
    --header "Authorization: Basic $INWORLD_API_KEY" \
    --header "Content-Type: application/json" \
Confidence
89% confidence
Finding
This POST request sends supplied text content to an external endpoint along with an authorization header, creating a clear data egress path to a third party. While expected for a TTS integration, it is still a genuine security concern because sensitive content may be exfiltrated without meaningful notice or policy enforcement.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script transmits arbitrary user-provided text and an API credential to a third-party cloud TTS service, but provides no explicit warning, consent step, or data-sensitivity guardrails. In a skill context, users may pass secrets, personal data, or proprietary prompts assuming local processing, so this creates a real confidentiality risk even though the network transmission is core functionality.

External Transmission

Medium
Category
Data Exfiltration
Content
if [[ "$STREAM" == "true" ]]; then
  curl -s --request POST \
    --url "https://api.inworld.ai/tts/v1/voice:stream" \
    --header "Authorization: Basic $INWORLD_API_KEY" \
    --header "Content-Type: application/json" \
    --data "$PAYLOAD" \
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
if [[ "$STREAM" == "true" ]]; then
  curl -s --request POST \
    --url "https://api.inworld.ai/tts/v1/voice:stream" \
    --header "Authorization: Basic $INWORLD_API_KEY" \
    --header "Content-Type: application/json" \
    --data "$PAYLOAD" \
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
if [[ "$STREAM" == "true" ]]; then
  curl -s --request POST \
    --url "https://api.inworld.ai/tts/v1/voice:stream" \
    --header "Authorization: Basic $INWORLD_API_KEY" \
    --header "Content-Type: application/json" \
    --data "$PAYLOAD" \
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
if [[ "$STREAM" == "true" ]]; then
  curl -s --request POST \
    --url "https://api.inworld.ai/tts/v1/voice:stream" \
    --header "Authorization: Basic $INWORLD_API_KEY" \
    --header "Content-Type: application/json" \
    --data "$PAYLOAD" \
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
| jq -r --unbuffered '(.result.audioContent? // .audioContent? // empty)' \
    | base64 -d > "$OUTPUT"
else
  curl -s --request POST \
    --url "https://api.inworld.ai/tts/v1/voice" \
    --header "Authorization: Basic $INWORLD_API_KEY" \
    --header "Content-Type: application/json" \
Confidence
89% confidence
Finding
The non-streaming request also transmits user-controlled text and uses the API credential in an outbound request to Inworld.ai. This is not code-injection, but it is a real confidentiality and policy issue because the skill enables external transmission of potentially sensitive content.

Static analysis

No suspicious patterns detected.