Back to skill

Security audit

chattts_local

Security checks for vulnerabilities and agentic risk

Overview

This text-to-speech skill is purpose-related but needs review because running it can install packages and download unverified model files from a third-party mirror despite local-only framing.

Install only if you are comfortable with first-use network downloads, unpinned Python packages, and model files from hf-mirror.com. Prefer reviewing and pinning dependencies, using a virtual environment, manually downloading verified model artifacts, and confirming that the advertised voice controls meet your needs before relying on it.

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

T08 · Insecure Dependencies

Error
Location
scripts/tts.py:13
Finding

Automatic Installation of Unpinned Python Dependencies

Content
View full analysis

Vulnerability Details

File Location: scripts/tts.py:13-27
Vulnerability Type: Automatic installation of unpinned third-party packages
Risk Level: High

Evidence

python
def install_dependencies():
    try:
        import ChatTTS
        import torch
        import torchaudio
        return True
    except ImportError:
        os.system("pip install ChatTTS torch torchaudio -q")
        try:
            import ChatTTS
            return True
        except ImportError:
            return False

The same unpinned installation command is also documented at SKILL.md:57-61:

bash
pip install ChatTTS torch torchaudio

Technical Analysis

The application automatically invokes pip during normal execution when a required module is unavailable. The packages are specified only by name, without pinned versions, cryptographic hashes, a lockfile, or a reviewed package index.

Python package installation can execute package-controlled build and installation logic. Consequently, a compromised package release, dependency-confusion condition, malicious transitive dependency, or compromised package repository could result in arbitrary code execution before speech generation begins.

Automatic installation also prevents the user from reviewing dependency changes before they are introduced into the runtime environment. The use of os.system is not directly command-injectable here because the command is a constant string, but it still launches a shell and delegates trust to the active pip executable and package index configuration.

Attack Path

  1. An attacker compromises one of the named packages, one of its transitive dependencies, or the package repository serving it.
  2. The attacker publishes a malicious version or installation artifact.
  3. A user invokes scripts/tts.py in an environment where at least one required module is missing.
  4. install_dependencies() auto ...[truncated 906 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove automatic dependency installation from the runtime execution path.
  2. Provide a separate, explicit installation procedure that requires user confirmation.
  3. Pin every direct and transitive dependency to a reviewed version in a lockfile.
  4. Require package hashes, such as through pip install --require-hashes -r requirements.txt.
  5. Use a dedicated virtual environment with minimal permissions.
  6. Configure an approved package index explicitly and disable unintended extra indexes to reduce dependency-confusion risk.
  7. Scan and review dependency updates before changing pinned versions.
  8. Invoke pip through the active interpreter, such as python -m pip, during the controlled setup phase rather than using os.system.

T08 · Insecure Dependencies

Error
Location
scripts/download_models.py:10
Finding

Unverified Model Artifacts Downloaded from a Third-Party Mirror

Content
View full analysis

Vulnerability Details

File Location: scripts/download_models.py:10-33, scripts/download_models.sh:7-31, and scripts/tts.py:50-67
Vulnerability Type: Unverified third-party model supply chain
Risk Level: High

Evidence

scripts/download_models.py selects a third-party mirror and force-downloads a mutable repository snapshot without pinning a revision or verifying hashes:

python
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'

download_path = snapshot_download(
    repo_id="2Noise/ChatTTS",
    local_dir=model_dir,
    local_dir_use_symlinks=False,
    force_download=True
)

scripts/download_models.sh directly downloads PyTorch model artifacts from the same mirror without integrity verification:

bash
HF_MIRROR="https://hf-mirror.com"
REPO="2Noise/ChatTTS"

wget -c "$HF_MIRROR/$REPO/resolve/main/asset/DVAE.pt" -O "$MODEL_DIR/asset/DVAE.pt"
wget -c "$HF_MIRROR/$REPO/resolve/main/asset/spk_stat.pt" -O "$MODEL_DIR/asset/spk_stat.pt"
wget -c "$HF_MIRROR/$REPO/resolve/main/ckpt/model.pt" -O "$MODEL_DIR/ckpt/model.pt"

scripts/tts.py subsequently trusts and loads artifacts from that directory:

python
model_dir = os.path.expanduser("~/.openclaw/ChatTTS/models")
if os.path.exists(os.path.join(model_dir, "asset", "DVAE.pt")):
    chat.load(source="local", custom_path=model_dir)
else:
    chat.download_models()

Technical Analysis

Model configuration and .pt checkpoint files are downloaded from hf-mirror.com without a pinned repository revision, expected SHA-256 digests, or signature verification. The URL uses the mutable main branch, and force_download=True permits previously reviewed local files to be replaced with newer remote content.

PyTorch .pt files may use serialization mechanisms capable of reconstructing Python objects. Whether arbitrary code can execute depends on the behavior and security controls of the installed ChatTTS an ...[truncated 1777 chars]

Remediation
View remediation

Remediation Suggestions

  1. Download artifacts from an approved official source rather than an unaudited mirror.
  2. Pin downloads to a reviewed immutable commit or release instead of main.
  3. Maintain expected SHA-256 digests for every downloaded file and reject mismatches before loading.
  4. Verify publisher signatures where the model distributor provides them.
  5. Remove force_download=True unless an explicitly authorized update is being performed.
  6. Prefer non-executable model formats such as safetensors.
  7. Configure PyTorch loading to use restricted or weight-only deserialization where supported.
  8. Download to a staging directory, validate every artifact, and atomically move only verified files into the trusted model directory.
  9. Apply restrictive directory and file permissions to prevent unrelated local processes from replacing cached models.
  10. Treat model updates as dependency updates requiring review, scanning, and controlled deployment.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documentation advertises runtime controls such as speed, pitch, and emotion, but the provided material does not demonstrate implementation of these features. While this is less severe than active code execution issues, inaccurate capability claims can cause unsafe automation decisions and weaken operator trust in what the skill actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documentation advertises runtime controls such as speed, pitch, and emotion, but the provided material does not demonstrate implementation of these features. While this is less severe than active code execution issues, inaccurate capability claims can cause unsafe automation decisions and weaken operator trust in what the skill actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The documentation advertises runtime controls such as speed, pitch, and emotion, but the provided material does not demonstrate implementation of these features. While this is less severe than active code execution issues, inaccurate capability claims can cause unsafe automation decisions and weaken operator trust in what the skill actually does.

Content

No source excerpt is available for this finding.

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The script executes a shell command to install packages at runtime via os.system, which introduces an unexpected command-execution side effect and delegates trust to the user's shell and package-index configuration. In a skill advertised as local/offline, silently pulling and executing remote packages substantially expands the attack surface and can lead to supply-chain compromise or unintended system modification.

Content

Scanner excerpt · scripts/tts.py (reported line 22)May include surrounding context.

python
return True
    except ImportError:
        print("正在安装依赖...")
        os.system("pip install ChatTTS torch torchaudio -q")
        try:
            import ChatTTS
            return True

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill claims to be fully local and API-key-free, but the code fetches dependencies at runtime, so its behavior is materially more network-dependent than advertised. This mismatch can bypass user expectations and security controls in environments that permit local processing but prohibit runtime downloads, increasing supply-chain and privacy risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
79% confidence
Finding

The skill documentation indicates shell execution, file access, and environment interaction but does not declare any tool scope or permissions boundaries. This increases the risk that an agent may invoke broader capabilities than intended, especially for package installation and script execution, without an explicit least-privilege contract.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger phrases are broad, natural-language expressions that overlap with ordinary conversation, making accidental invocation more likely. In an agent setting, this can cause unintentional shell/script execution, file generation, or model-loading behavior when the user did not explicitly intend to run the skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The docstring and all user-facing print messages are written in Chinese, which imposes a specific language on users. Under the policy criteria, locale or language constraints should be opt-in or clearly justified as region-specific, and this file provides neither.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description says the skill is '完全本地运行' and '免费无需 API Key', which implies operation stays local. However, this script explicitly configures a remote mirror endpoint and performs a network download of the ChatTTS model from HuggingFace, which is behavior beyond a purely local-only interpretation of the description.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script contradicts the skill's 'fully local' claim by downloading model artifacts from a remote mirror at install/setup time. This is security-relevant because it introduces a supply-chain and trust-boundary risk: users may believe no network access or third-party dependency retrieval occurs, while the script fetches executable model data from an external host without integrity verification such as pinned hashes or signatures.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The top-level docstring says the script converts text into natural Chinese speech, which is a language-specific constraint expressed in natural language. The file does not offer a user language choice or explain why Chinese-only output is required, so it may violate the language/locale policy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Automatically invoking package installation without explicit informed consent is dangerous because it causes network access and system modification from a simple text-to-speech run. In security-sensitive or sandboxed environments, this can violate policy and expose the host to package-repository or dependency-chain risks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

generate_speech accepts speed, pitch, and seed, and the CLI advertises those options, but none of them are used when constructing inference parameters or post-processing audio. The manifest also claims emotion control support, yet there is no argument or inference setting implementing emotion selection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script downloads model files from a remote mirror at runtime after setting a custom Hugging Face endpoint, but the user is only given a progress-style message rather than a meaningful security disclosure. This is especially relevant because the skill is described as local, so hidden network fetches can surprise operators and import risk from a non-default third-party mirror.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's natural-language comments and user-facing echo messages are all in Chinese, including status and completion messages. This imposes a specific language on users without any visible opt-in, fallback, or documentation that the skill is intended only for a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The dependency-check helper is presented as a benign checker/installer, but it performs package installation with side effects during normal execution. While not direct code injection by itself, this hidden behavior weakens user consent and can trigger unreviewed software changes on the host.

Content

No source excerpt is available for this finding.