Back to skill

Security audit

Crazyrouter Tts

Security checks for vulnerabilities and agentic risk

Overview

This text-to-speech skill mostly does what it says, but an undocumented setting can redirect user text and the API key to another server.

Install only if you are comfortable sending the text you provide, including input-file contents, to Crazyrouter for speech generation. Do not use it for secrets, confidential documents, regulated data, or private messages unless you have reviewed Crazyrouter's handling of that data. Also check your environment for CRAZYROUTER_BASE_URL before use; if it is set unexpectedly, the skill may send your API key and text somewhere other than Crazyrouter.

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

Error
Location
scripts/main.mjs:6
Finding
Unrestricted API Base URL Override Enables Credential and Text Disclosure## Vulnerability Details **File Location**: `scripts/main.mjs`, lines 6 and 43–50 **Vulnerability Type**: Unvalidated destination override causing sensitive-data exfiltration **Risk Level**: High ### Vulnerable Code ```js const API_BASE = process.env.CRAZYROUTER_BASE_URL || "https://crazyrouter.com/v1"; ``` ```js const apiKey = getApiKey(); console.error(`Model: ${args.model}, Voice: ${args.voice}, Speed: ${args.speed}x`); const response = await fetch(`${API_BASE}/audio/speech`, { method: "POST", headers: { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json" }, body: JSON.stringify({ model: args.model, input: text, voice: args.voice, speed: args.speed, response_format: args.format }), }); ``` ### Technical Analysis The script permits the `CRAZYROUTER_BASE_URL` environment variable to replace the trusted Crazyrouter API origin without validating the URL scheme, hostname, port, or destination. It subsequently sends both the `CRAZYROUTER_API_KEY` bearer credential and user-provided text to the selected endpoint. An attacker who can influence the process environment can set this variable to an attacker-controlled HTTP or HTTPS server. The next invocation then discloses the authorization header and TTS input to that server. Because arbitrary destinations are accepted, the behavior may also permit requests to local services or cloud metadata addresses, although response handling and the fixed `/audio/speech` suffix may limit practical exploitation of particular internal endpoints. ### Attack Path 1. The victim has a valid `CRAZYROUTER_API_KEY` in the execution environment. 2. An attacker gains the ability to influence the Skill's environment, launcher configuration, shell profile, or orchestration settings. 3. The attacker sets `CRAZYROUTER_BASE_URL` to an endpoint under their control. 4. The victim invokes the Skill with `--text` or `--input`. 5. The script sends a POST request to the attacker-selected endpoint. 6. The request expos ...[truncated 758 chars]
Remediation
## Remediation Suggestions - Remove `CRAZYROUTER_BASE_URL` if endpoint customization is not an explicit requirement. - If customization is required, parse the value with `new URL()` and enforce: - The `https:` scheme. - An explicit allowlist of trusted Crazyrouter hostnames. - Expected ports and path prefixes. - Rejection of embedded credentials, IP literals, loopback addresses, private networks, link-local destinations, and cloud metadata endpoints. - Before attaching the bearer token, compare the final request origin against the approved origin; fail closed on any mismatch. - Avoid following redirects to untrusted origins, or manually validate every redirect destination before resending sensitive headers. - Document any supported endpoint override in `SKILL.md`, including its trust and security requirements. - Add automated tests confirming that HTTP URLs, unapproved domains, local addresses, metadata addresses, and redirect-based origin changes are rejected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill description includes broad trigger phrases like 'read aloud,' 'generate audio,' and 'convert text to speech,' which overlap with common user requests and can cause the agent to invoke the skill in situations the user did not explicitly intend. Because the skill sends content to an external API and writes files to disk, overbroad activation increases the chance of unintended data disclosure or unnecessary side effects.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The markdown does not explicitly warn that provided text will be transmitted to the Crazyrouter external service and that synthesized audio will be saved locally. This can lead users or upstream agents to send sensitive text off-platform or create local artifacts without informed consent, especially given the skill's broad applicability.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill sends user-provided text or file contents to a third-party TTS API over the network without any explicit disclosure, consent flow, or guardrail around sensitive data. This creates a real privacy and data-handling risk because users may provide secrets, personal data, or confidential documents assuming the skill operates locally, and that content is then transmitted off-host to an external service.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/main.mjs:7