Back to skill

Security audit

小米 TTS Proxy

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a real Xiaomi TTS proxy, but it recommends a persistent privileged service and can send API keys and text to a configurable upstream with limited warning.

Review the upstream endpoint and service setup carefully before installing. Use only a trusted HTTPS MIMO_TTS_BASE, protect and rotate the Xiaomi API key, avoid sending sensitive text, and do not enable a persistent systemd service until you have reviewed the service unit and file permissions.

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
tts-proxy.mjs:139
Finding

Configurable upstream endpoint can disclose API credentials and TTS content

Content
View full analysis

Vulnerability Details

File Location: tts-proxy.mjs:20-22 and tts-proxy.mjs:139-147
Vulnerability Type: Unrestricted transmission of credentials and user content to a configurable endpoint
Risk Level: Medium

Vulnerable Code

js
const MIMO_BASE = process.env.MIMO_TTS_BASE;
const MIMO_KEY  = process.env.MIMO_TTS_KEY;
const PORT      = parseInt(process.env.TTS_PROXY_PORT ?? "18899", 10);
js
const upstream = await fetch(`${MIMO_BASE}/v1/chat/completions`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "api-key": MIMO_KEY
  },
  body: JSON.stringify(mimoBody)
});

The related configuration instructions at SKILL.md:72-82 permit replacing the official Xiaomi endpoint with a custom proxy:

bash
MIMO_TTS_BASE=https://api.xiaomimimo.com
MIMO_TTS_KEY=your_Xiaomi_API_Key
TTS_PROXY_PORT=18899

The documentation states that a proxy address may be placed in MIMO_TTS_BASE.

Technical Analysis

The proxy must transmit synthesis text and an API credential to the official TTS provider to perform its declared function. However, MIMO_TTS_BASE is accepted without validating its scheme, hostname, or trust level.

Consequently, the destination can be changed to any URL accepted by fetch, including an attacker-controlled server. Every TTS request then sends the following sensitive data to that server:

  • The Xiaomi API key through the api-key header.
  • User-supplied TTS text through the JSON request body.
  • Potentially private conversation content if OpenClaw automatically synthesizes inbound messages.

Permitting a custom proxy can be legitimate, but the current implementation neither requires HTTPS nor warns or confirms at runtime that the custom endpoint receives credentials and message content. This exceeds the minimum safe network authority required when the intended provider is api.xiaomimimo.com.

Attack Path

  1. An a ...[truncated 1307 chars]
Remediation
View remediation

Remediation Suggestions

  1. Default to the fixed official endpoint https://api.xiaomimimo.com.
  2. Parse the configured value with URL and reject all schemes other than HTTPS.
  3. Allowlist the official hostname by default.
  4. If custom proxies are a required feature, require a separate explicit opt-in such as MIMO_ALLOW_CUSTOM_BASE=true.
  5. Display a clear warning that a custom proxy receives both the API key and submitted text.
  6. Reject URLs containing embedded credentials, unexpected ports, fragments, or unsupported schemes.
  7. Consider allowing custom certificate pinning or trusted certificate-authority configuration for approved enterprise proxies.
  8. Use a provider credential scoped only to TTS and constrained by quota where the provider supports such controls.
  9. Protect the environment file with owner-only permissions and document credential rotation after suspected endpoint compromise.

T09 · Insecure Skill Coding Practices

Note
Location
tts-proxy.mjs:112
Finding

Unbounded HTTP request buffering permits local denial of service

Content
View full analysis

Vulnerability Details

File Location: tts-proxy.mjs:112-113
Vulnerability Type: Missing request-body size and duration limits
Risk Level: Low

Vulnerable Code

js
async function handleTTS(req, res) {
  let body = "";
  for await (const chunk of req) body += chunk;

  let parsed;
  try { parsed = JSON.parse(body); }
  catch { res.writeHead(400); res.end("invalid json"); return; }

Technical Analysis

The handler appends every incoming chunk to a JavaScript string until the client ends the request. It does not enforce a maximum body size, validate Content-Length, or impose a body-receipt timeout.

A client can therefore submit an extremely large body or stream data slowly for an extended period. Large strings consume process memory, and repeated concurrent requests can exhaust memory or retain server resources. JSON parsing may impose additional memory and CPU costs after the complete body has been buffered.

Binding the service to 127.0.0.1 reduces exposure because remote hosts cannot ordinarily connect directly. It does not eliminate the issue: any local process running under another user or within the same reachable network namespace can target the service.

Attack Path

  1. A local unprivileged process connects to 127.0.0.1:18899.
  2. It sends a POST request to /audio/speech.
  3. It supplies an extremely large body or continuously streams chunks without completing the request.
  4. The proxy repeatedly concatenates those chunks in memory.
  5. Multiple concurrent requests amplify memory and resource consumption.
  6. The Node.js process becomes unresponsive, is terminated due to memory exhaustion, or cannot reliably process legitimate TTS requests.

Impact Assessment

Exploitation does not grant additional privileges, access to credentials, or code execution. Its primary impact is local availability loss:

  • Interruption of TTS functionality.
  • Excessive memory and CPU ...[truncated 262 chars]
Remediation
View remediation

Remediation Suggestions

  1. Define a conservative maximum body size appropriate for TTS input, such as 64 KiB.
  2. Reject a declared Content-Length above that limit before reading the body.
  3. Track the actual number of received bytes so chunked requests cannot bypass the limit.
  4. Destroy or drain oversized requests and return HTTP 413 without continuing to concatenate data.
  5. Configure request, header, and keep-alive timeouts to mitigate slow streaming.
  6. Limit concurrent synthesis requests or introduce a bounded queue.
  7. Validate that input is a string and enforce an application-level character limit before contacting the upstream provider.
  8. Handle aborted client connections and release associated resources promptly.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares capabilities that clearly involve reading environment configuration and making outbound network requests, but it does not declare any tool scope such as permissions or allowed-tools. This weakens reviewability and least-privilege controls, making it easier for operators or downstream systems to invoke the skill without understanding that it accesses secrets and forwards data externally.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

样例:

bash
curl -X POST http://127.0.0.1:18899/audio/speech \
  -d '{"input":"<style>东北话</style>哎呀妈呀,这天儿也太冷了!","voice":"mimo_default","response_format":"opus"}'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill documentation explains setup and usage but does not prominently warn that user-provided text and the configured Xiaomi API key are sent to an external third-party service. This creates a data handling and privacy risk because users may unknowingly forward sensitive content or deploy the proxy in contexts where external disclosure is not acceptable.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 93)May include surrounding context.

复制服务单元文件并注册:

bash
sudo cp mimo-tts-proxy.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now mimo-tts-proxy.service
sudo systemctl status mimo-tts-proxy.service

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 94)May include surrounding context.

复制服务单元文件并注册:

bash
sudo cp mimo-tts-proxy.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now mimo-tts-proxy.service
sudo systemctl status mimo-tts-proxy.service

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 96)May include surrounding context.

复制服务单元文件并注册:

bash
sudo cp mimo-tts-proxy.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now mimo-tts-proxy.service
sudo systemctl status mimo-tts-proxy.service

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
72% confidence
Finding

Enabling and starting a service with sudo makes the proxy persist and run automatically, which increases blast radius if the proxy or service definition is misconfigured or later compromised. In combination with absent permission declarations and weak disclosure of external forwarding, persistence makes the skill more dangerous because it turns a one-time test into a continuously running networked component.

Content

Scanner excerpt · SKILL.md (reported line 95)May include surrounding context.

bash
sudo cp mimo-tts-proxy.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now mimo-tts-proxy.service
sudo systemctl status mimo-tts-proxy.service

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The instruction to run systemctl enable --now configures the proxy to persist across reboots, creating a lasting background service that handles API keys and forwards content externally. Persistence is contextually more sensitive here because the skill sets up a long-lived network-facing proxy, so accidental exposure, stale secrets, or unnoticed misuse can continue after the initial setup.

Content

Scanner excerpt · SKILL.md (reported line 95)May include surrounding context.

bash
sudo cp mimo-tts-proxy.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now mimo-tts-proxy.service
sudo systemctl status mimo-tts-proxy.service

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 152)May include surrounding context.

与 OpenAI TTS API 格式兼容:

bash
curl -X POST http://127.0.0.1:18899/audio/speech \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 188)May include surrounding context.

健康检查:

bash
curl http://127.0.0.1:18899/health
# → {"status":"ok","provider":"mimo-v2-tts"}

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This documentation instructs users to send requests, including an API key header, to Xiaomi's external service. External transmission is central to the skill's function, but the risk is real because both user content and credentials are sent off-host and the documentation does not frame the associated privacy and credential-handling implications strongly enough.

Content

Scanner excerpt · SKILL.md (reported line 209)May include surrounding context.

  1. 确认 MIMO_TTS_KEY 正确且有 TTS 配额
  2. 检查上游小米 API 是否可达:
    bash
    curl -X POST https://api.xiaomimimo.com/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "api-key: 你的Key" \
      -d '{"model":"mimo-v2-tts","messages":[{"role":"assistant","content":"test"}],"audio":{"format":"wav","voice":"mimo_default"}}'
    

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code's natural-language interface elements are written exclusively in Chinese, including the file description and usage guidance, and the runtime logs at startup are also Chinese-only. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation unless the constraint is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.