Back to skill

Security audit

Zhipu Asr

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Zhipu AI transcription skill, but users should know selected audio and optional context are sent to Zhipu and the API key may be briefly visible in local curl process arguments.

Install only if you are comfortable sending the selected audio file, any prompt text, and hotwords to Zhipu AI for transcription. Avoid using it for confidential recordings without authorization, and prefer a hardened version that passes the API key through a protected curl config or equivalent mechanism instead of process arguments.

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/speech_to_text.sh:145
Finding
Zhipu API Key Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/speech_to_text.sh`, lines 145–164 **Vulnerability Type**: Credential exposure through process arguments **Risk Level**: Medium **Vulnerable Code**: ```bash # Build curl command arguments CURL_ARGS=() CURL_ARGS+=(-H "Authorization: Bearer $ZHIPU_API_KEY") CURL_ARGS+=(-F "file=@$AUDIO_FILE") CURL_ARGS+=(-F "model=glm-asr-2512") if [ -n "$PROMPT" ]; then CURL_ARGS+=(-F "prompt=$PROMPT") fi if [ -n "$HOTWORDS" ]; then # Convert comma-separated to array format for curl IFS=',' read -ra HW_ARRAY <<< "$HOTWORDS" for word in "${HW_ARRAY[@]}"; do word=$(echo "$word" | xargs) CURL_ARGS+=(-F "hotwords[]=$word") done fi RESPONSE=$(curl -s -X POST "$API_ENDPOINT" "${CURL_ARGS[@]}") ``` ### Technical Analysis The script places `ZHIPU_API_KEY` directly in a `curl` header passed as a command-line argument. Shell arrays prevent word splitting and command injection here, but they do not conceal the resulting arguments from operating-system process inspection. While `curl` is running, the expanded `Authorization: Bearer ...` argument may be accessible through process-monitoring interfaces such as `/proc/<pid>/cmdline`, `ps`, or auditing and monitoring software. Exploitation requires local process-inspection access, generally from the same account or a sufficiently privileged account, depending on operating-system process-isolation settings. ### Attack Path 1. A victim runs `scripts/speech_to_text.sh` with a valid `ZHIPU_API_KEY`. 2. The script launches `curl` and embeds the bearer token in its argument vector. 3. A local attacker or monitoring process observes newly launched `curl` processes. 4. The attacker reads the process arguments while the request is active and extracts the Authorization header. 5. The attacker reuses the recovered token when sending requests to Zhipu AI. The observation window may be ...[truncated 577 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Avoid placing secrets directly in process arguments. 1. Create a temporary curl configuration file under a restrictive `umask`, such as `umask 077`. 2. Write the Authorization header to that file and ensure its permissions are `0600`. 3. invoke `curl` with only the configuration file path visible in its arguments. 4. Register an `EXIT`, `INT`, and `TERM` cleanup handler immediately after creating the file. 5. Securely revoke and rotate any API key suspected of prior exposure. 6. Avoid printing the key or temporary configuration contents in debug output. Example hardening pattern: ```bash umask 077 CURL_CONFIG=$(mktemp) cleanup() { [ -n "${TEMP_AUDIO:-}" ] && [ -f "$TEMP_AUDIO" ] && rm -f -- "$TEMP_AUDIO" [ -n "${CURL_CONFIG:-}" ] && [ -f "$CURL_CONFIG" ] && rm -f -- "$CURL_CONFIG" } trap cleanup EXIT INT TERM printf 'header = "Authorization: Bearer %s"\n' "$ZHIPU_API_KEY" > "$CURL_CONFIG" RESPONSE=$(curl --silent --show-error \ --config "$CURL_CONFIG" \ --request POST \ "$API_ENDPOINT" \ --form "file=@$AUDIO_FILE" \ --form "model=glm-asr-2512") ``` The implementation should also preserve the existing prompt and hotword form fields without placing the API key back into the argument vector. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Credential Access

High
Category
Privilege Escalation
Content
# Configuration
API_ENDPOINT="https://open.bigmodel.cn/api/paas/v4/audio/transcriptions"

# Get API key from environment
if [ -z "$ZHIPU_API_KEY" ]; then
    echo "Error: ZHIPU_API_KEY environment variable is not set" >&2
    echo "" >&2
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The README instructs users to transcribe audio with a third-party Zhipu AI service but does not clearly warn that the audio content will be uploaded off-host to an external provider. This can lead users to unknowingly send sensitive voice recordings, meetings, calls, or personal data to a remote service, creating privacy, confidentiality, and compliance risk.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Install dependencies (if needed)
sudo apt-get install jq ffmpeg

# Set your API key
export ZHIPU_API_KEY="your-key-here"
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill clearly instructs users to run shell commands and declares required binaries, but it does not declare an explicit tool scope such as permissions or allowed-tools. This creates an avoidable trust and governance gap: an agent may invoke shell-capable behavior without a narrowly documented execution boundary, increasing the risk of unintended command execution or misuse in environments that rely on manifest scoping for enforcement.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill sends user-provided audio to Zhipu AI's external ASR API, but the description and setup do not clearly warn users that their audio and optional prompt/hotwords leave the local environment. This omission can cause users to unknowingly disclose sensitive voice content, personal data, meeting recordings, or confidential context to a third party.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script uploads the supplied audio file to Zhipu's remote transcription API, but it does not present an explicit privacy warning or confirmation that audio content will leave the local system. In an agent skill context, users may assume local processing, so this can cause unintended disclosure of sensitive voice content, background speech, or embedded secrets.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The description and introduction explicitly position the skill for Chinese audio transcription and the examples are all Chinese-focused, but the file does not state this as an optional preference or explain a necessary region-specific limitation. This can be a natural-language locale policy issue when a skill appears to enforce a specific language context without user opt-in.

Natural-Language Policy Violations

Low
Confidence
77% confidence
Finding
The manifest keywords include "chinese", which signals a language-specific scope in the skill metadata, but the file does not document that this language constraint is optional or user-selectable. Under the policy rule for natural-language constraints, language-specific behavior should be opt-in or clearly justified as region-specific.

Static analysis

No suspicious patterns detected.