Back to skill

Security audit

Feishu Voice API Sender

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to do what it advertises, but it automatically uses Feishu credentials and can execute an unpinned third-party TTS package at runtime.

Review before installing. Use a minimally privileged Feishu app, avoid hardcoding secrets in the scripts, prefer explicit environment credentials over broad profile fallback, do not send sensitive or regulated content through TTS or Feishu unless authorized, and pin or preinstall reviewed TTS dependencies before using the TTS script.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
scripts/tts_and_send.py:165
Finding

Unpinned Runtime Execution of the edge-tts Package

Content
View full analysis

Vulnerability Details

File Location: scripts/tts_and_send.py, lines 165-178
Vulnerability Type: Unpinned third-party package resolution and execution
Risk Level: Medium

Vulnerable Code

python
def generate_tts(text: str, output_path: str, voice: str = "zh-CN-YunjianNeural", rate: str = "-10%") -> bool:
    """用 edge-tts 生成 TTS"""
    try:
        cmd = [
            "uvx", "edge-tts",
            "-t", text,
            "-v", voice,
            f"--rate={rate}",
            "--write-media", output_path
        ]
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
        if result.returncode != 0:
            print(f"TTS 生成失败: {result.stderr}")
            return False
        return True
    except Exception as e:
        print(f"TTS 生成异常: {e}")
        return False

Technical Analysis

The script invokes edge-tts through uvx without specifying a package version or verifying package integrity. Depending on the local cache and uvx configuration, this may cause a mutable package release to be resolved and installed from a third-party package registry at runtime.

This behavior creates a supply-chain trust boundary that is not fixed at audit or deployment time. A compromised package release, registry account, dependency, package index, or configured package source could cause unreviewed Python code to execute when the TTS function is invoked.

The use of a subprocess argument list rather than shell=True prevents direct shell injection through text, voice, or rate; therefore, the issue is not command injection. The risk arises from executing an unpinned package whose effective implementation can change independently of the audited Skill.

Attack Path

  1. An attacker compromises the edge-tts distribution, one of its dependencies, its publisher account, or a package source trusted by uvx.
  2. The attacker publishes a malicio ...[truncated 1357 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin edge-tts to a reviewed, exact version rather than invoking an unconstrained package name:

    python
    cmd = [
        "uvx", "--from", "edge-tts==REVIEWED_VERSION", "edge-tts",
        "-t", text,
        "-v", voice,
        f"--rate={rate}",
        "--write-media", output_path
    ]
    
  2. Prefer installing dependencies during a controlled build or deployment stage instead of resolving them during each Skill execution.

  3. Maintain a lock file containing exact transitive dependency versions and cryptographic hashes. Enforce hash verification during installation.

  4. Configure package installation to use an explicitly trusted index, and prevent user-controlled environment variables or configuration files from silently redirecting resolution to an untrusted package source.

  5. Execute the TTS component in a restricted environment with:

    • Minimal filesystem access.
    • No access to Feishu credentials unless required.
    • Restricted outbound network access.
    • A dedicated low-privilege operating-system identity or sandbox.
  6. Document that edge-tts is a network-backed TTS service and that supplied text may be transmitted to an external provider. Users should not submit sensitive text unless that processing is authorized.

  7. Periodically review and deliberately update the pinned version after checking its source, release provenance, dependency changes, and published security advisories.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (22)

Tainted flow: 'payload' from os.getenv (line 44, 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/send_voice.py (reported line 48)May include surrounding context.

python
headers = {"Content-Type": "application/json; charset=utf-8"}
    
    try:
        response = requests.post(url, json=payload, headers=headers, timeout=10)
        response.raise_for_status()
        result = response.json()

Tainted flow: 'payload' from os.getenv (line 44, 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/send_voice.py (reported line 136)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, headers=headers, json=payload, timeout=10)
        response.raise_for_status()
        result = response.json()

Tainted flow: 'payload' from os.getenv (line 46, 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/tts_and_send.py (reported line 51)May include surrounding context.

python
try:
        import requests
        response = requests.post(url, json=payload, headers=headers, timeout=10)
        response.raise_for_status()
        result = response.json()

Tainted flow: 'payload' from os.getenv (line 46, 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/tts_and_send.py (reported line 143)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, headers=headers, json=payload, timeout=10)
        response.raise_for_status()
        result = response.json()

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares capabilities that include environment access, file reads, shell execution, and outbound network use, but it does not define any tool scope or permission boundaries. This increases the chance that a caller or host agent will run the skill with broader privileges than users expect, enabling unintended access to local files, secrets, or network endpoints during normal operation or if the scripts are modified later.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation explains how to send audio and TTS messages through the Feishu official API, but it does not clearly warn that the provided text, generated audio, and recipient identifiers will be transmitted to a third-party service. This can cause unintentional disclosure of sensitive content or personal identifiers if users assume the processing is local or internal to OpenClaw.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The credential section includes a hardcoding option for APP_ID and APP_SECRET without a strong warning against embedding secrets in source files. Hardcoded credentials are easily leaked through version control, logs, backups, or workspace sharing, which could allow unauthorized use of the Feishu application and compromise messaging operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s user-facing natural-language content, including the module description and usage instructions, is entirely in Chinese. There is no indication that the skill is region-specific or that users may opt into another language, which can violate a language/locale policy requiring choice or justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The script automatically falls back to reading Feishu app credentials from ~/.openclaw/openclaw.json, allowing this skill to access broader existing account secrets beyond explicit user input. In a skill ecosystem, this increases blast radius because running the skill implicitly authorizes outbound actions using stored credentials the user may not realize are being consumed.

Content

No source excerpt is available for this finding.

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/send_voice.py (reported line 48)May include surrounding context.

python
headers = {"Content-Type": "application/json; charset=utf-8"}
    
    try:
        response = requests.post(url, json=payload, headers=headers, timeout=10)
        response.raise_for_status()
        result = response.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/tts_and_send.py (reported line 51)May include surrounding context.

python
headers = {"Content-Type": "application/json; charset=utf-8"}
    
    try:
        response = requests.post(url, json=payload, headers=headers, timeout=10)
        response.raise_for_status()
        result = response.json()

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The stated purpose is to send Feishu voice messages with a correct duration parameter, but the implementation achieves this by spawning the external ffprobe binary. Launching a subprocess is a materially broader capability than simple API interaction and local file upload, and it is not disclosed in the manifest description.

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/send_voice.py (reported line 69)May include surrounding context.

python
"-of", "default=noprint_wrappers=1:nokey=1",
            file_path
        ]
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=10)
        duration_sec = float(result.stdout.strip())
        return int(duration_sec * 1000)
    except Exception as e:

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/tts_and_send.py (reported line 72)May include surrounding context.

python
"-of", "default=noprint_wrappers=1:nokey=1",
            file_path
        ]
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=10)
        duration_sec = float(result.stdout.strip())
        return int(duration_sec * 1000)
    except Exception as e:

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/send_voice.py (reported line 136)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, headers=headers, json=payload, timeout=10)
        response.raise_for_status()
        result = response.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/tts_and_send.py (reported line 143)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, headers=headers, json=payload, timeout=10)
        response.raise_for_status()
        result = response.json()

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a skill for uploading OPUS audio and sending voice messages through the Feishu official API to fix a duration-parameter bug. However, the code and module docstring show the script also synthesizes speech from arbitrary text using edge-tts before conversion and sending, which is a broader behavior than just sending voice audio.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The stated purpose is Feishu voice-message sending through the official API with proper duration handling. Spawning uvx edge-tts to synthesize content introduces a separate speech-generation capability and external tool execution that is not declared in the manifest's scope.

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/tts_and_send.py (reported line 168)May include surrounding context.

python
f"--rate={rate}",
            "--write-media", output_path
        ]
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
        if result.returncode != 0:
            print(f"TTS 生成失败: {result.stderr}")
            return False

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/tts_and_send.py (reported line 186)May include surrounding context.

python
f"--rate={rate}",
            "--write-media", output_path
        ]
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
        if result.returncode != 0:
            print(f"TTS 生成失败: {result.stderr}")
            return False

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user-facing natural-language text entirely in Chinese, including the title, usage instructions, and runtime messages. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The manifest describes sending voice messages via the official API, but does not indicate the skill will harvest credentials from process environment variables or ~/.openclaw/openclaw.json. Credential discovery from local state is a distinct capability beyond pure message sending behavior.

Content

No source excerpt is available for this finding.