Back to skill

Security audit

feishu voice reply

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to do what it claims, but it asks for and uses sensitive messaging credentials while also carrying avoidable installation and input-handling risks.

Review this skill before installing. Use only non-sensitive text, confirm the Feishu recipient and app permissions, remove the unused contact-read permission if possible, avoid running npm install unless the dependency is removed or pinned, and store Volcengine and Feishu credentials in a protected secrets mechanism.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T08 · Insecure Dependencies

Warning
Location
package.json:30
Finding
Unpinned and Unnecessary npm Dependency<![CDATA[ ## Vulnerability Details **File Location**: `package.json:30-32` **Vulnerability Type**: Unpinned third-party dependency and unnecessary supply-chain exposure **Risk Level**: Medium ### Vulnerable Code ```json "dependencies": { "ffmpeg": "*" } ``` ### Technical Analysis The package accepts any version of the npm package named `ffmpeg`. No lockfile is present in the audited directory, so dependency resolution can change between installations. The shell implementation does not import or invoke this npm package. It directly executes the system `ffmpeg` binary, and the installation documentation also instructs users to install that binary through their operating system. The npm dependency therefore appears unnecessary for the declared functionality. Using the unrestricted `*` version range introduces avoidable supply-chain risk. A compromised or malicious future package release may be selected when a user runs `npm install`, potentially including lifecycle scripts that execute during installation. ### Attack Path 1. An attacker compromises the npm package or an authorized publisher account. 2. The attacker publishes a malicious version matching the `*` range. 3. A user or automated deployment runs `npm install`. 4. npm resolves the unrestricted dependency to the malicious version. 5. Package lifecycle code executes with the privileges of the installing user or build environment. ### Impact Assessment Successful exploitation could execute arbitrary code as the account performing package installation. Depending on the installation environment, this could expose environment variables, Feishu and Volcengine credentials, workspace files, or CI/CD secrets. It could also modify project artifacts or establish persistence available to that user. No evidence was found that the currently declared package version is malicious; the issue is the unnecessary and unrestricted dependency resolution policy. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the npm `ffmpeg` dependency because the implementation uses the system executable. 2. Add an explicit prerequisite check before processing: ```bash if ! command -v ffmpeg >/dev/null 2>&1; then echo "ffmpeg is required" >&2 exit 1 fi ``` 3. If a JavaScript dependency later becomes necessary, pin an exact reviewed version rather than using `*`. 4. Commit a lockfile and use reproducible installation commands such as `npm ci`. 5. Disable lifecycle scripts where they are not required and incorporate dependency integrity and vulnerability scanning into release workflows. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/feishu-voice-reply.sh:77
Finding
Unsafe JSON Construction from User-Controlled Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/feishu-voice-reply.sh:77-91` and `scripts/feishu-voice-reply.sh:165-173` **Vulnerability Type**: JSON injection and malformed request construction **Risk Level**: Medium ### Vulnerable Code ```bash RESPONSE=$(curl -sL -X POST 'https://openspeech.bytedance.com/api/v3/tts/unidirectional' \ -H "x-api-key: $VOLC_API_KEY" \ -H "X-Api-Resource-Id: $VOLC_RESOURCE_ID" \ -H 'Content-Type: application/json' \ -d "{ \"req_params\": { \"text\": \"$TEXT\", \"speaker\": \"$SPEAKER\", \"additions\": \"{\\\"disable_markdown_filter\\\":true,\\\"enable_language_detector\\\":true}\", \"audio_params\": { \"format\": \"mp3\", \"sample_rate\": 24000 } } }") ``` ```bash SEND_RESPONSE=$(curl -sL -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 "{ \"receive_id\": \"$USER_ID\", \"msg_type\": \"audio\", \"content\": \"{\\\"file_key\\\":\\\"$FILE_KEY\\\"}\" }") ``` ### Technical Analysis `TEXT`, `SPEAKER`, and `USER_ID` originate from command-line arguments or environment variables and are inserted directly into JSON string literals. They are not escaped with a JSON-aware serializer. A value containing quotation marks, backslashes, control characters, or crafted JSON syntax can terminate the intended string, create additional object properties, or make the request invalid. Shell metacharacters embedded in these variables are not re-evaluated as shell syntax after parameter expansion, so this is not directly a shell-command injection flaw. It is nevertheless a JSON injection and request-integrity issue. The first request may be manipulated at the TTS request layer. The second request is especially sensitive because it determines the Feishu recipient and message payload. ### Attack Path 1. An ...[truncated 1097 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Construct every JSON body with a JSON-aware tool rather than string interpolation. For example: ```bash TTS_PAYLOAD=$(jq -n \ --arg text "$TEXT" \ --arg speaker "$SPEAKER" \ '{ req_params: { text: $text, speaker: $speaker, additions: "{\"disable_markdown_filter\":true,\"enable_language_detector\":true}", audio_params: { format: "mp3", sample_rate: 24000 } } }') RESPONSE=$(curl --fail-with-body -sS -X POST \ 'https://openspeech.bytedance.com/api/v3/tts/unidirectional' \ -H "x-api-key: $VOLC_API_KEY" \ -H "X-Api-Resource-Id: $VOLC_RESOURCE_ID" \ -H 'Content-Type: application/json' \ --data-binary "$TTS_PAYLOAD") ``` Apply the same approach to the Feishu token and message payloads. In addition: 1. Validate `SPEAKER` against an allowlist of supported identifiers. 2. Validate `USER_ID` against the expected Feishu Open ID format. 3. Apply reasonable length limits to text and identifiers. 4. Use `curl --fail-with-body -sS` and explicitly handle transport and HTTP errors. 5. Add tests covering quotes, backslashes, newlines, Unicode, and attempted JSON property injection. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/feishu-voice-reply.sh:55
Finding
Predictable Temporary Audio Files in Shared Directory<![CDATA[ ## Vulnerability Details **File Location**: `scripts/feishu-voice-reply.sh:55-62` **Vulnerability Type**: Insecure temporary-file creation and local symlink race **Risk Level**: Medium ### Vulnerable Code ```bash TMP_MP3="/tmp/voice-tts-$.mp3" TMP_OPUS="/tmp/voice-tts-$.opus" cleanup() { rm -f "$TMP_MP3" "$TMP_OPUS" 2>/dev/null } trap cleanup EXIT ``` The paths are subsequently used as output destinations: ```bash echo "$RESPONSE" | jq -r '.data' | base64 -d > "$TMP_MP3" ffmpeg -i "$TMP_MP3" -c:a libopus -b:a 32k "$TMP_OPUS" -y 2>/dev/null ``` ### Technical Analysis The temporary filenames are derived from the process ID and placed directly in the shared `/tmp` directory. Process IDs are predictable, and the script does not securely create the files before use with `mktemp`. A local attacker can attempt to create symbolic links at the predicted paths before the script opens them. Shell redirection follows symbolic links, and `ffmpeg -y` allows overwriting its output destination. Consequently, a link may redirect generated data into another file writable by the victim account. The script also does not set a restrictive `umask`. Depending on the user’s existing configuration, temporary voice content may be readable by other local users while the script is running. ### Attack Path 1. A local attacker observes process activity or predicts a likely upcoming process ID. 2. The attacker creates `/tmp/voice-tts-<PID>.mp3` or `/tmp/voice-tts-<PID>.opus` as a symbolic link to a file writable by the victim. 3. The victim starts the skill under the predicted process ID. 4. Shell redirection or `ffmpeg -y` follows the attacker-created symbolic link. 5. The target file is truncated or overwritten with generated audio data. 6. Alternatively, another local user reads temporary speech content when filesystem permissions permit it. ### Impact Assessment Exploitation requires local access and favorable timing. It can overwrite or corrupt files writable ...[truncated 313 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Create a private temporary directory atomically and store all transient files inside it: ```bash umask 077 TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/feishu-voice.XXXXXX") TMP_MP3="$TMP_DIR/voice.mp3" TMP_OPUS="$TMP_DIR/voice.opus" cleanup() { rm -rf -- "$TMP_DIR" } trap cleanup EXIT HUP INT TERM ``` Additional hardening should include: 1. Abort if `mktemp` fails. 2. Keep `umask 077` active before creating any files containing generated speech. 3. Quote every path and use `--` for commands that support end-of-options markers. 4. Avoid operating directly on predictable names in a shared directory. 5. Consider validating that the temporary directory is owned by the current user and is not a symbolic link before use. ]]>

T05 · Unauthorized Access and Privilege Escalation

Note
Location
SKILL.md:58
Finding
Unnecessary Feishu Contact-Read Permission Violates Least Privilege<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:58-61` **Vulnerability Type**: Excess application permission **Risk Level**: Low ### Vulnerable Configuration ```text im:resource im:message contact:user.base:readonly ``` ### Technical Analysis The documentation instructs users to grant the Feishu application permission to read basic user information. The audited implementation only: 1. Requests a tenant access token. 2. Uploads an audio resource. 3. Sends an audio message to a caller-supplied Open ID. No request to a contact or user-information API appears in the implementation. The `contact:user.base:readonly` scope therefore exceeds the minimum permissions required by the declared and implemented workflow. The documented credential storage references do not themselves read `~/.openclaw/.env`; they are setup instructions and error messages. Secrets are consumed from named environment variables. The security concern is the unnecessary API scope granted to credentials rather than direct filesystem access to the credential file. ### Attack Path 1. A user follows the skill documentation and grants all listed Feishu permissions. 2. The application receives the unnecessary contact-read scope. 3. The Feishu application secret or a resulting tenant token is compromised through an independent incident. 4. The attacker uses the overprivileged application identity to query user information that the voice-message workflow does not require. ### Impact Assessment The unnecessary permission broadens the data accessible through compromised Feishu application credentials. The exact information available depends on Feishu’s enforcement, tenant configuration, application approval status, and the semantics of the granted scope. The issue does not itself steal credentials or bypass Feishu authorization. It increases the blast radius of a separate credential compromise and violates the principle of least privilege. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `contact:user.base:readonly` from the documented permission list and from existing application grants where it is not required. 2. Retain only the minimum Feishu scopes necessary to upload audio resources and send messages. 3. Document the precise endpoint-to-permission mapping so users can verify why each scope is needed. 4. Periodically review granted scopes in the Feishu administration console. 5. Rotate the Feishu application secret after reducing permissions if it may previously have been exposed. 6. If user lookup functionality is added later, implement it separately and explicitly justify the additional scope before requesting it. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (28)

Credential Access

High
Category
Privilege Escalation
Content
### 1. 配置环境变量

```bash
# 编辑 ~/.openclaw/.env 文件
nano ~/.openclaw/.env

# 添加以下内容(替换为你的实际配置)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 1. 配置环境变量

```bash
# 编辑 ~/.openclaw/.env 文件
nano ~/.openclaw/.env

# 添加以下内容(替换为你的实际配置)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 1. 配置环境变量

```bash
# 编辑 ~/.openclaw/.env 文件
nano ~/.openclaw/.env

# 添加以下内容(替换为你的实际配置)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 1. 配置环境变量

```bash
# 编辑 ~/.openclaw/.env 文件
nano ~/.openclaw/.env

# 添加以下内容(替换为你的实际配置)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 1. 配置环境变量

```bash
# 编辑 ~/.openclaw/.env 文件
nano ~/.openclaw/.env

# 添加以下内容(替换为你的实际配置)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 1. 配置环境变量

```bash
# 编辑 ~/.openclaw/.env 文件
nano ~/.openclaw/.env

# 添加以下内容(替换为你的实际配置)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 1. 配置环境变量

```bash
# 编辑 ~/.openclaw/.env 文件
nano ~/.openclaw/.env

# 添加以下内容(替换为你的实际配置)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 1. 配置环境变量

```bash
# 编辑 ~/.openclaw/.env 文件
nano ~/.openclaw/.env

# 添加以下内容(替换为你的实际配置)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| 错误信息 | 原因 | 解决方案 |
|---------|------|----------|
| `resource ID is mismatched` | 音色不在资源包中 | 更换可用音色 |
| `99991661` | 缺少 access token | 检查飞书应用配置 |
| `ffmpeg not found` | 未安装 ffmpeg | `sudo apt install ffmpeg` |
| `VOLC_API_KEY not set` | 未配置环境变量 | 设置环境变量 |
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| 错误信息 | 原因 | 解决方案 |
|---------|------|----------|
| `resource ID is mismatched` | 音色不在资源包中 | 更换可用音色 |
| `99991661` | 缺少 access token | 检查飞书应用配置 |
| `ffmpeg not found` | 未安装 ffmpeg | `sudo apt install ffmpeg` |
| `VOLC_API_KEY not set` | 未配置环境变量 | 设置环境变量 |
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
echo "✅ Opus 转换成功 ($(ls -lh "$TMP_OPUS" | awk '{print $5}'))"

# 步骤 3:获取飞书 Tenant Access Token
echo "⏳ 步骤 3/5: 获取飞书 Access Token..."
TOKEN_RESPONSE=$(curl -sL -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
  -H 'Content-Type: application/json' \
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
echo "✅ Opus 转换成功 ($(ls -lh "$TMP_OPUS" | awk '{print $5}'))"

# 步骤 3:获取飞书 Tenant Access Token
echo "⏳ 步骤 3/5: 获取飞书 Access Token..."
TOKEN_RESPONSE=$(curl -sL -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
  -H 'Content-Type: application/json' \
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
echo "✅ Opus 转换成功 ($(ls -lh "$TMP_OPUS" | awk '{print $5}'))"

# 步骤 3:获取飞书 Tenant Access Token
echo "⏳ 步骤 3/5: 获取飞书 Access Token..."
TOKEN_RESPONSE=$(curl -sL -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
  -H 'Content-Type: application/json' \
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
echo "✅ Opus 转换成功 ($(ls -lh "$TMP_OPUS" | awk '{print $5}'))"

# 步骤 3:获取飞书 Tenant Access Token
echo "⏳ 步骤 3/5: 获取飞书 Access Token..."
TOKEN_RESPONSE=$(curl -sL -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
  -H 'Content-Type: application/json' \
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
|---------|------|----------|
| `resource ID is mismatched` | 音色不在资源包中 | 更换可用音色 |
| `99991661` | 缺少 access token | 检查飞书应用配置 |
| `ffmpeg not found` | 未安装 ffmpeg | `sudo apt install ffmpeg` |
| `VOLC_API_KEY not set` | 未配置环境变量 | 设置环境变量 |

## 📖 使用示例
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# 安装 ffmpeg(用于音频格式转换)
# Ubuntu/Debian
sudo apt install ffmpeg

# macOS
brew install ffmpeg
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# 安装 ffmpeg(用于音频格式转换)
# Ubuntu/Debian
sudo apt install ffmpeg

# macOS
brew install ffmpeg
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill documentation describes sending user-provided text to Volcengine TTS and then delivering the resulting audio through Feishu, but it does not clearly warn users that their input leaves the local environment and is transmitted to third-party services. This creates a privacy and data-handling risk because users may provide sensitive content without informed consent.

External Transmission

Medium
Category
Data Exfiltration
Content
# 步骤 1:生成 TTS 音频
echo "⏳ 步骤 1/5: 生成火山引擎 TTS 音频..."
RESPONSE=$(curl -sL -X POST 'https://openspeech.bytedance.com/api/v3/tts/unidirectional' \
  -H "x-api-key: $VOLC_API_KEY" \
  -H "X-Api-Resource-Id: $VOLC_RESOURCE_ID" \
  -H 'Content-Type: application/json' \
Confidence
90% confidence
Finding
This request sends raw user text to an external TTS provider, which is a genuine data exfiltration surface if the input may contain secrets, personal data, or internal content. In an automation/agent setting, external transmission is more dangerous because upstream callers may not realize their data is being forwarded off-platform.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script transmits user-supplied text to Volcengine TTS and then uploads the generated audio to Feishu, but it provides no explicit consent, privacy notice, or data-classification guardrail before sending potentially sensitive content to third-party services. In an agent skill context, this increases the risk of unintentional disclosure of confidential prompts, personal data, or internal business information.

External Transmission

Medium
Category
Data Exfiltration
Content
# 步骤 3:获取飞书 Tenant Access Token
echo "⏳ 步骤 3/5: 获取飞书 Access Token..."
TOKEN_RESPONSE=$(curl -sL -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
  -H 'Content-Type: application/json' \
  -d "{
    \"app_id\": \"$FEISHU_APP_ID\",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
exit 1
fi

SEND_RESPONSE=$(curl -sL -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 "{
Confidence
88% confidence
Finding
This request sends a message to an external Feishu recipient using a caller-provided or environment-derived user ID, which can cause unintended disclosure of generated content to the wrong party if inputs are mistaken or manipulated. In a skill context, this is more sensitive because automated workflows may trigger outbound messaging without an explicit human review step.

Natural-Language Policy Violations

Low
Confidence
77% confidence
Finding
The entire skill documentation is presented only in Chinese, including usage instructions and examples, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The skill name, trigger phrases, and usage examples are all Chinese-specific, which effectively constrains invocation to a single language. The file does not indicate that this is an optional locale setting or a justified region-specific limitation.

Natural-Language Policy Violations

Low
Confidence
79% confidence
Finding
This JSON contains user-facing natural-language descriptions and a documentation URL explicitly pinned to the Chinese locale (`lang=zh`), and all labels/instructions are written only in Chinese. Under the policy, forcing a specific language or locale without user opt-in can be a violation unless the locale constraint is clearly documented and justified; this file does not provide such justification.

Static analysis

No suspicious patterns detected.