Back to skill

Security audit

🗣️ Text-to-speech using GLM-TTS for generating audio

Security checks for vulnerabilities and agentic risk

Overview

This TTS skill is disclosed and purpose-aligned, but it asks users to extract a browser session token and gives it to an unpinned runtime package.

Review before installing. Only use this if you are comfortable giving a browser-derived Z.ai session token to a command-line package and sending selected text or files to the external TTS service. Prefer a version-pinned client and a proper scoped API credential if available, and avoid processing sensitive documents or private prompts.

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 (3)

T08 · Insecure Dependencies

Error
Location
SKILL.md:48
Finding
Unpinned Third-Party Package Is Dynamically Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 48-60 **Vulnerability Type**: Unpinned runtime dependency execution **Risk Level**: High **Vulnerable Code**: ```shell uvx zai-tts -t "{msg}" -o {tempdir}/{filename}.wav uvx zai-tts -f path/to/file.txt -o {tempdir}/{filename}.wav ``` ```shell uvx zai-tts -t "{msg}" -o {tempdir}/{filename}.wav --speed 1.5 uvx zai-tts -t "{msg}" -o {tempdir}/{filename}.wav --speed 1.5 --volume 2 ``` ```shell uvx zai-tts -t "{msg}" -o {tempdir}/{filename}.wav --voice system_002 ``` ### Technical Analysis The skill repeatedly invokes `uvx zai-tts` without specifying an exact package version, lockfile, artifact hash, or other integrity constraint. `uvx` can resolve and execute the third-party package at runtime. Consequently, the code executed by future invocations may differ from the package version that was originally reviewed. If the package distribution account, package repository, release process, or dependency chain is compromised, an attacker can publish malicious executable code under a version that is automatically resolved by `uvx`. The downloaded process inherits the invoking user's privileges and can potentially access the filesystem, network, and environment variables, including `ZAI_AUDIO_TOKEN`. ### Attack Path 1. An attacker compromises the package publisher, package repository, or a transitive dependency used by `zai-tts`. 2. The attacker publishes a malicious package version containing installation-time or runtime code. 3. A user or Agent follows the skill instructions and runs `uvx zai-tts` without a version constraint. 4. `uvx` resolves and executes the attacker-controlled release. 5. The malicious code operates with the invoking process's permissions and may read credentials, access local files, transmit data, or modify the system. ### Impact Assessment Successful exploitation can result in arbitrary code execution with the privi ...[truncated 354 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Pin `zai-tts` to a specific, reviewed version in every command. - Use a lockfile and require cryptographic hashes for the package and its transitive dependencies. - Verify that the package registry publisher and source repository correspond to the intended project. - Establish a controlled update process in which new versions are reviewed before deployment. - Run the package in a restricted sandbox with minimal filesystem access, constrained network access, and no unnecessary environment variables. - Provide the Z.ai credential only to the component that requires it rather than exposing the complete parent environment. - Monitor package provenance and verify signed releases where supported. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:21
Finding
Browser Session Token Is Exposed to a Dynamically Executed Process<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 21-31 **Vulnerability Type**: Unsafe authentication-token handling **Risk Level**: High **Vulnerable Code**: ```yaml { "id": "token", "kind": "input", "label": "Auth Token", "description": "Login `audio.z.ai` and executing `JSON.parse(localStorage['auth-storage']).state.token` in the console via F12 Developer Tools", "secret": true, "envVar": "ZAI_AUDIO_TOKEN", }, ``` The corresponding instructions also state: ```text Before using this skill, you need to configure the environment variables `ZAI_AUDIO_USERID` and `ZAI_AUDIO_TOKEN`, which can be obtained by login `audio.z.ai` and executing `localStorage['auth-storage']` in the console via F12 Developer Tools. ``` ### Technical Analysis The skill instructs users to extract an active web authentication token directly from browser local storage and place it in the `ZAI_AUDIO_TOKEN` environment variable. Although the metadata correctly marks the token as secret, environment variables are inherited by child processes by default. In this skill, the child process is an unpinned third-party package dynamically resolved through `uvx`. Any malicious or compromised package code can read `ZAI_AUDIO_TOKEN` from its process environment. A browser session token may also have broader permissions and a longer effective lifetime than a purpose-specific, scoped API credential. Environment variables may additionally be exposed through diagnostic output, crash reports, debugging facilities, process inspection available to same-user or privileged processes, or accidental logging by invoked tools. ### Attack Path 1. The user signs in to `audio.z.ai` and extracts the session token from browser local storage. 2. The user configures the token as `ZAI_AUDIO_TOKEN`. 3. The skill starts `uvx zai-tts`, and the child process inherits the environment variable. 4. A compromised package, transitive ...[truncated 616 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Replace browser-session-token extraction with an official API key or OAuth authorization flow. - Request a narrowly scoped, short-lived credential limited to TTS operations. - Do not expose the credential to unrelated child processes or the complete runtime environment. - Use the platform's protected secret store and inject the credential only at the point of authenticated communication. - Prevent tokens from appearing in command lines, logs, exception reports, telemetry, or generated files. - Document credential expiration, revocation, and rotation procedures. - Run the TTS client with minimal privileges and restrict outbound communication to required Z.ai endpoints. - Ensure any executed client package is pinned and integrity-verified before it receives the credential. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:48
Finding
User-Controlled Values Are Interpolated into Shell Command Templates<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 48-60 **Vulnerability Type**: Shell command injection **Risk Level**: High **Vulnerable Code**: ```shell uvx zai-tts -t "{msg}" -o {tempdir}/{filename}.wav uvx zai-tts -f path/to/file.txt -o {tempdir}/{filename}.wav ``` ```shell uvx zai-tts -t "{msg}" -o {tempdir}/{filename}.wav --speed 1.5 uvx zai-tts -t "{msg}" -o {tempdir}/{filename}.wav --speed 1.5 --volume 2 ``` ```shell uvx zai-tts -t "{msg}" -o {tempdir}/{filename}.wav --voice system_002 ``` ### Technical Analysis The examples construct shell command strings by placing message and path placeholders directly into command text. The `{msg}` placeholder is enclosed in double quotes, but double quoting alone is insufficient if substitution is performed without shell-aware escaping. A message containing a double quote can terminate the intended argument and introduce shell operators or additional commands. The `{tempdir}` and `{filename}` placeholders are not quoted at all. Spaces, command separators, substitutions, redirection operators, glob characters, or other shell metacharacters in these values can alter command parsing. Whether exploitation occurs depends on how the Agent implements placeholder replacement and process execution. Direct string substitution followed by execution through a shell creates the vulnerable path. ### Attack Path 1. An attacker supplies TTS text containing a closing quote and shell syntax, or influences the requested output filename. 2. The Agent substitutes the value verbatim into one of the documented command templates. 3. The Agent executes the resulting string through a shell. 4. The shell interprets the injected metacharacters as syntax rather than as part of the TTS text or filename. 5. The injected command executes with the same privileges and environment as the Agent, potentially including access to `ZAI_AUDIO_TOKEN`. ### Impact Assessment ...[truncated 380 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not construct a shell command by concatenating or interpolating user-controlled values. - Invoke `uvx` through a process API that accepts a separate argument array, for example arguments equivalent to `["zai-tts", "-t", msg, "-o", outputPath]`. - Disable shell execution explicitly when supported by the process API. - Generate output filenames internally using a cryptographically secure random identifier rather than accepting arbitrary path components. - Resolve and validate the output path, require it to remain inside an approved temporary directory, and reject traversal sequences. - If shell execution is unavoidable, apply platform-specific escaping to every dynamic argument; argument-array execution should still be preferred. - Add tests using quotes, semicolons, command substitutions, newlines, spaces, traversal sequences, and redirection characters to verify that all values remain literal arguments. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Ssd 3

Critical
Confidence
100% confidence
Finding
The skill explicitly instructs users to extract an auth token from browser localStorage and supply it to the skill as an environment variable. This is highly dangerous because localStorage tokens are often session credentials; copying them into another tool broadens their exposure, bypasses intended browser security boundaries, and can enable account takeover or unauthorized API use if leaked.

Ssd 3

High
Confidence
99% confidence
Finding
The install instructions tell users to retrieve a user identifier directly from browser localStorage via developer tools. Normalizing manual extraction of authentication-related browser state encourages unsafe credential handling practices and increases the chance of accidental disclosure, misuse, or phishing-style imitation by other skills.

Missing User Warnings

High
Confidence
97% confidence
Finding
The usage section shows how to send arbitrary text or files to the GLM-TTS service but does not prominently warn that content is transmitted to an external third party. This is dangerous because users may unknowingly send sensitive prompts, documents, or personal data off-platform, creating privacy, confidentiality, and compliance risks.

Ssd 3

High
Confidence
99% confidence
Finding
The documentation repeats the instruction to obtain required environment variables by reading browser localStorage contents. This institutionalizes insecure secret handling and conditions users to move browser-resident auth material into shell environments, where it may be logged, inherited by subprocesses, or accidentally exposed.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The skill repeatedly instructs use of `uvx zai-tts` without pinning a specific package version or artifact. This creates a supply-chain risk because future upstream releases could change behavior or become compromised, and the agent would fetch and execute whatever version is current at runtime.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The activation guidance is broad enough to trigger on many normal situations like accessibility, multitasking, podcast, driving, or cooking, rather than a narrow explicit user request. In an agent setting, that can cause unintended external transmission of user content and accidental use of stored credentials when the user did not clearly consent to TTS processing.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The command example invokes `uvx zai-tts` without a fixed version, so execution depends on the latest available upstream package at run time. In an agent skill, that increases supply-chain exposure because command behavior can drift or be hijacked without any change to the skill itself.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
This example uses `uvx zai-tts` without constraining the resolved package version. That means the skill may execute newly published code from the package source, making compromise or accidental breaking changes materially possible.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
An unpinned `uvx zai-tts` invocation exposes users to remote package updates outside the skill author's control. In practice, this is a supply-chain weakness because the exact code executed tomorrow may not be the same code reviewed today.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The skill shows another runtime fetch-and-execute pattern via unversioned `uvx zai-tts`. Because the command is intended for agent use, unpinned execution can directly import unreviewed code into the workflow.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
This command example repeats the same unpinned package execution pattern, leaving the skill dependent on whatever code the remote registry serves at invocation time. That is a real and common supply-chain hazard rather than a purely stylistic issue.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The voice-selection example still uses an unpinned `uvx zai-tts` command, so the same supply-chain risk applies regardless of flags. The danger is amplified in agent contexts because users may assume skill commands are stable and pre-reviewed.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
Listing voices via `uvx zai-tts -l` still executes an unpinned remote package. Even seemingly harmless read-only operations can run arbitrary code during package resolution or startup if the upstream package is compromised.

Static analysis

No suspicious patterns detected.