Back to skill

Security audit

Voice Message

Security checks for vulnerabilities and agentic risk

Overview

The skill is broadly aligned with voice-message sending, but it needs review because it handles chat credentials and private message text with weak scoping and disclosure.

Review before installing. Use it only for explicit voice-message tasks, avoid passing Feishu tenant tokens on the command line, prefer environment variables or a secret manager, verify the recipient and platform before sending, and do not convert sensitive text unless you accept that TTS and chat APIs may receive the content.

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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/send_feishu_voice.sh:3
Finding
Feishu Tenant Access Token Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/send_feishu_voice.sh:3-10` **Vulnerability Type**: Sensitive credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```bash # Usage: send_feishu_voice.sh <ogg_file> <receive_id> <tenant_access_token> [receive_id_type] # receive_id_type: open_id (default), chat_id, user_id, union_id, email set -e OGG_FILE="$1" RECEIVE_ID="$2" TOKEN="$3" ``` The corresponding invocation documented in `SKILL.md:49` is: ```bash scripts/send_feishu_voice.sh /tmp/voice.ogg <receive_id> <tenant_access_token> [receive_id_type] ``` ### Technical Analysis The Feishu tenant access token is supplied as the third command-line argument and copied into the `TOKEN` shell variable. Depending on the operating system and runtime environment, command-line arguments may be exposed through process inspection facilities, diagnostic tools, audit systems, shell command history, CI/CD logs, or orchestration telemetry. Although access to another process's arguments may be restricted by operating-system policy, placing credentials in `argv` unnecessarily expands their exposure. The script only needs the credential in memory when constructing the Feishu authorization header; accepting it through a protected environment variable, file descriptor, or secret manager would reduce exposure. The script subsequently uses the credential as a bearer token: ```bash -H "Authorization: Bearer $TOKEN" ``` Possession of this token permits calls to Feishu APIs within the permissions granted to the associated application. ### Attack Path 1. A user invokes the documented command and supplies a valid tenant access token as the third argument. 2. While the process is active, a local user or monitoring component with sufficient visibility inspects the process command line. Alternatively, the command is retained in shell history, CI logs, or execution telemetry. 3. The observer extracts the tenant access token. 4. Th ...[truncated 619 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove the tenant token from positional command-line arguments. - Read it from a protected environment variable, a secret manager, or an inherited file descriptor. For example: ```bash TOKEN="${FEISHU_TENANT_ACCESS_TOKEN:-}" if [ -z "$TOKEN" ]; then echo "FEISHU_TENANT_ACCESS_TOKEN is required" >&2 exit 1 fi ``` - Update `SKILL.md` so examples do not place secrets directly in command lines. - Prevent commands containing secrets from being written to shell history or CI/CD logs. - Ensure secret values are redacted from diagnostic output. - Grant the Feishu application only the API scopes needed to upload and send audio messages. - Rotate or revoke any token suspected of having been logged or exposed. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/send_feishu_voice.sh:42
Finding
Unescaped User-Controlled Values Used to Construct Feishu JSON Request<![CDATA[ ## Vulnerability Details **File Location**: `scripts/send_feishu_voice.sh:42-45` **Vulnerability Type**: Unsafe JSON construction and insufficient input validation **Risk Level**: Low ### Vulnerable Code ```bash SEND_RESP=$(curl -s -X POST "$API_BASE/im/v1/messages?receive_id_type=$ID_TYPE" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d "{\"receive_id\":\"$RECEIVE_ID\",\"msg_type\":\"audio\",\"content\":\"{\\\"file_key\\\":\\\"$FILE_KEY\\\"}\"}") ``` ### Technical Analysis The script creates a JSON request by directly interpolating `RECEIVE_ID` and `FILE_KEY` into a quoted string. It does not apply JSON escaping. A value containing a quotation mark, backslash, or control character can therefore produce malformed JSON or introduce additional JSON members. `RECEIVE_ID` is directly controlled by the script caller. `FILE_KEY` originates from the Feishu upload response and is less directly controllable, but it should still be encoded rather than assumed safe. The nested `content` field is itself serialized JSON embedded as a string, making manual escaping particularly error-prone. `ID_TYPE` is also inserted directly into the URL query string without URL encoding or enforcement of the documented allowlist. A value containing `&` or other reserved query characters could alter the request query. This does not cause shell command injection because the URL is quoted, but it can change the HTTP request semantics. ### Attack Path 1. An attacker who can influence the script invocation supplies a crafted `receive_id`, such as a value containing quotes and additional JSON syntax, or supplies an `ID_TYPE` containing reserved URL-query characters. 2. The shell interpolates the value directly into the JSON body or URL. 3. The script submits the altered request using the valid Feishu tenant bearer token. 4. Depending on Feishu's JSON parsing, duplicate-key handling, and request validation, the request may fail, target an un ...[truncated 745 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Construct JSON with a serializer such as Python's `json` module or `jq`, rather than manual string interpolation. - Correctly serialize the nested `content` object. For example: ```bash PAYLOAD=$(python3 - "$RECEIVE_ID" "$FILE_KEY" <<'PY' import json import sys receive_id, file_key = sys.argv[1:3] print(json.dumps({ "receive_id": receive_id, "msg_type": "audio", "content": json.dumps({"file_key": file_key}), })) PY ) ``` Then submit it using: ```bash -d "$PAYLOAD" ``` - Restrict `ID_TYPE` to the explicitly supported values: ```bash case "$ID_TYPE" in open_id|chat_id|user_id|union_id|email) ;; *) echo "Invalid receive_id_type" >&2 exit 1 ;; esac ``` - Use `curl --fail-with-body --show-error` and validate the Feishu response status so malformed or rejected requests fail clearly. ]]>

T08 · Insecure Dependencies

Note
Location
SKILL.md:18
Finding
Unpinned Third-Party Text-to-Speech Dependency<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:18` **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Low ### Vulnerable Code ```markdown - `edge-tts` — Microsoft Edge TTS (`pip install edge-tts`) ``` ### Technical Analysis The installation instruction resolves the latest available `edge-tts` package and its transitive dependencies without specifying a reviewed version or integrity hashes. This makes installation behavior dependent on the state of the package repository at the time the command runs. This is not evidence that the current `edge-tts` package is malicious. The risk is that a future compromised release, compromised maintainer account, malicious transitive dependency, or incompatible update could introduce unintended code. Python packages can execute code during installation or when imported and run, so dependency compromise can lead to local code execution under the installing user's privileges. ### Attack Path 1. An upstream package release or one of its dependencies is compromised, or an unsafe future release becomes the default version. 2. A user follows the documentation and runs `pip install edge-tts` without a version constraint or hash verification. 3. The package manager downloads and installs the unreviewed release. 4. Malicious installation or runtime code executes with the privileges of the user or automation account performing installation or invoking `edge-tts`. This path requires compromise or malicious modification of the upstream dependency supply chain; no such compromise was identified in the audited project. ### Impact Assessment If the dependency supply chain were compromised, code could execute with the privileges of the account installing or running the package. The potential scope includes access to that account's files, environment variables, network credentials, and available services. The project itself does not request elevated installation privileges, so administrator or ro ...[truncated 116 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Pin `edge-tts` to a reviewed version instead of installing the unconstrained latest release. - Maintain dependencies in a lock file or hashed requirements file, for example with `pip-tools`. - Require integrity hashes using `pip install --require-hashes -r requirements.txt`. - Pin and review relevant transitive dependencies where practical. - Install dependencies inside a dedicated virtual environment as a non-privileged user. - Periodically update pinned versions through a controlled review and vulnerability-scanning process. ]]>
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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The script's behavior is limited to local text-to-speech generation and audio conversion: it takes text, synthesizes speech to a temporary MP3 via edge-tts, converts it to OGG/Opus with ffmpeg, and writes the output file. While this supports part of the declared implementation detail (audio generation/conversion), it does not perform the core declared function of sending voice messages across channels. There is also no code implementing any Feishu/Lark-specific handling. Therefore, the description materially overstates the code's actual capabilities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents a full voice-message delivery skill with TTS and cross-platform sending capabilities. The supplied code chunk does not send anything, does not call edge-tts, and does not contain any messaging-platform integration. Instead, it analyzes an input OGG file with ffprobe/ffmpeg and produces duration plus a base64 waveform JSON payload, apparently as a supporting utility for Discord voice messages. This is a materially narrower and different behavior than the declared primary purpose, so it is a mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The declared description presents a broad cross-platform voice-message skill with TTS generation and audio conversion capabilities. The supplied code chunk only handles Feishu/Lark, and only for uploading and sending an already-created OGG/Opus audio file. While the Feishu-specific part of the description is directionally aligned, the broader claims about Telegram, Discord, Signal, WhatsApp, edge-tts, and ffmpeg-based conversion are not represented in this code. This is a material description-to-behavior mismatch because the primary implemented capability is narrower and different from the declared end-to-end TTS-and-send functionality.

External Script Fetching

High
Category
Supply Chain
Content
DURATION_MS=$(python3 -c "print(int(float('$DURATION_SEC') * 1000))")

# 2. Upload file to Feishu
UPLOAD_RESP=$(curl -s -X POST "$API_BASE/im/v1/files" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file_type=opus" \
  -F "file_name=voice.ogg" \
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill documents use of shell-executed scripts (`scripts/gen_voice.sh`, `scripts/send_feishu_voice.sh`, `python3 scripts/gen_waveform.py`) but declares no explicit tool scope or allowed-tools boundary. In an agent environment, undeclared shell capability increases the chance the skill can invoke command execution unexpectedly, making downstream abuse or accidental overreach more likely.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The invocation description is broad enough to match many ordinary user requests involving audio or voice delivery, which can cause an agent to select this skill in contexts where shell execution and external messaging actions were not intended. In a skill that can generate files and send messages across channels, overbroad routing increases the risk of unintended data disclosure or action on the wrong platform.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script sends arbitrary input text to `edge-tts`, which relies on an external service, but gives no disclosure, consent prompt, or indication that message contents leave the local environment. If users pass sensitive chat content, secrets, or personal data, this can cause unintended data exposure to a third party. In a cross-channel voice-messaging skill, that risk is more significant because the text being converted may often be private user communications.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
ogg_file = sys.argv[1]

    # Get duration
    result = subprocess.run(
        ["ffprobe", "-v", "error", "-show_entries", "format=duration",
         "-of", "csv=p=0", ogg_file],
        capture_output=True, text=True
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
duration_secs = float(result.stdout.strip())

    # Extract raw PCM (mono, 16-bit, 48kHz)
    result = subprocess.run(
        ["ffmpeg", "-i", ogg_file, "-f", "s16le", "-ac", "1",
         "-ar", "48000", "-"],
        capture_output=True
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

External Transmission

Medium
Category
Data Exfiltration
Content
echo "Uploaded: file_key=$FILE_KEY"

# 3. Send audio message
SEND_RESP=$(curl -s -X POST "$API_BASE/im/v1/messages?receive_id_type=$ID_TYPE" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"receive_id\":\"$RECEIVE_ID\",\"msg_type\":\"audio\",\"content\":\"{\\\"file_key\\\":\\\"$FILE_KEY\\\"}\"}")
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The natural-language comments and default parameter set the voice to `zh-CN-XiaoxiaoNeural`, which imposes a specific language/locale by default. There is no accompanying justification or user-facing language choice, so this can violate locale policy expectations.

Static analysis

No suspicious patterns detected.