Back to skill

Security audit

Chattts

Security checks for vulnerabilities and agentic risk

Overview

This TTS skill is purpose-built, but it sends user text over plaintext HTTP to a hard-coded private-network endpoint while describing the service as local.

Review before installing. Use this only if you control and trust the ChatTTS server at the configured URL, avoid submitting sensitive text unless the endpoint is local or protected, and prefer setting CHATTTS_API_URL to a loopback or HTTPS endpoint you manage.

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/tts.mjs:25
Finding
Plaintext Transmission of User-Provided Text to a Non-Loopback Service## Vulnerability Details **File Location**: `scripts/tts.mjs:25-42` **Vulnerability Type**: Plaintext transmission of potentially sensitive user data **Risk Level**: Medium ### Vulnerable Code ```js // 2. 获取后台 API 地址,默认指向你的 Python FastAPI 端口 const apiUrl = process.env.CHATTTS_API_URL || 'http://172.23.252.114:8020'; // 3. 构造请求负载 const payload = { text: text, seed: values.seed ? parseInt(values.seed) : 2048, // 注意:如果想让下面这两个参数生效,你的 Python FastAPI 的 TTSRequest 模型里也需要加上这两个字段 temperature: values.temperature ? parseFloat(values.temperature) : 0.7, top_p: values.top_p ? parseFloat(values.top_p) : 0.7 }; // 4. 发送请求到 Python 服务端 const response = await fetch(`${apiUrl}/v1/audio/speech`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }); ``` The documented default endpoint is also plaintext: ```text Requires the local ChatTTS FastAPI server to be running (default target: http://172.23.252.114:8020). ``` ### Technical Analysis The script serializes the complete user-supplied TTS text into a JSON request and transmits it to the default endpoint `http://172.23.252.114:8020`. Although this is a private-network address, it is not a loopback address and may identify a separate host on the local network. HTTP does not provide transport confidentiality, integrity, or authenticated server identity. A network-positioned attacker could observe or modify the request. An attacker able to impersonate or control the service could also return attacker-controlled JSON, including an arbitrary `file_path`. The script prints that value without validating its type or ensuring it belongs to an expected audio-output directory. ### Attack Path 1. A user invokes the Skill with text containing confidential messages, personal information, source code, credentials, or other sensitive content. 2. If `CHATTTS_API_URL` is unset, the script selects the hard-coded non-loopback HTTP endpoint. 3. The script places the complete text ...[truncated 1170 chars]
Remediation
## Remediation Suggestions 1. Default to a loopback endpoint, such as `http://127.0.0.1:8020`, if the ChatTTS service is intended to run on the same machine. 2. Require HTTPS with valid certificate verification whenever the service is hosted on another machine. 3. Reject non-HTTPS URLs unless the configured host is explicitly verified as loopback. 4. Clearly disclose that submitted text is sent to the configured ChatTTS service and may contain sensitive data. 5. Correct the Skill metadata so that it declares `CHATTTS_API_URL` as the required environment variable rather than placing the endpoint URL in the environment-variable list. 6. Validate the response status, content type, and JSON schema before consuming it. 7. Require `data.file_path` to be a string resolving beneath a dedicated, trusted audio-output directory; reject absolute or traversing paths outside that directory. 8. Apply authentication to the ChatTTS API where it is reachable from other hosts, and restrict network access using host firewall rules or equivalent controls.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Credential Access

High
Category
Privilege Escalation
Content
## Notes
- Requires the local ChatTTS FastAPI server to be running (default target: http://172.23.252.114:8020).
- Ensure CHATTTS_API_URL is set in your .env file if the API is hosted on a different machine.
- PRO TIP: Always try to insert [laugh] (laughter) and [uv_break] (pauses/breaths) into the text to make the generated voice sound exactly like a real human.
- The script will return the absolute local file path of the generated .wav audio file.
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The sample invocations and primary user-facing text input examples require Chinese text, but the document does not state that the skill is intentionally limited to Chinese users or provide an opt-in language choice. This can conflict with language/locale policy expectations because it implicitly forces a specific language for normal use.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The skill description says it uses a local ChatTTS API, but the script sends all user text to a configurable HTTP endpoint and defaults to a hard-coded private-network address. This creates a real data-flow/security issue because sensitive user text may be transmitted off-process or off-host without clear disclosure, and the use of plain HTTP also permits interception or tampering on the network path.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The script sends user-provided text directly to a network service without any user-facing warning or consent flow, despite the skill being presented as using a local API. In a TTS skill, user text may contain private or sensitive content, so undisclosed network exfiltration to a configurable endpoint meaningfully increases privacy and integrity risk.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The script emits error text in Chinese, which forces a specific language for user-visible output. The policy allows locale constraints only when users are given a choice or the limitation is clearly documented and justified.

Intent-Code Divergence

Low
Confidence
98% confidence
Finding
The inline comments and error handling describe the backend as a local FastAPI service and tell the operator to check port 8080. In reality, the default URL is http://172.23.252.114:8020, so the guidance contradicts the actual configured target and can misrepresent where data is sent.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
These error messages are presented only in Chinese, imposing a fixed locale for user-facing communication. There is no visible opt-in, fallback language, or documentation justifying a Chinese-only experience.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/tts.mjs:26