Back to skill

Security audit

视频配音生成

Security checks for vulnerabilities and agentic risk

Overview

This voiceover skill is mostly coherent and disclosed, but it needs review because it sends sensitive voice/audio data to external services and has a concrete prompt-injection risk in its dub workflow.

Review before installing or running on sensitive media. Use this only when you are comfortable sending narration text and, in cloning/dub modes, real voice audio to the selected provider. Do not use voice cloning unless you have rights and speaker consent. Treat dub_brief.md transcript content as untrusted quoted media, especially for videos from other people, and constrain the agent stage to producing only dub_script.json.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Warning
Location
scripts/dub.py:441
Finding

Untrusted ASR transcript is embedded in an Agent instruction document

Content
View full analysis

Vulnerability Details

File Location: scripts/dub.py, lines 441–484
Vulnerability Type: Prompt injection through externally derived transcript content
Risk Level: Medium

Relevant code:

python
def stage_prepare(video, work, asr_window=6.0, ref_start=2.0, ref_dur=10.0):
    work.mkdir(parents=True, exist_ok=True)
    segs_dir = work / "dub_asr"
    segs_dir.mkdir(exist_ok=True)
    duration = get_video_duration(video)
    log(f"[dub:prepare] video {duration:.1f}s")

    audio_wav = work / "dub_source.wav"
    _ffmpeg_extract_wav(video, audio_wav)
    windows = _asr_windows(audio_wav, segs_dir, duration, asr_window)
    if not windows:
        raise SystemExit("[dub] no speech transcribed")
    log(f"[dub:prepare] {len(windows)} ASR windows")

    rs, rd = _ref_window(duration, ref_start, ref_dur)
    _cut_wav(audio_wav, work / "dub_reference.wav", rs, rd)

    (work / "dub_transcript.json").write_text(
        json.dumps({"video": str(video), "duration": duration, "windows": windows},
                   ensure_ascii=False, indent=2), encoding="utf-8")
    (work / "dub_brief.md").write_text(_brief_md(windows, duration), encoding="utf-8")
    print(json.dumps({"status": "dub_prepared", "windows": len(windows),
                      "brief": str(work / "dub_brief.md")}, ensure_ascii=False))


def _brief_md(windows, duration):
    lines = [
        "# 配音翻译任务(dub)",
        "",
        f"视频时长 {duration:.1f}s。下面是英文原声的分窗转写(时间戳偏粗,仅作锚点)。",
        "把它**忠实翻译并配音**,写入 `dub_script.json`——核心是**和原视频节奏一致**,不是做解说、"
        "也不是做精简版。",
        "",
        "要点:",
        "1. 逐句忠实翻译,原声说什么就配什么;**不要删内容、不要合并、不要自作主张去掉开场 hook**;"
        "原声重复,配音也跟着重复。",
        "2. 每句放在它在原声里被说出的时间,`start`/`end` 取那句话的起止——这样配音才跟着原声节奏走"
        "(该停顿处自然留白)。",
        f"3. 译文忠实精简,能在自己的 `start`→`end` 区间内用正常语速说完(目标约 {DUB_TARGET_CPS:g} 字/秒;"
        f"达到 {DUB_FAST_SPEECH_CPS:g} 字/秒 lint 会警告,渲染时可能被大幅加速或截断)。",

...[truncated 3473 chars]
Remediation
View remediation

Remediation Suggestions

  1. Keep Agent instructions and untrusted transcript data in separate files. Supply the transcript through a structured JSON input rather than embedding it in an instruction-bearing Markdown document.
  2. Add an explicit higher-priority instruction outside the transcript stating that all transcript fields are untrusted quoted content and that any commands found within them must be ignored.
  3. Constrain the Agent stage to one operation: reading approved transcript fields and producing a schema-validated dub_script.json.
  4. Apply an allowlist to the generated output schema and reject additional fields, tool directives, URLs, or unrelated content before any subsequent processing.
  5. If a human-readable Markdown brief is retained, render transcript values as clearly delimited quoted data and escape Markdown control syntax. Escaping is defense in depth and should not replace instruction/data separation.
  6. Run the translation stage with least-privilege tooling: restrict filesystem access to the work directory and disable unnecessary network, shell, credential, and memory-writing capabilities.
  7. Preserve the existing timing lint, but add a workflow-level gate that verifies the Agent produced only the requested translation artifact before proceeding to voice cloning.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (23)

Direct flow: pathlib.Path.read_bytes (file read) → pathlib.Path.write_bytes (file write)

High
Category
Data Flow
Confidence
80% confidence
Finding

Data flows directly from a source (env vars, files, network) to a sink (network output, exec, file write) without intermediate validation.

Content

Scanner excerpt · scripts/tts_audio.py (reported line 46)May include surrounding context.

python
if not samples:
        # A silent block has no RMS to normalize toward; copy it through with neutral
        # metadata rather than dividing by a zero sample count.
        output_wav.write_bytes(input_wav.read_bytes())
        return {
            "rms_dbfs_before": None,
            "rms_dbfs_after": None,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares significant capabilities—environment access, file I/O, shell, network—but does not scope or constrain them with an explicit permissions/allowed-tools declaration. That creates unnecessary ambient authority: an orchestrator or reviewer cannot easily enforce least privilege, and misuse or prompt-triggered execution could access secrets, arbitrary files, or external endpoints beyond what the task strictly needs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The trigger list contains broad natural-language terms such as '配音', 'TTS', and 'voiceover', which can match many ordinary conversations and cause the skill to be invoked unintentionally. In this skill, accidental invocation is more sensitive because invocation can lead to external transmission of narration text and, in some modes, audio or voice-cloning reference material.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This skill intentionally transmits user content to third-party or user-specified HTTP services, including narration text, reference audio for voice cloning, and in dub mode full source audio segments plus cloned-voice material. Even though the documentation discloses this, it remains a real security/privacy risk because sensitive text, biometric voice data, or copyrighted media may leave the local environment, and the self-hosted IndexTTS endpoint expands the trust boundary to arbitrary configured destinations.

Content

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

md
|------|------------|----------|
| 默认解说 TTS(`--tts-provider auto\|mimo-tts`) | MiMo chat 接口 `<MIMO_TTS_API_URL 或 MIMO_API_URL>/chat/completions`,`MIMO_TTS_API_KEY` 或 `MIMO_API_KEY`,模型 `mimo-v2.5-tts` | 每段实读文本、一句自然语言语气/语速指令(由段的 `emotion` 与时间窗算出)、内置音色名(默认 `冰糖`);`auto` 下 MiMo key 缺失且设置了 `FISH_API_KEY` 时改走 Fish Audio 行 |
| 解说声音克隆(`--voice-ref <audio>` / `VOICE_REF`) | 同上,模型 `mimo-v2.5-tts-voiceclone` | 上述内容,外加参考音频(转成 24 kHz 单声道 WAV,最长 30 秒)的 base64,每段请求都带 |
| Fish Audio(`--tts-provider fish-audio`) | `FISH_TTS_API_URL`(默认 `https://api.fish.audio/v1/tts`),`FISH_API_KEY` | 每段实读文本、数值语速、音色 ID `FISH_TTS_REFERENCE_ID`;不发送本地音频 |
| 自托管 IndexTTS(`--tts-provider index-tts`) | 用户自己部署、由 `INDEX_TTS_ENDPOINT` 指定的 HTTP(S) 服务 | `{"voice": INDEX_TTS_VOICE, "text": 实读文本}`;不发送本地音频 |
| 实验性 dub(见 §8) | MiMo ASR(`MIMO_API_URL`,`MIMO_API_KEY`,`mimo-v2.5-asr`)与 MiMo voiceclone(TTS 接口与凭据,`mimo-v2.5-tts-voiceclone`) | 源视频整条音轨按 6 秒分窗送 ASR;每句中文译文连同从源音频截取的约 10 秒原说话人声音(克隆参考)送 voiceclone |

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill file is written only in Chinese and does not offer any language choice or explain that the skill is intended exclusively for a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The exception message is hard-coded in Chinese, which imposes a specific language in user-visible output. The file does not offer a language/locale option or document that this module is intentionally region-specific, so this appears to violate the language-choice policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This raised error string is also hard-coded in Chinese and would be surfaced to users or operators during policy failures. Because the file provides no alternate locale handling or documented justification for a Chinese-only experience, it conflicts with the language/locale policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring defines the skill as "English→Chinese dubbing" and the workflow consistently requires Chinese translation/output. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless a justified region-specific constraint is clearly documented.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The skill is designed to send narration text and, in some modes, reference audio or source audio to third-party MiMo endpoints. This is a real data egress behavior: if users provide sensitive narration, copyrighted audio, or voice samples, that data leaves the local trust boundary and may be processed by an external service.

Content

Scanner excerpt · scripts/lib.py (reported line 16)May include surrounding context.

python
# ── 配置 ──────────────────────────────────────────────────────────────
DEFAULT_MIMO_API_URL = "https://api.xiaomimimo.com/v1"
DEFAULT_MIMO_TOKEN_PLAN_CLUSTER = "cn"
MIMO_TOKEN_PLAN_API_URLS = {
    "cn": "https://token-plan-cn.xiaomimimo.com/v1",

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The default Fish Audio endpoint also represents external transmission of user-provided narration content to a third-party service. In the context of a voiceover skill, this is expected functionality, but it remains security-relevant because sensitive text or voice-related metadata may be disclosed outside the environment.

Content

Scanner excerpt · scripts/lib.py (reported line 25)May include surrounding context.

python
}
DEFAULT_MIMO_ASR_MODEL = "mimo-v2.5-asr"  # speech-to-text
DEFAULT_MIMO_TTS_MODEL = "mimo-v2.5-tts"  # text-to-speech
DEFAULT_FISH_TTS_API_URL = "https://api.fish.audio/v1/tts"
DEFAULT_FISH_TTS_MODEL = "s2.1-pro-free"
DEFAULT_FISH_TTS_REFERENCE_ID = "5653cea4ac83480aaf2bf45406556185"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The configuration hard-codes a Chinese voice name and a Chinese narration style string, which indicates the skill is designed to produce Chinese-language output by default. In this code file there is no visible opt-in or alternative locale selection, so it appears to force a specific language without user choice.

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

python
str(part) if len(str(part)) <= 240 else str(part)[:237] + "..." for part in cmd
    )
    log(f"运行: {display}")
    return subprocess.run(cmd, capture_output=True, text=True, **kwargs)


def get_video_duration(video_path):

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The raised RuntimeError message at L42 is written in Chinese, and similar fixed-language user-facing messages appear throughout the function. This imposes a specific language on users without opt-in or justification, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The authentication, billing, network, content-type, and invalid-WAV error messages in this range are all hardcoded in Chinese. Because the file does not offer a locale choice or explain a China-specific scope, these strings constitute a forced language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code emits multiple natural-language strings in Chinese for configuration validation failures, which forces a specific language on users. The policy allows locale constraints only when documented and justified or when users are offered a choice, neither of which is present in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The provider raises many Chinese-only runtime messages for operational failures such as invalid WAV data, HTTP failures, and timeouts. Because these messages are likely surfaced to users or operators and no language choice is offered, this is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The exception text at L033 is hard-coded in Chinese, which imposes a specific language on users without opt-in. Under the policy, locale or language constraints should either offer user choice or be clearly documented and justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The returned messages at L150-L151 and L164-L165 are natural-language outputs shown to users, and they are fixed to Chinese. This creates a language-policy issue unless the skill explicitly documents that it is Chinese-only or offers a user-selectable locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains user-facing and instruction-bearing natural-language content in Chinese, including the TTS style instructions and many runtime messages, but it does not offer a language/locale choice. The policy explicitly allows locale constraints only when documented and justified or when users can opt in, neither of which is evident in this file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code base64-encodes local reference audio and sends it to MiMo's external voice-cloning API whenever --voice-ref/VOICE_REF is set, but this file does not enforce an explicit runtime confirmation or consent gate before exfiltrating that biometric voice sample. Because voice data is sensitive and can enable impersonation or unauthorized cloning, accidental or unauthorized upload creates meaningful privacy and consent risk in this skill's context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The helper logs messages with the fixed prefix "[video-recap]", while the manifest and this skill are for "video-voiceover". This inline labeling/documentation implies a different pipeline identity and can mislead operators about which skill is performing network calls or subprocess actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

Lines L95-L96 persist returned audio bytes to the user-specified output path and replace the target file atomically, which can overwrite existing data. Although the docstring mentions writing the WAV response, there is no user-facing disclosure, confirmation prompt, or visible warning in this file about the write/overwrite behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The raised RuntimeError contains a Chinese-only message literal (TTS 缓存 sidecar 损坏) in a general-purpose code path. This imposes a specific language on users or operators without any visible opt-in, locale selection, or documentation that the skill is intentionally Chinese-only.

Content

No source excerpt is available for this finding.