Back to skill

Security audit

mimotts25-plus (TTS增强版)

Security checks for vulnerabilities and agentic risk

Overview

This MiMo TTS skill mostly does what it says, but it can send API keys, text, and voice-clone samples to an arbitrary configured endpoint, so users should review it before installing.

Install only if you are comfortable sending text, style context, and any chosen voice-clone recordings to MiMo or the configured API endpoint. Avoid setting MIMO_API_BASE or --base-url to untrusted hosts, do not use http:// endpoints, and only upload voice samples you own or are authorized to use.

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

Warning
Location
scripts/tts.py:151
Finding
Unrestricted API Endpoint Override Can Disclose API Credentials and Voice Samples<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/tts.py:16, 57-64, 118-126, 151-176` - `scripts/mimo_tts.py:28, 50-59, 88-90` - `scripts/mimo_tts_voicedesign.py:17, 38-43, 76-78` - `scripts/mimo_tts_voiceclone.py:18, 47-76, 88-110` **Vulnerability Type**: Unvalidated destination for sensitive network requests **Risk Level**: Medium **Classification**: T09: Insecure Skill Coding Practices ### Relevant Code The unified entry point accepts an endpoint from the environment: ```python API_BASE = os.getenv("MIMO_API_BASE", "https://token-plan-cn.xiaomimimo.com/v1") ``` It sends the API key and synthesis payload to that endpoint without validating the scheme or destination host: ```python def _call_api(payload: dict, api_key: str, max_retries: int = 3) -> bytes: data = json.dumps(payload).encode() req = urllib.request.Request( f"{API_BASE}/chat/completions", data=data, headers={"Content-Type": "application/json", "api-key": api_key}, method="POST", ) ``` Clone mode reads and Base64-encodes the user-selected voice sample: ```python def _read_clone_audio(path: str) -> Tuple[str, str]: if not os.path.exists(path): raise TtsError(f"音频文件不存在: {path}") suffix = os.path.splitext(path)[1].lower() mime_map = {".mp3": "audio/mpeg", ".wav": "audio/wav"} mime = mime_map.get(suffix) if not mime: raise TtsError(f"不支持的音频格式: {suffix},仅支持 mp3/wav") with open(path, "rb") as f: voice_bytes = f.read() if len(voice_bytes) > 10 * 1024 * 1024: raise TtsError("音频文件过大(最大 10 MB)") voice_b64 = base64.b64encode(voice_bytes).decode("utf-8") return f"data:{mime};base64,{voice_b64}", mime ``` The command-line interface also permits an unrestricted endpoint override: ```python parser.add_argument("--base-url", default=None, help="自定义 API 端点 URL(覆盖 MIMO_API_BASE 环境变量)") args = parser.parse_args() if args.base_url: global API_BASE API_B ...[truncated 4675 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Allowlist official endpoints by default** - Permit only documented MiMo origins such as: - `https://api.xiaomimimo.com/v1` - `https://token-plan-cn.xiaomimimo.com/v1` - Compare normalized hostnames rather than using substring matching. 2. **Require HTTPS** - Reject `http://`, `file://`, and all non-HTTPS schemes. - Reject URLs containing embedded usernames or passwords. - Reject unexpected ports unless explicitly approved. 3. **Make custom endpoints an explicit high-risk mode** - Remove unrestricted `--base-url` behavior from normal operation, or require a separate flag such as `--allow-untrusted-endpoint`. - Display the normalized destination before transmitting credentials. - Require confirmation before uploading a voice sample to a non-official host. 4. **Separate credentials by destination** - Do not send `MIMO_API_KEY` to an unapproved custom endpoint. - Require a separate endpoint-specific credential for compatible third-party services. 5. **Validate redirects** - Prevent authorization headers and sensitive request bodies from being forwarded to a different origin. - Reject cross-origin redirects. - Verify the final response origin before accepting returned data. 6. **Add privacy warnings for clone mode** - Clearly state that the complete selected recording will be uploaded. - Show the destination host before reading and transmitting the file. - Recommend samples that contain no unrelated conversations or sensitive background audio. 7. **Apply centralized validation** - Implement one URL-validation function and use it in all four scripts so the OpenAI and `urllib` paths enforce identical restrictions. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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
Findings (32)

Tainted flow: 'req' from os.getenv (line 52, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
method="POST",
    )
    try:
        with urllib.request.urlopen(req, timeout=60) as resp:
            body = json.loads(resp.read())
    except urllib.error.HTTPError as exc:
        err_body = exc.read().decode(errors="replace")
Confidence
90% confidence
Finding
The script sends API requests to a base URL taken from the MIMO_API_BASE environment variable without validation. In environments where attackers can influence environment variables, this can redirect requests and the API key to an attacker-controlled endpoint, causing credential leakage and exfiltration of user text/context.

Tainted flow: 'req' from os.getenv (line 44, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
method="POST",
    )
    try:
        with urllib.request.urlopen(req, timeout=60) as resp:
            body = json.loads(resp.read())
    except urllib.error.HTTPError as exc:
        err_body = exc.read().decode(errors="replace")
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'req' from os.getenv (line 54, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
)
    for attempt in range(max_retries):
        try:
            with urllib.request.urlopen(req, timeout=60) as resp:
                body = json.loads(resp.read())
            break
        except urllib.error.HTTPError as exc:
Confidence
95% confidence
Finding
The script allows a user-controlled base URL via --base-url or MIMO_API_BASE and then sends the authenticated request, including the api-key header and sensitive TTS content, to that endpoint. This creates an SSRF-style exfiltration risk and credential leakage path if the endpoint is changed to an attacker-controlled server, which is more dangerous in an agent/skill context where tooling may be invoked with untrusted parameters or inherited environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The English description similarly overclaims capabilities not reflected by the analyzed behavior, including preset voices, cloning, and a broad official-compatible TTS suite. Overstated capability is security-relevant because users may provide inputs, files, or trust assumptions inappropriate for the actual implementation and review scope.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The English description similarly overclaims capabilities not reflected by the analyzed behavior, including preset voices, cloning, and a broad official-compatible TTS suite. Overstated capability is security-relevant because users may provide inputs, files, or trust assumptions inappropriate for the actual implementation and review scope.

Tainted flow: 'req' from pathlib.Path.read_bytes (line 69, file read) → urllib.request.urlopen (network output)

High
Category
Data Flow
Content
method="POST",
    )
    try:
        with urllib.request.urlopen(req, timeout=60) as resp:
            body = json.loads(resp.read())
    except urllib.error.HTTPError as exc:
        err_body = exc.read().decode(errors="replace")
Confidence
80% confidence
Finding
File contents flow to a network sink. This may indicate data exfiltration of sensitive files.

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill declares access to environment variables, file I/O, and network behavior but does not define any explicit tool scope or allowed-tools boundaries. In an agent setting, that lack of least-privilege controls can let the skill read secrets, write arbitrary files, or transmit data externally beyond what a user would reasonably expect.

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
The instructions state as a rule that `--context` must always be filled and all examples and guidance are written as mandatory Chinese phrasing, which effectively imposes a specific language/locale behavior rather than offering a choice. Because the skill also includes English voices later, this lack of explicit user language choice creates a locale-policy concern in the natural-language instructions.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill promotes voice-cloning functionality without any warning about consent, biometric privacy, or authorization requirements. Because voice samples are sensitive biometric-like data and cloned voices can enable impersonation or fraud, omitting these safeguards materially increases misuse risk.

External Transmission

Medium
Category
Data Exfiltration
Content
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
## API 地址

- 官方: `https://api.xiaomimimo.com/v1`
- 中国集群: `https://token-plan-cn.xiaomimimo.com/v1`

## 鉴权
Confidence
50% 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
**Curl:**
```bash
curl --location --request POST 'https://api.xiaomimimo.com/v1/chat/completions' \
--header "api-key: $MIMO_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
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
**Curl:**
```bash
curl --location --request POST 'https://api.xiaomimimo.com/v1/chat/completions' \
--header "api-key: $MIMO_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
Confidence
60% 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
91% confidence
Finding
The voice-cloning documentation instructs users to upload base64-encoded voice samples to a third-party API but does not warn about consent, privacy, or biometric-data handling risks. Because voice samples can be sensitive personal data and may belong to another person, the omission can lead users to submit recordings without authorization or awareness of retention/compliance implications.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill transmits user-provided text and optional context to a remote third-party TTS service, but the code provides no user-facing notice or consent mechanism. If callers assume processing is local, sensitive or confidential content may be unintentionally disclosed to the external provider.

Tainted flow: 'audio_data' from os.environ.get (line 108, credential/environment) → pathlib.Path.write_bytes (file write)

Medium
Category
Data Flow
Content
output_path = Path(args.output)
    output_path.parent.mkdir(parents=True, exist_ok=True)
    output_path.write_bytes(audio_data)
    print(output_path)
Confidence
65% confidence
Finding
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Static analysis

No suspicious patterns detected.