Back to skill

Security audit

Feishu Voice

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it sends user text and audio through external services while executing an unverified local TTS dependency with inherited secrets.

Install only if you trust the local coze-tts skill path and can keep Feishu and Coze credentials scoped to minimal permissions. Avoid using it for sensitive text on shared machines until temporary-file handling is hardened and dependency integrity is pinned or otherwise verified.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/send_voice.sh:121
Finding

Predictable Shared Temporary Files Permit File Overwrites and Cross-Request Data Exposure

Content
View full analysis
/dev/null 2>&1 if [ ! -f /tmp/feishu-voice-temp.mp3 ]; then echo "❌ TTS 生成失败" exit 1 fi ``` ```bash ffmpeg -y -i /tmp/feishu-voice-temp.mp3 \ -filter:a "atempo=$SPEED" \ -c:a libmp3lame -q:a 2 \ /tmp/feishu-voice-speed.mp3 > /dev/null 2>&1 mv /tmp/feishu-voice-speed.mp3 /tmp/feishu-voice-temp.mp3 ``` ```bash ffmpeg -y -i /tmp/feishu-voice-temp.mp3 \ -c:a libopus \ -b:a 24k \ /tmp/feishu-voice.opus > /dev/null 2>&1 ``` ```bash rm -f /tmp/feishu-voice-temp.mp3 /tmp/feishu-voice-speed.mp3 /tmp/feishu-voice.opus 2>/dev/null || true ``` ### Technical Analysis The script stores generated and processed audio under fixed, globally predictable paths in `/tmp`. It does not create a private temporary directory, verify file ownership, reject symbolic links, or ensure that output files were newly created by the current process. The use of `ffmpeg -y` is particularly significant because it enables unconditional replacement of existing output files. If an attacker can pre-create one of the predictable paths as a symbolic link, FFmpeg may follow that link and overwrite another file writable by the user running the Skill. The fixed names also make concurrent executions unsafe. Two invocations can read, replace, upload, or delete the same files, potentially causing one user's generated audio to be sent in another user's message. Cleanup is performed only after successful completion. Because the script uses `set -e` without an `EXIT` trap, errors during TTS generation, conversion, probing, upload, or message delivery can leave speech files in `/tmp`. Their accessibility depends on the process umask and local system configuration. ### Attack Pa ...[truncated 1556 chars]
Remediation
View remediation
&2 exit 1 } chmod 700 "$TMP_DIR" trap 'rm -rf -- "$TMP_DIR"' EXIT INT TERM HUP TEMP_MP3="$TMP_DIR/voice-temp.mp3" SPEED_MP3="$TMP_DIR/voice-speed.mp3" OPUS_FILE="$TMP_DIR/voice.opus" ``` Use these variables for every TTS, FFmpeg, FFprobe, curl, and cleanup operation. Additional hardening should include: 1. Set a restrictive umask before creating files: ```bash umask 077 ``` 2. Do not place sensitive audio directly under shared, predictable `/tmp` paths. 3. Use the `EXIT` trap so cleanup also occurs after failures. 4. Verify that generated outputs are regular files owned by the current user before reading or uploading them: ```bash [ -f "$OPUS_FILE" ] && [ ! -L "$OPUS_FILE" ] || exit 1 ``` 5. Keep each invocation's files isolated to prevent collisions between concurrent executions. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/send_voice.sh:93
Finding

Unverified External TTS Script Is Discovered and Executed with Inherited Credentials

Content
View full analysis
/dev/null 2>&1 ``` ### Technical Analysis The Skill searches several filesystem locations for a shell script and executes the first matching file through Bash. Selection is based only on the existence of a regular file. The implementation does not verify: - The dependency's version. - A cryptographic checksum or signature. - File ownership or permissions. - Whether an untrusted user can modify the script or its parent directories. - Whether the resolved canonical path remains inside a trusted dependency directory. The `OPENCLAW_WORKSPACE` environment variable can also redirect discovery to an arbitrary workspace path. This is not shell command injection because the path is quoted, but it allows a party capable of controlling the environment or workspace contents to select which script is ...[truncated 2086 chars]
Remediation
View remediation
&2 exit 1 } ``` 4. Check that the script and parent directories are owned by an expected trusted account and are not writable by group or other users. 5. Pin the supported `coze-tts` version in project metadata and validate it at runtime or installation time. 6. Run the dependency with a minimal environment rather than inheriting all Feishu credentials: ```bash env -i \ PATH="$PATH" \ HOME="$HOME" \ COZE_API_KEY="$COZE_API_KEY" \ bash "$TTS_SCRIPT" "$TEXT" -o "$TEMP_MP3" -f mp3 -v "$VOICE_ID" ``` 7. Where feasible, isolate the TTS process using a dedicated low-privilege account, container, or sandbox with access only to its output directory and required network endpoint. 8. Treat changes to the dependency checksum or version as requiring a new security review. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (15)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/send_voice.sh (reported line 201)May include surrounding context.

sh
fi

# 8. 清理临时文件
rm -f /tmp/feishu-voice-temp.mp3 /tmp/feishu-voice-speed.mp3 /tmp/feishu-voice.opus 2>/dev/null || true

# 9. 完成
echo ""

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README explicitly states that generated audio will be uploaded to Feishu servers and sent as messages, but it does not warn users that message content is transmitted to third-party services, including both Coze for TTS and Feishu for storage/delivery. This creates a privacy and data-handling risk because users may unknowingly send sensitive text off-host and to external providers.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 58)May include surrounding context.

bash
# 安装依赖(如果需要)
sudo apt-get install ffmpeg ffprobe jq

# 设置环境变量
export FEISHU_APP_ID="your_app_id"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill documents and instructs execution of shell scripts and use of network-capable CLI tools, but it does not declare any explicit tool scope such as permissions or allowed-tools. In an agent environment, this can lead to overbroad execution authority, making it easier for the skill to invoke shell, access secrets in environment variables, and perform network actions without clear policy boundaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest declares sensitive credentials and an external messaging capability to Feishu, but provides no user-facing warning, consent boundary, or restriction context. In a skill that can generate and send voice messages, this increases the risk of unintended exfiltration, misuse of organization messaging channels, or surprise outbound actions using privileged app credentials.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file explicitly lists sensitive environment variables including FEISHU_APP_SECRET and COZE_API_KEY. Under the markdown-specific warning rule, documentation should warn users about privacy and system-integrity implications when a skill requires credentials, but no such warning is present here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script reads sensitive credentials from environment variables such as FEISHU_APP_SECRET_B and FEISHU_APP_SECRET to authenticate against Feishu. Although it logs progress for token retrieval, it does not disclose to the user that secret credentials will be accessed as part of execution.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/send_voice.sh (reported line 63)May include surrounding context.

sh
# 1. 获取飞书访问令牌
echo "🔑 获取飞书 token..."
TOKEN_RESPONSE=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d "{\"app_id\": \"$APP_ID\", \"app_secret\": \"$APP_SECRET\"}")

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest describes a Feishu voice-message sending skill with TTS generation, format conversion, speed adjustment, duration reading, upload, and send. While those functions are in scope, the implementation achieves them by invoking another skill's shell script (coze-tts) and local binaries like ffmpeg/ffprobe, which is a broader execution capability than the stated purpose itself and is not explicitly declared in the manifest text.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/send_voice.sh (reported line 184)May include surrounding context.

sh
# 7. 发送音频消息(duration 用毫秒)
echo ""
echo "📨 发送音频消息..."
SEND_RESPONSE=$(curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. The README presents all instructions and usage guidance in Chinese only, with no indication that the skill is region-specific or that users can choose another language, which may conflict with organizational language-choice expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill metadata and documentation are entirely written as a Chinese-only interface description, and the examples assume Chinese-language usage. For a general-purpose skill, this can constitute a language/locale policy issue because no opt-in or alternative language choice is provided.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This manifest description lists capabilities such as TTS generation, file upload, and message sending, but it does not define when the skill should or should not be invoked. For a manifest file, the lack of explicit trigger phrases, scope constraints, or exclusion conditions can lead to unintended activation in broadly related messaging or audio contexts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The description is written in Chinese and the keywords explicitly include "chinese," which may indicate a language-specific constraint. Because no opt-in, language choice, or justification is documented in this file, this can be interpreted as a locale/language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

User-facing output, usage text, and status messages are consistently presented in Chinese, and the script provides no mechanism for locale selection or user opt-in. This can violate language/locale policy when a skill forces a specific language by default.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.