Back to skill

Security audit

xiaomi-tts-chapters

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent text-to-speech purpose, but it needs review because its wrapper can execute injected shell commands and can expose user text and API credentials.

Review this skill before installing. Use it only with chapter text you are comfortable sending to a remote TTS provider, avoid custom --base-url values unless you fully trust the endpoint, prefer setting the API key through the environment, and do not run scripts/run.sh with untrusted arguments until the eval command construction and dependency pinning are fixed.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run.sh:167
Finding

Arbitrary Command Execution Through Shell Eval Injection

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/synthesize.py:45
Finding

Unrestricted API Endpoint Permits Credential and Chapter-Content Disclosure

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run.sh:167
Finding

API Key Exposed Through Process Arguments and Terminal Output

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/requirements.txt:1
Finding

Automatically Installed Unbounded Dependency Creates Supply-Chain Risk

Content
View full analysis
=1.0.0 ``` ```bash check_venv() { local script_dir="$(cd "$(dirname "$0")" && pwd)" local venv_dir="$script_dir/venv" if [ ! -d "$venv_dir" ]; then echo -e "${YELLOW}创建虚拟环境...${NC}" python3 -m venv "$venv_dir" source "$venv_dir/bin/activate" pip install -r "$script_dir/requirements.txt" else source "$venv_dir/bin/activate" fi } ``` ### Technical Analysis The dependency declaration permits every current and future `openai` release at or above version 1.0.0. No upper bound, lock file, or package hashes are provided. On first launch, `run.sh` automatically invokes pip, causing the latest matching direct and transitive dependencies to be downloaded and installed. This means that the code executed after installation can differ from the version reviewed during the audit. A compromised upstream release, malicious transitive dependency, or incompatible future update could introduce unexpected behavior. The package name itself is not shown to be typosquatted or malicious; the confirmed issue is the unsafe dependency-management practice and automatic installation behavior. ### Attack Path 1. The Skill is run on a system where `scripts/venv` does not exist. 2. `run.sh` creates a virtual environment and automatically invokes pip. 3. Pip resolves the newest versions satisfying `openai>=1.0.0`, including transitive dependencies. 4. Package installation and import-time code execute under the invoking user's account. 5. If a resolved release or dependency is compromised, its payload gains the same user-level access as the Skill. Exploitation depends on an upstream package or distribution-channel compromise, so this finding is less directly exploitable than the ...[truncated 354 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (17)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README states the skill uses the Xiaomi MiMo TTS API but does not clearly warn that chapter contents will be transmitted to a third-party external service for synthesis. If users process novels, drafts, or private documents, they may unknowingly disclose sensitive or copyrighted content to an external provider, creating privacy, compliance, and data-handling risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrases include very broad terms such as 'TTS合成' and '文字转语音', which can overlap with normal user requests and cause the skill to activate unexpectedly. In a skill that sends user-provided chapter text to an external API, accidental invocation can lead to unintended data processing and external transmission.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises behavior that requires shell execution, file reads/writes, and access to an API key from environment variables, but it does not declare any tool scope or permission boundaries. This weakens least-privilege controls and makes it easier for an agent runtime to invoke the skill with broader capabilities than users may expect, increasing the blast radius if the skill is misused or compromised.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases include broad requests like 'TTS合成' and '文字转语音', which can match many generic text-to-speech requests outside the intended chapter-to-audiobook workflow. Overbroad activation can cause the skill to run unexpectedly on unrelated content, leading to unintended file handling or external transmission of user text.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description says the skill uses Xiaomi MiMo TTS but does not clearly warn that chapter contents will be sent to an external third-party API for processing. Because chapter files may contain sensitive, private, or copyrighted material, users may unknowingly disclose data outside the local environment, making this especially risky for a file-processing skill.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/base_tts.py (reported line 47)May include surrounding context.

python
def get_audio_duration(self, filepath: str) -> float:
        """获取音频文件时长(秒)"""
        try:
            result = subprocess.run(
                ['afinfo', filepath],
                capture_output=True,
                text=True

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

The code feeds attacker-influenced file paths into ffmpeg's concat demuxer with -safe 0, which disables path safety checks and permits arbitrary paths to be referenced from the generated list file. In a skill that processes user-supplied chapter/output paths, this expands the trusted file surface and can enable unintended local file access or processing of attacker-chosen files by ffmpeg, a historically high-risk parser.

Content

Scanner excerpt · scripts/base_tts.py (reported line 288)May include surrounding context.

python
f.write(f"file '{safe_path}'\n")
            
            try:
                result = subprocess.run(
                    [
                        'ffmpeg', '-y', '-f', 'concat', '-safe', '0',
                        '-i', concat_list_path,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code sends arbitrary chapter text to Xiaomi's remote MiMo TTS service via chat.completions.create, but this file provides no disclosure, consent flow, or indication that user content leaves the local environment. For a document-to-audio skill, users may supply private manuscripts or sensitive text, so silent third-party transmission creates a real privacy and data-handling risk even if the functionality is intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's natural-language interface, including help output and prompts, is entirely in Chinese. This forces a specific language on users without offering a locale choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script exposes a --base-url parameter even though the skill is described as using the Xiaomi MiMo TTS API. A user or upstream caller can redirect requests to an arbitrary endpoint, causing both chapter contents and the MiMo API key to be sent to an attacker-controlled server; in this skill context, that directly affects sensitive user content and credentials.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

该技能声明的核心用途是把章节文件转换为音频,但 check_venv 会自动创建环境并从依赖源安装软件包。对于一个 TTS 转换技能而言,这属于额外的执行环境管理/软件获取能力,而不是清单中明确说明的功能范围。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains user-facing natural-language descriptions exclusively in Chinese, including the module docstring and later CLI help/output strings. That creates a locale/language policy concern because the skill forces a specific language experience without documenting user choice or an explicit region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
65% confidence
Finding

SQP-3 适用于所有文件类型。该文档整体以中文说明技能使用方式并在 L94 仅提供中文触发词,可能构成默认语言约束;同时虽列出英文音色,但未明确技能交互语言是否可由用户选择。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This Python file contains natural-language documentation and runtime messages exclusively in Chinese, such as the module docstring and multiple print statements. Under the policy rule for language/locale, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstrings and printed user-facing messages are written only in Chinese, which imposes a specific language without offering user opt-in or documenting a justified locale restriction. This can violate language/locale policy when the skill is intended for broader use.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
91% confidence
Finding

The dependency specification uses a lower-bound only constraint (openai>=1.0.0), which permits installation of any future major or minor release. This can introduce supply-chain and stability risk because a later release could contain a vulnerable or incompatible version that gets pulled automatically during deployment.

Content

Scanner excerpt · scripts/requirements.txt (reported line 1)May include surrounding context.

text
openai>=1.0.0

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

When the virtual environment is missing, the script creates a venv and installs dependencies, which modifies the local filesystem and pulls code from external package sources. The script only prints progress messages like '创建虚拟环境...' and does not clearly disclose that it will create files and install packages automatically.

Content

No source excerpt is available for this finding.