Back to skill

Security audit

minimax-tts-send

Security checks for vulnerabilities and agentic risk

Overview

The skill is a plausible MiniMax text-to-speech tool, but it ships a hard-coded MiniMax API credential and gives broad outbound messaging instructions without enough user control or disclosure.

Review carefully before installing. Do not use this package as published unless the embedded MiniMax API key is removed and rotated, credentials are supplied by each user through a protected secret source, and the skill clearly warns before sending text or generated audio to MiniMax or messaging platforms.

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/tts.py:18
Finding
Hard-Coded MiniMax API Credential<![CDATA[ ## Vulnerability Details **File Location**: `scripts/tts.py`, lines 18–21 **Vulnerability Type**: Hard-coded secret / exposed API credential **Risk Level**: High ### Vulnerable Code ```python def get_api_key(): """获取 API Key""" key = "sk-api-[REDACTED]" return key ``` The complete credential value has been redacted from this report to prevent further disclosure. In the audited source, the full bearer token is stored directly in the `key` string. ### Technical Analysis The script embeds a MiniMax API credential directly in its source code. The returned value is subsequently inserted into the `Authorization: Bearer` header for requests to the following endpoints: - `https://api.minimaxi.com/v1/get_voice` - `https://api.minimaxi.com/v1/t2a_v2` Source code is not an appropriate secret-storage boundary. Anyone who can download, inspect, copy, or access the Skill package can recover the credential without authentication. Removing the credential in a later revision would also be insufficient if it remains available in repository history, cached packages, logs, or previous distributions. The network requests themselves are consistent with the declared cloud text-to-speech functionality: user-supplied text must be sent to MiniMax to synthesize speech, and voice enumeration requires an account API call. The vulnerability is therefore not the necessary provider communication, but the distribution of a shared account credential with the Skill. ### Attack Path 1. An attacker obtains the Skill package or reads `scripts/tts.py`. 2. The attacker extracts the hard-coded token from `get_api_key()`. 3. The attacker constructs requests using the extracted token as a MiniMax bearer credential. 4. The attacker invokes API operations permitted to the associated account, including speech synthesis and account-scoped voice enumeration. 5. The attacker repeatedly consumes the account's quota or paid API capacity until the credential is revoked, potentially ...[truncated 1005 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Revoke and rotate the exposed credential immediately.** Treat it as compromised because it was distributed in source code. 2. **Remove the credential from the current source and repository history.** Purge it from prior commits, release archives, package caches, build artifacts, examples, and logs where feasible. 3. **Load credentials from a protected runtime source**, such as an environment variable or operating-system secret store: ```python def get_api_key(): key = os.environ.get("MINIMAX_API_KEY") if not key: raise RuntimeError( "MINIMAX_API_KEY is required. Configure it through a protected secret store." ) return key ``` 4. **Require each user or deployment to supply its own credential.** Do not distribute a shared provider account token with the Skill. 5. **Apply provider-side least privilege.** Restrict the replacement key to only the MiniMax operations required for voice enumeration and text-to-speech, if MiniMax supports granular scopes. 6. **Add secret-scanning controls** to pre-commit hooks and CI pipelines to reject API tokens before publication. 7. **Monitor the affected account** for unauthorized requests, unexpected voice enumeration, quota consumption, or charges associated with the exposed key. 8. **Document the external data flow clearly.** Inform users that text submitted for synthesis is transmitted to MiniMax and may be processed according to the provider's retention and privacy policies. ]]>
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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documented behavior does not match the implemented behavior, and the mismatch includes a reported hardcoded credential/API key. Hidden sensitive behavior and undocumented credentials are dangerous because they can leak secrets, mislead reviewers about what the skill actually does, and enable unauthorized API use or account compromise.

Lp3

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding
The skill documentation exposes capabilities involving shell execution and outbound network access, but it declares no tool scope or permission boundaries. In an agent environment, this weakens least-privilege controls and can allow the skill to invoke commands or external APIs without explicit review, increasing the blast radius if the skill is misused or later modified.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill instructs users how to send generated audio to external messaging channels but does not warn about outbound transmission, recipient targeting risks, or privacy implications. This is dangerous because synthesized content may contain sensitive user text, and sending it externally can cause unintended disclosure or abuse, especially in an automation context.

External Transmission

Medium
Category
Data Exfiltration
Content
data = {"voice_type": "all"}
    
    try:
        resp = requests.post(url, headers=headers, json=data, timeout=30)
        resp.raise_for_status()
        result = resp.json()
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The function sends user-provided text directly to a third-party TTS service, which can disclose sensitive or private content to an external provider. In a skill context, users may assume text is processed locally unless the network transmission is clearly disclosed, making this a real privacy and data-handling issue.

External Transmission

Medium
Category
Data Exfiltration
Content
try:
        print(f"正在生成语音...", file=sys.stderr)
        resp = requests.post(url, headers=headers, json=data, timeout=60)
        resp.raise_for_status()
        result = resp.json()
Confidence
96% confidence
Finding
This POST transmits arbitrary user text to a remote service for synthesis, which can expose confidential prompts, personal data, or proprietary material to a third party. The skill context increases the risk because text-to-speech content is often natural-language user input that may contain sensitive information, and the script gives no meaningful disclosure or consent mechanism.

Natural-Language Policy Violations

Low
Confidence
74% confidence
Finding
The description explicitly positions the skill for generating Chinese speech, which is a locale/language constraint expressed in natural language. The file does not indicate user opt-in for this language restriction or explain that the skill is intentionally region- or language-specific.

Natural-Language Policy Violations

Low
Confidence
73% confidence
Finding
The docstring, help text, status messages, and examples are presented only in Chinese. Per the policy, forcing a specific language without offering a user choice can be a natural-language policy issue unless the locale restriction is explicitly documented and justified.

Missing User Warnings

Low
Confidence
78% confidence
Finding
This function saves audio output to disk, either at a default path or a user-specified path. While it reports the save location afterward, there is no upfront disclosure that the tool performs file writes, which is relevant safety information for command-line skills.

Static analysis

No suspicious patterns detected.