Back to skill

Security audit

Kai Minimax Tts

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward MiniMax text-to-speech helper with local Whisper transcription, but users should treat submitted text and saved outputs as potentially sensitive.

Install only if you are comfortable sending text for speech generation to MiniMax using your API key. Avoid using it with secrets or highly sensitive text, and be aware that generated audio and transcripts are saved in a predictable workspace path unless you configure a custom workspace.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/kai_tts.sh:17
Finding
Predictable Temporary Transcript Path Enables Local File and Symlink Manipulation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/kai_tts.sh`, lines 17–20 **Vulnerability Type**: Unsafe temporary-file handling and symlink vulnerability **Risk Level**: Medium ### Vulnerable Code ```bash whisper "$FILE" --model base --output_format txt --output_dir /tmp BASE=$(basename "$FILE" | sed 's/\.[^.]*$//') cp "/tmp/${BASE}.txt" "${WORKSPACE}/latest_from_blaze.txt" 2>/dev/null || true echo "Done" ``` ### Technical Analysis The script directs `whisper` to write its transcript into the shared `/tmp` directory. The expected output filename is derived predictably from the basename of user-supplied `FILE`. Because `/tmp` is normally writable by other local users, an attacker can anticipate `/tmp/${BASE}.txt` and create that path before the script executes. The path could be a regular file or a symbolic link. This creates a time-of-check/time-of-use and symlink-manipulation condition around both the `whisper` output and the subsequent `cp`. The fixed destination `${WORKSPACE}/latest_from_blaze.txt` can also be unsafe if an attacker with access to the workspace can replace it with a symbolic link before `cp` executes. ### Attack Path 1. The attacker determines or influences the basename of an audio file that the victim will transcribe. 2. The attacker predicts the transcript path, such as `/tmp/recording.txt`. 3. Before the victim invokes the skill, the attacker creates that path as attacker-controlled content or as a symbolic link. 4. The victim runs the script with `--transcribe`. 5. `whisper` and the subsequent `cp` operate on the attacker-controlled path. 6. Depending on filesystem permissions and the behavior of `whisper` and `cp`, attacker-selected content may be copied into the workspace, or a file accessible to the invoking account may be read or overwritten. ### Impact Assessment This flaw primarily affects transcript integrity and file confidentiality. A local attacker may substitute a forged transcript, cause the script to c ...[truncated 363 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create a private temporary directory for every invocation: ```bash TMP_DIR=$(mktemp -d) trap 'rm -rf -- "$TMP_DIR"' EXIT ``` 2. Configure `whisper` to write only into that private directory rather than directly into `/tmp`. 3. Confirm that the generated transcript is a regular file and not a symbolic link before copying it. 4. Create the final output atomically, using a temporary file inside the trusted workspace followed by `mv`. 5. Ensure that the workspace is owned by the invoking user and is not writable by untrusted users. 6. Reject a final destination that already exists as a symbolic link. 7. Do not suppress all copy errors with `2>/dev/null || true`; fail securely and report the actual error. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/kai_tts.sh:13
Finding
Unescaped User Text Permits JSON Request Manipulation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/kai_tts.sh`, line 13 **Vulnerability Type**: Improper JSON construction **Risk Level**: Low ### Vulnerable Code ```bash RESP=$(curl -s -X POST "https://api-uw.minimax.io/v1/t2a_v2" -H "Content-Type: application/json" -H "Authorization: Bearer ${API_KEY}" -d "{\"model\":\"speech-2.8-turbo\",\"text\":\"${TEXT}\",\"stream\":false,\"output_format\":\"hex\",\"voice_setting\":{\"voice_id\":\"${VOICE_ID}\",\"speed\":1},\"audio_setting\":{\"sample_rate\":32000}}") ``` ### Technical Analysis The `TEXT` value is inserted directly into a JSON string without JSON escaping. Quotes, backslashes, line breaks, and other control characters can therefore terminate or alter the intended `text` value. A crafted input can produce malformed JSON or inject additional object members into the request sent to the MiniMax API. This is not shell command injection because the expansion occurs inside a quoted shell argument, but it does allow manipulation of the serialized API request. ### Attack Path 1. An attacker supplies speech text containing JSON metacharacters, such as quotation marks and object delimiters. 2. The script interpolates the text directly into the JSON body. 3. The resulting request is either syntactically invalid or contains attacker-influenced JSON fields outside the intended `text` value. 4. The MiniMax endpoint rejects the request or processes the modified request structure. 5. The skill fails, consumes API resources unexpectedly, or generates output using unintended request parameters. ### Impact Assessment The likely effects are request corruption, denial of service for the current invocation, unexpected API behavior, and possible unintended API resource consumption. The issue does not expose a demonstrated path to local command execution or privilege escalation. The `Authorization` header transmits the configured API key to the documented MiniMax endpoint, but the identified injection does not ...[truncated 66 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Construct the request with a JSON-aware serializer instead of shell string interpolation. For example: ```bash PAYLOAD=$(jq -n \ --arg text "$TEXT" \ --arg voice_id "$VOICE_ID" \ '{ model: "speech-2.8-turbo", text: $text, stream: false, output_format: "hex", voice_setting: { voice_id: $voice_id, speed: 1 }, audio_setting: { sample_rate: 32000 } }') RESP=$(curl --fail-with-body --silent --show-error \ -X POST "https://api-uw.minimax.io/v1/t2a_v2" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${API_KEY}" \ --data-binary "$PAYLOAD") ``` Also validate text length before submission and handle non-success HTTP responses explicitly. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/kai_tts.sh:17
Finding
Option-Shaped Audio Paths Can Alter Whisper Command Parsing<![CDATA[ ## Vulnerability Details **File Location**: `scripts/kai_tts.sh`, line 17 **Vulnerability Type**: Command-line option injection **Risk Level**: Low ### Vulnerable Code ```bash whisper "$FILE" --model base --output_format txt --output_dir /tmp ``` ### Technical Analysis Shell quoting prevents whitespace splitting and shell metacharacter execution, but it does not prevent the called program from interpreting an argument beginning with `-` as an option. If the user-controlled `FILE` value is option-shaped, `whisper` may parse it as a command-line flag instead of an audio path. The exact effect depends on the options supported by the installed `whisper` implementation. This is argument or option injection rather than shell command injection. No direct execution of shell syntax is demonstrated by the code. ### Attack Path 1. An attacker supplies or causes the caller to use an audio path beginning with a hyphen. 2. The quoted value is passed intact to `whisper`. 3. `whisper` interprets the value as an option rather than as an input filename. 4. The attacker may alter supported command behavior or cause the transcription operation to fail, subject to the installed CLI's argument parser and available options. ### Impact Assessment The confirmed impact is disruption or unintended modification of the transcription command's behavior. Any broader effect depends on whether the installed `whisper` binary exposes security-sensitive options. The command runs with the privileges of the user invoking the skill. The reviewed code does not establish a direct route to shell execution or privilege escalation through this issue alone. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Resolve and validate the input as an existing regular audio file before invoking `whisper`. 2. Reject basenames beginning with `-`, or convert relative paths to validated absolute paths. 3. If the installed `whisper` CLI supports the conventional end-of-options delimiter, use it in the position required by that CLI, for example: ```bash whisper -- "$FILE" --model base --output_format txt --output_dir "$TMP_DIR" ``` 4. Confirm the exact argument syntax against the deployed `whisper` version, because some parsers require options to precede the `--` delimiter: ```bash whisper --model base --output_format txt --output_dir "$TMP_DIR" -- "$FILE" ``` 5. Apply an allowlist for supported audio extensions and reject special files, directories, and symbolic links where they are not required. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill advertises shell-based usage and required binaries, but it does not declare any explicit tool scope such as allowed-tools or permissions. That creates an authorization gap where an agent may invoke shell capabilities more broadly than intended, reducing least-privilege protections and making review of runtime behavior harder.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill description says it can transcribe audio files, but it does not warn that transcription may send user audio to an external API. This can expose sensitive spoken content, background conversations, or regulated data to a third party without informed user consent.

External Transmission

Medium
Category
Data Exfiltration
Content
if [ -z "$API_KEY" ]; then echo "Error: MINIMAX_API_KEY not set"; exit 1; fi
    VOICE_ID="moss_audio_a43c027d-10db-11f1-83e4-92355c742862"
    [ "$LANG" != "es" ] && VOICE_ID="moss_audio_2b525bea-10da-11f1-bd2a-3a1ec25b94c4"
    RESP=$(curl -s -X POST "https://api-uw.minimax.io/v1/t2a_v2" -H "Content-Type: application/json" -H "Authorization: Bearer ${API_KEY}" -d "{\"model\":\"speech-2.8-turbo\",\"text\":\"${TEXT}\",\"stream\":false,\"output_format\":\"hex\",\"voice_setting\":{\"voice_id\":\"${VOICE_ID}\",\"speed\":1},\"audio_setting\":{\"sample_rate\":32000}}")
    HEX=$(echo "$RESP" | grep -o '"audio":"[^"]*"' | cut -d'"' -f4)
    [ -n "$HEX" ] && echo "$HEX" | xxd -r -p > "${WORKSPACE}/Kai.mp3" && echo "Generated: ${WORKSPACE}/Kai.mp3" || echo "Error: $RESP"
elif [ "$ACTION" = "--transcribe" ]; then
Confidence
97% confidence
Finding
This curl request transmits the full text payload to an external service along with an API credential, which is expected for cloud TTS but still represents a real data egress boundary. In the context of an agent skill, the danger is increased because upstream prompts or user content may contain confidential information that is silently forwarded to a third party.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script sends arbitrary user-provided text to the external MiniMax API for speech generation without any explicit disclosure, confirmation, or data sensitivity checks. In an agent setting, this can cause unintended exfiltration of secrets, private prompts, or sensitive user content to a third-party service, especially when the caller may not realize TTS is cloud-backed.

Missing User Warnings

Low
Confidence
91% confidence
Finding
The setup instructions require an API key and imply outbound network access, but they provide no warning about credential handling or the fact that data will be sent to an external provider. This increases the chance of accidental credential exposure or uninformed use in environments where external network transfer is restricted or sensitive.

Missing User Warnings

Low
Confidence
87% confidence
Finding
The script writes generated audio to a persistent workspace file and copies transcription output into a predictable filename without warning the caller. This can leave sensitive spoken or transcribed content on disk longer than expected, creating privacy and data retention risks in shared or multi-user environments.

Static analysis

No suspicious patterns detected.