Back to skill

Security audit

Feishu Mood Music

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it advertises, but it can automatically generate and send audio to Feishu, reads local Feishu credentials, and contains a real local code-injection bug in its credential-loading path.

Review before installing. Use only in chats where users have opted in, disable no-mention auto-triggering or require confirmation before generating/sending, avoid running the npm install with elevated privileges, provide Feishu credentials through a controlled secret path, and fix the OPENCLAW_CONFIG parsing bug before use.

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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:25
Finding

Unpinned Global Installation of a Third-Party CLI Package

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/send_feishu_audio.sh:36
Finding

Python Code Injection Through OPENCLAW_CONFIG Path Interpolation

Content
View full analysis
/dev/null) APP_SECRET=$(python3 -c "import json; d=json.load(open('$CONFIG_FILE')); print(d['channels']['feishu']['accounts']['main']['appSecret'])" 2>/dev/null) fi fi ``` ### Technical Analysis `CONFIG_FILE` is derived from the externally controllable `OPENCLAW_CONFIG` environment variable and interpolated directly into Python source passed to `python3 -c`. Shell double-quote handling prevents ordinary shell command substitution originating from the expanded variable from being reevaluated. However, it does not make the resulting Python source safe. A path containing a single quote and syntactically valid Python tokens can terminate the argument to `open('...')`, inject Python statements or expressions, and comment out or otherwise neutralize the remaining generated source. The `[[ -f "$CONFIG_FILE" ]]` check reduces exploitability because the crafted path must identify an existing regular file. It does not remove the vulnerability: Unix filenames may contain quotes, semicolons, hash characters, and other characters meaningful to Python source. An attacker who can create an appropriately named file and control `OPENCLAW_CONFIG` can reach the vulnerable calls. The vulnerable branch is executed when either `FEISHU_APP_ID` or `FEISHU_APP_SECRET` is missing. ### Attack Path 1. An attacker obtains the ability to influence the environment used to launch the Skill, including `OPENCLAW_CONFIG`. 2. The attacker creates an existing regular fil ...[truncated 1356 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (27)

Tainted flow: 'headers' from os.environ.get (line 29, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate_mood_music.py (reported line 52)May include surrounding context.

python
start = time.time()

    try:
        resp = requests.post(url, json=payload, headers=headers, timeout=300)
        data = resp.json()
    except Exception as e:
        print(f"❌ Request failed: {e}", file=sys.stderr)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared purpose presents a benign mood-music assistant, but the documented behavior also includes external API use, local file creation, local playback, and credential-dependent message delivery. This mismatch can mislead operators and users about what the skill actually does, undermining informed consent and making risky actions more likely to be auto-approved.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose presents a benign mood-music assistant, but the documented behavior also includes external API use, local file creation, local playback, and credential-dependent message delivery. This mismatch can mislead operators and users about what the skill actually does, undermining informed consent and making risky actions more likely to be auto-approved.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The implicit trigger rules are broad enough that normal conversational phrases can activate the skill without a clear user request. In group chat, this can cause unwanted API calls, message sending, audio generation costs, and repeated unsolicited interactions affecting multiple users.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Fully implicit auto-triggering on extreme emotion phrases is especially risky because such phrases can appear casually, sarcastically, or in quoted text. The skill is configured to act without mention or confirmation, which makes unintended activation and unsolicited outbound messaging substantially more likely.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 256)May include surrounding context.

message="<共情文案>")

text

**方式 3:手动 curl 两步流程**(理解原理用)

```bash
# ⚠️ 关键坑:file_type 必须填 opus(不是 mp3),否则报 234001

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 256)May include surrounding context.

message="<共情文案>")

text

**方式 3:手动 curl 两步流程**(理解原理用)

```bash
# ⚠️ 关键坑:file_type 必须填 opus(不是 mp3),否则报 234001

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/send_feishu_audio.sh (reported line 61)May include surrounding context.

sh
[[ -f "$TMP_FILE" ]] || { echo "❌ File not found: $TMP_FILE" >&2; exit 1; }
fi

# --- 3. Get tenant access token ---
echo "🔑 Getting Feishu token..."
TOKEN=$(curl -sf -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

sh
# --- 3. Get tenant access token ---
echo "🔑 Getting Feishu token..."
TOKEN=$(curl -sf -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\"}" \
  | python3 -c "import sys,json; r=json.load(sys.stdin); print(r['tenant_access_token']) if r.get('code')==0 else sys.exit(r.get('msg','auth failed'))")

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/send_feishu_audio.sh (reported line 70)May include surrounding context.

sh
# --- 4. Upload file (file_type=opus is required for audio messages) ---
echo "📤 Uploading to Feishu..."
UPLOAD_RESP=$(curl -sf -X POST "https://open.feishu.cn/open-apis/im/v1/files" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file_type=opus" \
  -F "file_name=voice.opus" \

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/send_feishu_audio.sh (reported line 81)May include surrounding context.

sh
# --- 5. Send audio message (msg_type=audio) ---
echo "📨 Sending audio message..."
SEND_RESP=$(curl -sf -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"receive_id\": \"$CHAT_ID\", \"msg_type\": \"audio\", \"content\": \"{\\\"file_key\\\": \\\"$FILE_KEY\\\"}\"}")

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill requires shell execution, environment-variable access, and network access, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, this increases the chance of over-privileged execution, making credential exposure, unintended command execution, and external data transmission easier than necessary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill describes automatic local playback and automatic message sending, but does not present these as prominent consent-gated side effects. Hidden or weakly disclosed side effects are dangerous because users may think they are only asking for recommendations while the skill is actually executing commands and posting to chats.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill performs local environment probing and may automatically launch local audio players, which are system-affecting actions beyond the core promise of sending music to Feishu. Automatic local execution can surprise users, disrupt host systems, and widen the attack surface through shell-invoked utilities.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 271)May include surrounding context.

md
| python3 -c "import sys,json; print(json.load(sys.stdin)['data']['file_key'])")

# Step 2: 发送音频消息(msg_type=audio)
curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"receive_id\":\"$CHAT_ID\",\"msg_type\":\"audio\",\"content\":\"{\\\"file_key\\\":\\\"$FILE_KEY\\\"}\"}"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The optional mood-history log stores sensitive emotional data and preferences over time, but the file does not define clear consent, retention, or deletion controls. Emotional-state history is sensitive personal data, and retaining it without explicit notice can create privacy harm if accessed, shared, or repurposed.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly instructs retention of users' emotional history and preferences in plain-language local storage. Persistent accumulation of sensitive user-state data increases privacy and insider-risk exposure, especially when the data is readable and semantically rich rather than minimized or anonymized.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/generate_mood_music.py (reported line 28)May include surrounding context.

python
print("❌ MINIMAX_API_KEY not set", file=sys.stderr)
        sys.exit(1)

    url = "https://api.minimaxi.com/v1/music_generation"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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/generate_mood_music.py (reported line 52)May include surrounding context.

python
start = time.time()

    try:
        resp = requests.post(url, json=payload, headers=headers, timeout=300)
        data = resp.json()
    except Exception as e:
        print(f"❌ Request failed: {e}", file=sys.stderr)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest describes a skill that detects mood, generates matching music, and sends it to a Feishu group. While sending to Feishu is expected, this script additionally searches environment variables and a local OpenClaw config file for app credentials, which is a broader secret-reading capability not stated in the skill purpose.

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_feishu_audio.sh (reported line 63)May include surrounding context.

sh
# --- 3. Get tenant access token ---
echo "🔑 Getting Feishu token..."
TOKEN=$(curl -sf -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\"}" \
  | python3 -c "import sys,json; r=json.load(sys.stdin); print(r['tenant_access_token']) if r.get('code')==0 else sys.exit(r.get('msg','auth failed'))")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script sends user-provided text or audio content and the destination chat ID to external Feishu APIs, but there is no explicit consent prompt, privacy notice, or guardrail around what sensitive content may be transmitted. In a mood-detection skill, inputs may contain highly personal emotional or crisis-related statements, which makes silent onward transmission more privacy-sensitive than a generic bot integration.

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_feishu_audio.sh (reported line 81)May include surrounding context.

sh
# --- 5. Send audio message (msg_type=audio) ---
echo "📨 Sending audio message..."
SEND_RESP=$(curl -sf -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"receive_id\": \"$CHAT_ID\", \"msg_type\": \"audio\", \"content\": \"{\\\"file_key\\\": \\\"$FILE_KEY\\\"}\"}")

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The fallback to reading Feishu credentials from a local config file introduces credential-access behavior not obvious from the user-facing description. Even if intended for convenience, implicit credential discovery expands what the skill can access and increases the risk of accidental secret exposure or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script downloads remote content and writes it directly to a user-specified path without validating the destination or preventing overwrite of sensitive files. In an agent/automation context, if an attacker can influence --output, they may cause arbitrary file overwrite within the permissions of the running process, which can damage data or affect later execution.

Content

No source excerpt is available for this finding.