Back to skill

Security audit

飞书发语音(edge)

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims, but it can send user text as audio to Feishu through an external TTS service with limited scoping, confirmation, and retention disclosure.

Review before installing. Only use this skill for text that is acceptable to send to Edge TTS/Microsoft-associated TTS infrastructure and to Feishu chats. Avoid secrets, credentials, regulated data, or sensitive internal messages unless your organization approves that flow. Prefer a pinned dependency setup, install ffmpeg through a trusted package manager, and check or clean ~/.openclaw/media/outbound and /tmp after 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:27
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Locations: SKILL.md:27, README.md:8
Vulnerability Type: Supply-chain exposure through unpinned dependencies
Risk Level: Medium

Vulnerable Code Snippet:

SKILL.md:27

bash
pip install edge-tts

README.md:8

bash
pip install edge-tts

Technical Analysis

The documented installation command installs the latest version of edge-tts and its transitive dependencies without a version constraint, lock file, or integrity hash. Consequently, the code installed by users can change after the Skill has been reviewed.

Although no evidence establishes that the current package is malicious, this installation method creates supply-chain exposure. A compromised package release, compromised maintainer account, malicious transitive dependency, or unexpected incompatible release could introduce arbitrary code into the Skill's runtime environment.

Attack Path

  1. An attacker compromises the edge-tts distribution channel, a maintainer account, or one of its unresolved transitive dependencies.
  2. The attacker publishes a malicious version that still satisfies the unrestricted installation command.
  3. A user follows the project documentation and executes pip install edge-tts.
  4. Pip resolves and installs the attacker-controlled release.
  5. Malicious package code executes during installation or when voice_sender.py imports or invokes the dependency.

Impact Assessment

Successful exploitation could execute arbitrary Python code with the privileges of the user performing installation or running the Skill. This may permit access to user-readable files, OpenClaw configuration, environment variables, messaging credentials, and network resources available to that account. The issue does not independently provide root privileges unless installation or execution is performed with elevated privileges.

Remediation
View remediation

Remediation Suggestions

  1. Pin edge-tts to a specifically reviewed version rather than resolving the latest release.
  2. Maintain a lock file containing exact versions of all transitive dependencies.
  3. Require package hashes, for example through a hash-locked requirements file and pip install --require-hashes.
  4. Install packages only from an explicitly configured trusted index.
  5. Perform dependency vulnerability and provenance checks before updating the pinned version.
  6. Run the Skill in an isolated virtual environment under a non-privileged account.
  7. Update both SKILL.md and README.md so users consistently follow the hardened installation procedure.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/voice_sender.py:69
Finding

Unsafe Temporary Files and Persistent Retention of Generated Audio

Content
View full analysis

Vulnerability Details

File Locations: scripts/voice_sender.py:69-88, scripts/voice_sender.py:121-127
Vulnerability Type: Unsafe temporary-file creation and sensitive artifact retention
Risk Level: Medium

Vulnerable Code Snippets:

scripts/voice_sender.py:69-82

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)

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)

scripts/voice_sender.py:121-127

python
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)

Technical Analysis

Temporary MP3 and OPUS paths are constructed directly in the shared /tmp directory rather than being atomically created through Python's tempfile APIs. Only the first eight hexadecimal characters of a UUID are used, reducing the filename namespace to 32 bits. The MP3 file is opened in truncating write mode, which follows an existing symbolic link. FFmpeg is also invoked with -y, allowing an existing output path to be overwritten.

A local attacker who can win a filename collision or race may pre-create a matching path as a symbolic link. The script can then write generated audio through that link to another file writable by the victim account. Exploitation requires local access and successful prediction, collision, or observation of the generated name, so it is not a reliable remote attack.

Cleanup is incomplete. The MP3 is removed only on the normal path after FFmpeg returns, while exceptions can leave it behind. Th ...[truncated 1547 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace manually constructed /tmp paths with tempfile.TemporaryDirectory() or securely created NamedTemporaryFile objects.
  2. Keep all intermediate media inside a private temporary directory created with restrictive permissions.
  3. Do not truncate random identifiers when unique names are still required.
  4. Ensure file creation is atomic and does not follow pre-existing symbolic links.
  5. Apply restrictive file permissions, such as owner-only read and write access, independent of an unsafe process umask.
  6. Enclose the complete generation, conversion, copy, and send process in a try/finally block.
  7. Remove the MP3, temporary OPUS file, and outbound copy in the finally block after the send command no longer needs them.
  8. Preserve a file only when explicitly requested for diagnostics, and document the security implications of doing so.
  9. Avoid including sensitive temporary paths or unrestricted FFmpeg diagnostic output in logs unless required.
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 (12)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README instructs users to send text for text-to-speech and delivery to Feishu, but it does not disclose that the provided content will be transmitted over the network to external services such as Edge TTS and Feishu. This creates a privacy and data-handling risk because users may paste sensitive operational or personal content without understanding it leaves the local machine.

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 9)May include surrounding context.

bash
pip install edge-tts
sudo apt-get install ffmpeg

使用

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 · SKILL.md (reported line 28)May include surrounding context.

bash
pip install edge-tts
sudo apt-get install ffmpeg

使用

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill documentation exposes capabilities implying shell execution, environment access, and file writing, but it does not declare any explicit tool scope or permissions boundaries. This increases the risk of over-privileged execution because users and orchestration systems cannot easily constrain what the skill may do.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description omits a clear warning that input text may be transmitted to an external TTS provider and that the resulting audio will be sent to Feishu. This creates a data handling and privacy risk because users may provide sensitive content without understanding it leaves the local environment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad and generic, including common terms like 'tts' and '文字转语音', which may cause the skill to activate unexpectedly in unrelated contexts. Unintended invocation is risky here because the skill can generate audio and send content externally to Feishu.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Natural-language strings and available voices are limited to Chinese (zh-CN) and the script presents itself only in Chinese, with no opt-in or documented locale constraint. This can violate language/locale policy because the skill forces a specific language environment rather than letting the user choose or clearly documenting a justified regional restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill sends user-provided text to Edge TTS, which is an external network service, without an explicit privacy warning or consent step. If users paste sensitive operational, personal, or confidential content, that data may be transmitted off-host unexpectedly, which is especially relevant in chat-automation contexts.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

The stated purpose is a Feishu voice sender that converts text to speech and sends it to Feishu. While media conversion and sending are expected, implementing them by spawning external subprocesses expands the skill's capability surface beyond the manifest's stated high-level function and introduces command-execution behavior not described in the manifest.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/voice_sender.py (reported line 80)May include surrounding context.

python
"-ac", "1", "-ar", "16000",
        opus_file
    ]
    result = subprocess.run(cmd, capture_output=True)
    
    os.remove(mp3_file)  # 清理 MP3

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/voice_sender.py (reported line 133)May include surrounding context.

python
cmd.extend(["--media", target_file, "--message", "语音消息"])
        
        result = subprocess.run(cmd, capture_output=True, text=True)
        
        if result.returncode == 0:
            print("✅ 发送成功!")

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language instructions and examples are presented only in Chinese, which can constitute a language/locale policy issue when no user opt-in or alternative language is offered. There is no indication that the skill is intentionally limited to a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.