T09 · Insecure Skill Coding Practices
- 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-22andtts-proxy.mjs:139-147
Vulnerability Type: Unrestricted transmission of credentials and user content to a configurable endpoint
Risk Level: MediumVulnerable 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-82permit 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=18899The 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_BASEis 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-keyheader. - 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
- An a ...[truncated 1307 chars]
- The Xiaomi API key through the
- Remediation
View remediation
Remediation Suggestions
- Default to the fixed official endpoint
https://api.xiaomimimo.com. - Parse the configured value with
URLand reject all schemes other than HTTPS. - Allowlist the official hostname by default.
- If custom proxies are a required feature, require a separate explicit opt-in such as
MIMO_ALLOW_CUSTOM_BASE=true. - Display a clear warning that a custom proxy receives both the API key and submitted text.
- Reject URLs containing embedded credentials, unexpected ports, fragments, or unsupported schemes.
- Consider allowing custom certificate pinning or trusted certificate-authority configuration for approved enterprise proxies.
- Use a provider credential scoped only to TTS and constrained by quota where the provider supports such controls.
- Protect the environment file with owner-only permissions and document credential rotation after suspected endpoint compromise.
- Default to the fixed official endpoint
