Back to skill

Security audit

feishu-minimax-t2a-voice

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Feishu voice-reply helper, but users should be aware it sends reply text to third-party TTS services and writes audio files to fixed local paths.

Install only if you are comfortable sending reply text to MiniMax or Edge TTS providers and storing generated audio in local media/temp paths. Avoid using it for secrets or sensitive conversations unless the TTS provider and local file handling meet your privacy requirements.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/send_voice.py:151
Finding

Predictable Shared Temporary File Enables Arbitrary File Overwrite

Content
View full analysis

Vulnerability Details

File Location: scripts/send_voice.py, lines 19–20 and 151–153
Vulnerability Type: Predictable temporary file and unsafe file creation
Risk Level: Medium

Vulnerable Code

python
AUDIO_OUT = os.path.join(tempfile.gettempdir(), "feishu-voice-out")
os.makedirs(AUDIO_OUT, exist_ok=True)
python
mp3_path = os.path.join(AUDIO_OUT, "minimax.mp3")
with open(mp3_path, "wb") as f:
    f.write(bytes.fromhex(audio_hex))

Technical Analysis

The script creates a predictable subdirectory inside the system temporary directory and writes synthesized audio to the fixed filename minimax.mp3. File creation uses ordinary write mode without exclusive creation, symbolic-link protection, ownership validation, or verification that the destination is a regular file.

On systems where the temporary directory is shared among users or untrusted processes, an attacker can pre-create the expected file as a symbolic link to another file writable by the account running the Skill. Opening the path with "wb" follows the symbolic link and truncates the linked destination before writing audio data.

Other fixed output names, including minimax.opus and edge.ogg, also permit concurrent invocations or local processes to interfere with generated output. This can cause cross-session data exposure, output corruption, or denial of service.

Attack Path

  1. A local attacker determines that the Skill uses the predictable temporary path /tmp/feishu-voice-out/minimax.mp3 on a typical POSIX system.
  2. The attacker creates the directory or waits for it to exist and places a symbolic link named minimax.mp3 pointing to a victim-writable target file.
  3. The victim invokes scripts/reply.py while MiniMax synthesis is enabled.
  4. MiniMax returns synthesized audio, and minimax_synth() opens the predictable path using "wb".
  5. The operating system follows the attacker-created symbolic link, ...[truncated 642 chars]
Remediation
View remediation

Remediation Suggestions

  • Create a unique, private directory for each invocation using tempfile.TemporaryDirectory() or tempfile.mkdtemp().
  • Ensure the temporary directory is accessible only to the executing user, such as mode 0700 on POSIX systems.
  • Generate unique filenames with tempfile.NamedTemporaryFile() or securely generated random names instead of fixed names.
  • When direct file creation is necessary, use exclusive creation and no-follow semantics where supported.
  • Verify that an existing destination is a regular file owned by the expected user before writing.
  • Keep all intermediate artifacts inside the private per-invocation directory.
  • Remove generated files and directories in a finally block after copying the required output.
  • Avoid sharing output paths across concurrent invocations; use unique final media filenames or atomic replacement where a stable destination is required.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (14)

Tainted flow: 'headers' from os.environ.get (line 136, 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 146)May include surrounding context.

python
}

    try:
        r = requests.post(
            "https://api.minimaxi.com/v1/t2a_v2",
            headers=headers, json=payload, timeout=10
        )

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description says it should be used whenever a user sends a voice message, which is an overly broad trigger and can cause the agent to activate or respond in contexts where voice conversion is not actually desired. This can lead to unexpected behavior, unnecessary processing, and accidental disclosure or transmission of transformed content through Feishu voice replies.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

Defaulting to a Chinese locale voice without explicit user opt-in can produce responses in an unexpected language or accent, creating a mismatch between user expectations and system output. While this is not a direct code-execution issue, it can cause privacy, accessibility, or trust problems if users receive synthesized audio in a language profile they did not choose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script's docstring, default reply text, and failure message are all written in Chinese, which imposes a language/locale choice on users without opt-in. Under the policy, forcing a specific language is a natural-language violation unless the locale restriction is explicitly justified or optional.

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

python
global FFMPEG_AVAILABLE
    if FFMPEG_AVAILABLE is None:
        try:
            r = subprocess.run(["ffmpeg", "-version"],
                               capture_output=True, timeout=5)
            FFMPEG_AVAILABLE = (r.returncode == 0)
        except Exception:

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This duplicate finding identifies the same network POST that transmits content externally. While not malicious, it creates a real confidentiality/privacy risk if used on sensitive text in environments where outbound data sharing is restricted.

Content

Scanner excerpt · scripts/send_voice.py (reported line 146)May include surrounding context.

python
}

    try:
        r = requests.post(
            "https://api.minimaxi.com/v1/t2a_v2",
            headers=headers, json=payload, timeout=10
        )

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This duplicate finding identifies the same network POST that transmits content externally. While not malicious, it creates a real confidentiality/privacy risk if used on sensitive text in environments where outbound data sharing is restricted.

Content

Scanner excerpt · scripts/send_voice.py (reported line 146)May include surrounding context.

python
}

    try:
        r = requests.post(
            "https://api.minimaxi.com/v1/t2a_v2",
            headers=headers, json=payload, timeout=10
        )

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script transmits arbitrary input text to external TTS providers during normal execution without an explicit consent or warning path. If the text contains secrets, personal data, or internal content, this creates unintended third-party data disclosure and privacy/compliance risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

Hardcoding the external MiniMax endpoint confirms that text content is sent to a specific third-party service. The skill context makes this moderately dangerous because it is a voice utility that may be embedded into larger workflows, increasing the chance of silent transmission of sensitive content.

Content

Scanner excerpt · scripts/send_voice.py (reported line 147)May include surrounding context.

python
try:
        r = requests.post(
            "https://api.minimaxi.com/v1/t2a_v2",
            headers=headers, json=payload, timeout=10
        )
    except requests.exceptions.Timeout:

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

python
if ffmpeg_available():
        opus_path = os.path.join(AUDIO_OUT, "minimax.opus")
        try:
            r2 = subprocess.run(
                ["ffmpeg", "-y", "-i", mp3_path,
                 "-c:a", "libopus", "-ac", "1", "-ar", "16000", opus_path],
                capture_output=True, timeout=10

Tainted flow: 'path' from os.environ.get (line 243, credential/environment) → shutil.copy (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/send_voice.py (reported line 251)May include surrounding context.

python
media_dir = r"e:\Profile\Mac\.openclaw\media\out"
        os.makedirs(media_dir, exist_ok=True)
        dest = os.path.join(media_dir, "send_voice.opus")
        shutil.copy(path, dest)
        print(f"[copy] {dest}")
    else:
        print(f"[FAIL:{reason}] ({elapsed:.1f}s)")

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code creates a directory and copies output audio into a hard-coded path on disk. While file output is part of the script's behavior, the user-facing description focuses on TTS callback usage and fallback behavior, but does not clearly warn that a local file will always be created/overwritten at a fixed location.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script sets the default Edge TTS voice to "zh-CN-XiaoxiaoNeural", which imposes a specific language/locale choice if the user does not override it. The file does not indicate that this locale is optional by default or justify why a China Chinese voice is required.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script writes synthesized audio to predictable files in the system temp directory and later copies output to a fixed local path, which may persist sensitive spoken content without clear lifecycle controls. On shared systems, predictable temp/output locations increase the chance of unintended disclosure or accidental reuse of prior content.

Content

No source excerpt is available for this finding.