Back to skill

Security audit

feishu-voice-sender - 飞书语音消息发送

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated Feishu voice-message purpose, but it can send content externally and leaves generated voice files on disk with weak scoping and disclosure.

Install only if you are comfortable with message text being processed by Edge TTS, sent to Feishu, and retained as generated audio files unless manually cleaned up. Prefer pinned dependencies, a virtual environment, narrower Feishu-specific triggers, and explicit confirmation before sending sensitive 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 (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:24
Finding
Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 24-28; duplicated in `README.md`, lines 5-10 **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: Medium ### Vulnerable Code ```bash ## 安装依赖 ```bash pip install edge-tts sudo apt-get install ffmpeg ``` ``` The equivalent installation command in `README.md` is: ```bash pip install edge-tts sudo apt-get install ffmpeg ``` ### Technical Analysis The documented installation process retrieves the latest available `edge-tts` release without a version constraint, lock file, or integrity hash. Consequently, the code installed by users can change after the Skill has been reviewed. This creates supply-chain exposure because a compromised upstream release, compromised package-publishing account, or malicious future release would be installed automatically. The package is subsequently imported and executed by `scripts/voice_sender.py`, so malicious package-level or import-time code would run without requiring another vulnerability in this project. The package name itself matches the expected dependency; no evidence of typosquatting, dependency confusion, or a currently malicious package was identified. The risk arises from the unpinned and unverifiable installation process. ### Attack Path 1. An attacker compromises the upstream package distribution account or causes a malicious release to be published under the expected package name. 2. A user follows the documented `pip install edge-tts` command. 3. Package installation selects the attacker-controlled latest release because no reviewed version is pinned. 4. The malicious package can execute during installation or when `voice_sender.py` imports `edge_tts`. 5. The payload obtains the permissions of the user or service account running the installation or Skill. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the Python installation process or the account running the Skill. This ...[truncated 280 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `edge-tts` to an explicitly reviewed version, for example through a version-controlled `requirements.txt`. 2. Generate and verify cryptographic hashes using a hash-locked dependency workflow, such as: ```bash pip install --require-hashes -r requirements.txt ``` 3. Use a lock-file generator such as `pip-tools`, Poetry, or an equivalent reproducible dependency-management system. 4. Review transitive dependencies and refresh pins through a controlled update process. 5. Install dependencies inside a dedicated virtual environment under an unprivileged account. 6. Document a tested FFmpeg version or supported version range and use trusted operating-system repositories. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/voice_sender.py:68
Finding
Generated Voice Messages Persist in Temporary and Outbound Storage<![CDATA[ ## Vulnerability Details **File Location**: `scripts/voice_sender.py`, lines 68-129 **Vulnerability Type**: T09: Insecure Skill Coding Practices **Risk Level**: Medium ### Vulnerable Code The generated MP3 and OPUS files are created through ordinary path-based file operations: ```python timestamp = uuid.uuid4().hex[:8] mp3_file = f"/tmp/feishu_voice_{timestamp}.mp3" with open(mp3_file, "wb") as f: f.write(audio_bytes) # 3. 转换为 OPUS opus_file = f"/tmp/feishu_voice_{timestamp}.opus" cmd = [ "ffmpeg", "-y", "-i", mp3_file, "-acodec", "libopus", "-ac", "1", "-ar", "16000", opus_file ] result = subprocess.run(cmd, capture_output=True) os.remove(mp3_file) # 清理 MP3 if result.returncode != 0: raise Exception(f"OPUS 转换失败: {result.stderr.decode()}") return opus_file ``` The OPUS file is then copied into persistent outbound storage: ```python opus_file = text_to_opus(text, voice) print(f"✅ 语音生成: {opus_file}") # 复制到允许的目录(加时间戳防止竞争) import shutil timestamp = uuid.uuid4().hex[:8] outbound_dir = os.path.expanduser("~/.openclaw/media/outbound") os.makedirs(outbound_dir, exist_ok=True) target_file = os.path.join(outbound_dir, f"feishu_voice_{timestamp}.opus") shutil.copy(opus_file, target_file) ``` No cleanup is performed for either the `/tmp/feishu_voice_*.opus` file or the copied `~/.openclaw/media/outbound/feishu_voice_*.opus` file after sending. Cleanup of the MP3 file is also not protected by a `finally` block, so an exception before `os.remove(mp3_file)` can leave the MP3 behind. ### Technical Analysis Voice messages may encode confidential alerts, operational information, or other sensitive user-supplied text. The implementation leaves at least two OPUS copies after a normal successful run: - One under the shared system temporary directory, `/tmp` - One under the ...[truncated 1819 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create temporary files with `tempfile.TemporaryDirectory`, `NamedTemporaryFile`, or `mkstemp` so file creation is atomic and permissions are restrictive. 2. Place all cleanup in a `finally` block so MP3 and OPUS files are removed on success, conversion failure, send failure, and unexpected exceptions. 3. Delete or securely expire the outbound copy immediately after `openclaw message send` no longer requires it. 4. If outbound retention is operationally necessary, document it, enforce a short retention period, and implement automatic age- or count-based cleanup. 5. Explicitly create files with owner-only permissions, such as mode `0o600`, and ensure the outbound directory is owner-only, such as mode `0o700`. 6. Avoid logging sensitive message content or persistent media paths where logs may have broader access. 7. Use a structure similar to: ```python with tempfile.TemporaryDirectory(prefix="feishu_voice_") as workdir: mp3_file = os.path.join(workdir, "voice.mp3") opus_file = os.path.join(workdir, "voice.opus") # Generate, convert, and send within this scope. # Temporary files are removed when the context exits. ``` ]]>
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (11)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
pip install edge-tts
sudo apt-get 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
pip install edge-tts
sudo apt-get install ffmpeg
```

## 使用
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
92% confidence
Finding
The skill advertises shell execution, environment access, and file-writing behavior through its installation and usage steps, but it does not declare any explicit tool scope or permissions. This creates a mismatch between what the skill can do and what users or a host framework may expect, increasing the risk of unintended command execution or filesystem side effects without clear consent boundaries.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The trigger phrases include generic terms such as “tts” and “文字转语音,” which are broad enough to match many normal user requests unrelated to Feishu delivery. Overbroad triggers can cause the skill to activate unexpectedly and send content to an external platform when the user only intended local text-to-speech generation.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The feature list emphasizes one-click sending to Feishu but does not prominently warn users that their input text will be converted and transmitted externally. Without an explicit user-facing disclosure, sensitive internal messages, alerts, or personal data could be unintentionally sent to a third-party service or chat destination.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The natural-language descriptions, help text, and available voices are all fixed to Chinese usage, and the code does not present this as an optional locale setting or ask for user preference. This can violate language/locale policy when a skill forces a specific language without opt-in.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill sends arbitrary input text to the external Edge TTS service during synthesis, but the user-facing behavior does not clearly warn that message contents leave the local environment. In a messaging assistant context, users may paste sensitive internal or personal content, creating a real confidentiality risk through unintended third-party disclosure.

Context-Inappropriate Capability

Medium
Confidence
78% confidence
Finding
The manifest describes a Feishu voice sender based on Edge TTS, which clearly justifies text-to-speech generation and message sending, but it does not mention spawning local command-line tools. This file relies on external executables for media conversion and message delivery, which is a broader capability than the stated purpose and introduces operational power not disclosed in the skill description.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
"-ac", "1", "-ar", "16000",
        opus_file
    ]
    result = subprocess.run(cmd, capture_output=True)
    
    os.remove(mp3_file)  # 清理 MP3
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
cmd.extend(["--media", target_file, "--message", "语音消息"])
        
        result = subprocess.run(cmd, capture_output=True, text=True)
        
        if result.returncode == 0:
            print("✅ 发送成功!")
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Context-Inappropriate Capability

Low
Confidence
82% confidence
Finding
The stated purpose is converting text to speech and sending it to Feishu, but the implementation also inspects runtime environment variables to determine the destination chat. While convenient for reply mode, environment-variable access is an additional capability not disclosed in the manifest description.

Static analysis

No suspicious patterns detected.