Back to skill

Security audit

Lipvoice Tts

Security checks for vulnerabilities and agentic risk

Overview

This LipVoice skill mostly matches its voice-cloning purpose, but it handles sensitive voice data and an API key with under-scoped safeguards, including a credential-leak risk on generated-audio downloads.

Review before installing. Use only audio you own or have explicit consent to clone, avoid sending sensitive text, prefer an environment variable over command-line API keys, and do not use the delete command unless you have verified the exact model ID. The download path should be fixed before use so the API key is not sent to arbitrary URLs returned by the service.

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

Error
Location
scripts/lipvoice_tts.py:147
Finding

API Key Forwarded to an Unvalidated Remote Download URL

Content
View full analysis

Vulnerability Details

File Location: scripts/lipvoice_tts.py, lines 147–153
Vulnerability Type: Credential disclosure through an unvalidated remote URL
Risk Level: High

Vulnerable Code

python
voice_url = query_result['data'].get('voiceUrl')
if voice_url:
    # Determine the output filename
    if not output:
        output = f"tts_{task_id[:8]}.wav"
    # Download audio
    try:
        req = urllib.request.Request(voice_url, headers={'sign': API_KEY})
        with urllib.request.urlopen(req, timeout=60) as response:

Technical Analysis

The synthesis API controls the value of voice_url. The script uses this URL without validating its scheme, hostname, port, or relationship to the configured LipVoice API origin. It then includes the enterprise API key in the sign HTTP header when requesting that URL.

Consequently, any server capable of manipulating the API response can direct the client to send the API key to an arbitrary host. This includes a compromised LipVoice service, compromised upstream infrastructure, or an attacker otherwise capable of altering the returned JSON. Redirects may create an equivalent risk unless each redirect destination is independently validated.

Transmitting the synthesis text and reference audio to the declared LipVoice API is required for the advertised functionality. Forwarding the API credential to an unrestricted download destination is not required and exceeds the minimum privilege necessary to download the generated audio.

Attack Path

  1. The user invokes the tts command with a valid enterprise API key.
  2. The script creates a synthesis job and polls /tts/result.
  3. An attacker who controls or compromises the API response supplies an attacker-controlled URL in the voiceUrl field, such as https://attacker.example/collect.
  4. The script constructs a request to that URL and adds sign: <LIPVOICE_API_KEY>.
  5. The attacker-con ...[truncated 814 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not attach the API key to generated-audio download URLs. The service should return a short-lived presigned URL that can be downloaded without authentication.
  2. If authentication is unavoidable, parse the URL and require:
    • The https scheme.
    • An exact allowlisted hostname.
    • An expected port.
    • No embedded user information.
    • A path belonging to the expected download endpoint.
  3. Reject non-HTTPS URLs, IP-literal destinations, unexpected subdomains, and malformed URLs.
  4. Disable automatic redirects for authenticated requests, or validate the scheme and exact hostname of every redirect before forwarding credentials.
  5. Separate authenticated API requests from unauthenticated media downloads so credentials cannot be added accidentally to arbitrary URLs.
  6. Rotate any API key that may already have been used with untrusted API responses.
  7. Prefer obtaining the API key from a protected environment variable or secret manager. Avoid recommending --api-key because command-line arguments may be exposed through process listings and shell history.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Tainted flow: 'req' from os.environ.get (line 64, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/lipvoice_tts.py (reported line 67)May include surrounding context.

python
req = urllib.request.Request(url, data=req_data, headers=headers, method=method)
    
    try:
        with urllib.request.urlopen(req, timeout=120) as response:
            return json.loads(response.read().decode())
    except urllib.error.HTTPError as e:
        return json.loads(e.read().decode())

Tainted flow: 'req' from os.environ.get (line 151, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The download step trusts a voiceUrl returned by the remote service and uses it directly in urlopen, while also attaching the API key in the sign header. If the remote service is compromised or returns an unexpected host, this can cause credential leakage to an arbitrary URL and enables SSRF-like outbound requests from the agent environment.

Content

Scanner excerpt · scripts/lipvoice_tts.py (reported line 152)May include surrounding context.

python
# 下载音频
                    try:
                        req = urllib.request.Request(voice_url, headers={'sign': API_KEY})
                        with urllib.request.urlopen(req, timeout=60) as response:
                            with open(output, 'wb') as f:
                                f.write(response.read())
                        print(f"✅ 合成完成!已保存到: {os.path.abspath(output)}")

Lp1

High
Category
MCP Least Privilege
Confidence
95% confidence
Finding

Undeclared network capability is material in this context because the skill uploads local audio, sends text to a third-party API, polls remote task status, and downloads generated files. Hidden network behavior increases the risk of unintended data exposure and bypasses permission-based review controls.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
95% confidence
Finding

Undeclared network capability is material in this context because the skill uploads local audio, sends text to a third-party API, polls remote task status, and downloads generated files. Hidden network behavior increases the risk of unintended data exposure and bypasses permission-based review controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly supports voice cloning and text-to-speech synthesis using uploaded reference audio, but it does not warn about consent, impersonation, privacy, or ownership requirements. In this context, omission of those safeguards can enable misuse for unauthorized voice cloning, social engineering, or processing of third-party biometric data without informed permission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documented delete operation removes a model by ID with no caution about destructive behavior, confirmation step, or recovery limitations. This increases the risk of accidental or unauthorized deletion of voice models, especially because the skill is user-invocable and exposes direct execution commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The upload workflow reads a local audio file and sends its full contents to a third-party API without an explicit warning or confirmation at the point of action. Because voice samples are sensitive biometric/identity-related data, silent transmission is more dangerous in this skill context than ordinary file upload behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code includes a destructive delete capability that is not reflected in the skill description, which creates a functionality mismatch. In agent ecosystems this is risky because users may invoke a skill expecting only create/list/TTS behavior, while the implementation can remove remote models, leading to accidental or unauthorized destructive actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The delete operation performs an irreversible remote action immediately based on the provided audio_id, with no confirmation prompt or safety interlock. In an agent setting, mistakes in parameter selection or prompting can easily delete the wrong voice model and cause data loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The TTS workflow sends user-provided text to a remote API without explicit disclosure. This is a privacy/transparency issue rather than code execution, but it can still expose sensitive prompts, names, or proprietary text to a third party.

Content

No source excerpt is available for this finding.