Back to skill

Security audit

小米 MiMo TTS

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Xiaomi MiMo text-to-speech helper, with privacy and credential-handling caveats users should understand before use.

Install only if you are comfortable sending the text you ask it to synthesize to Xiaomi MiMo's remote API. Do not pass API keys with --api-key; use MIMO_API_KEY or protected OpenClaw settings instead, and avoid using this skill for secrets, private personal data, or regulated content.

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/mimo_tts.py:81
Finding
API Key Exposure Through Command-Line Arguments## Vulnerability Details **File Location**: `scripts/mimo_tts.py`, lines 81-87 **Vulnerability Type**: API credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```python parser.add_argument("--api-key", "-k", default=None, help="API密钥 (也可通过 MIMO_API_KEY 环境变量设置)") args = parser.parse_args() if args.api_key: os.environ["MIMO_API_KEY"] = args.api_key ``` ### Technical Analysis The script accepts the MiMo API key through the `--api-key` command-line option. Command-line arguments are not an appropriate channel for sensitive credentials because they may be exposed through: - Process listings and process-monitoring interfaces while the command is running. - Shell command history. - System audit or endpoint-monitoring logs. - Job schedulers, diagnostic reports, and command-execution telemetry. - Wrapper scripts or automation configuration containing the full command. Assigning the supplied value to `os.environ` does not remove it from the original argument vector. It also creates an additional in-process copy that may be inherited by child processes if the script is later extended to launch them. ### Attack Path 1. A user invokes the script with a command such as `python3 scripts/mimo_tts.py "text" --api-key SECRET`. 2. The secret becomes part of the process argument vector and may also be recorded in shell history or operational logs. 3. A local user, monitoring service, log reader, or other principal with access to this metadata retrieves the key. 4. The attacker submits unauthorized requests to the Xiaomi MiMo API using the exposed credential. 5. The attacker consumes the associated quota or performs API operations permitted by the compromised key until it is revoked. Exploitation requires access to process metadata, command history, automation configuration, or logs containing the invocation. No remote code-execution path was identified. ...[truncated 534 chars]
Remediation
## Remediation Suggestions - Remove the `--api-key` and `-k` command-line options. - Prefer the existing `MIMO_API_KEY` environment-variable mechanism when the execution environment can protect environment values. - For interactive use, obtain the credential through `getpass.getpass()` so it is not echoed or stored in shell history. - For production use, retrieve the key from a dedicated secret manager or a permission-restricted configuration file. - If the local configuration fallback remains supported, verify that the configuration file is owned by the expected user and reject files with overly permissive access modes. - Avoid copying credentials between storage mechanisms unless necessary, and never print credentials in errors or diagnostic output. - Document credential rotation procedures and advise users who previously used `--api-key` to clear relevant shell history and logs and rotate potentially exposed keys.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill demonstrates access to an environment variable (`MIMO_API_KEY`) but does not declare any tool scope or permissions metadata. This weakens least-privilege controls and obscures the skill's actual capabilities, making it harder for users or the platform to assess what the skill can access.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger language includes broad phrases like 'any TTS-related request,' which can cause the skill to activate on ambiguous user input. Overly broad activation increases the chance of unintended invocation and accidental transmission of sensitive text to the external TTS provider.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill description does not warn users that their text will be sent to Xiaomi's external TTS service and that generated audio will be written to a WAV file. Missing disclosure undermines informed consent and can lead to privacy or data-handling surprises if users provide sensitive content.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The quick usage example 'send voice' is vague and may encourage invocation from incomplete or ambiguous requests. In the context of a skill that sends content to a third-party API and writes audio files, this raises the risk of accidental activation and unintended data handling.

External Transmission

Medium
Category
Data Exfiltration
Content
client = OpenAI(
    api_key=os.environ.get("MIMO_API_KEY"),
    base_url="https://api.xiaomimimo.com/v1"
)

# Clip voice style
Confidence
84% confidence
Finding
The example code transmits user-provided synthesis text to `https://api.xiaomimimo.com/v1`, which is expected for TTS functionality but still constitutes external data exfiltration from the local environment to a third party. In this skill's context, the behavior is legitimate, yet it becomes risky if sensitive or unintended content is synthesized without clear consent and scope restrictions.

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
The script hard-codes a default Chinese voice and Chinese style, and its natural-language help/instructions are entirely in Chinese. This imposes a specific language/locale by default without offering an explicit language choice or documenting that the tool is intended only for a Chinese-specific context.

External Transmission

Medium
Category
Data Exfiltration
Content
client = OpenAI(
        api_key=api_key,
        base_url="https://api.xiaomimimo.com/v1"
    )
    
    try:
Confidence
84% confidence
Finding
The code is explicitly configured to send requests to an external service endpoint, which means both user text and authentication material are used in remote processing. In a TTS skill this is expected functionality, but it remains a genuine security/privacy boundary crossing that becomes risky when users are not clearly informed and when sensitive text may be forwarded automatically.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script transmits arbitrary user-provided text to a third-party TTS service, but it does not provide any explicit notice or consent prompt at the point of transmission. In an agent-skill context, users may assume local processing and could inadvertently send sensitive content off-device, creating a real privacy and data-handling risk.

Static analysis

No suspicious patterns detected.