Back to skill

Security audit

豆包批量视频生成

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly purpose-aligned for Doubao video generation, but it asks users to reuse authenticated browser sessions and runs local ffmpeg processing without enough scoping or safety guidance.

Review this skill before installing if you plan to let it control a logged-in browser. Use a dedicated Doubao/browser profile, avoid shared machines, clear cookies when finished, and only run the combine script on video directories you control with normal filenames.

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/combine_videos.py:41
Finding

FFconcat Directive Injection Through Unescaped Video Filenames

Content
View full analysis

Vulnerability Details

File Location: scripts/combine_videos.py, lines 41–49
Vulnerability Type: Unsafe ffconcat manifest generation
Risk Level: Medium

Vulnerable Code

python
# Generate concat list file
list_file = output_path.parent / 'concat-list.txt'
with open(list_file, 'w', encoding='utf-8') as f:
    for vf in video_files:
        f.write(f"file '{Path(vf).as_posix()}'\n")

cmd = [
    'ffmpeg', '-y',
    '-f', 'concat', '-safe', '0',

Technical Analysis

The script obtains video paths from directory entries matching geo-video-*.mp4 and writes those paths directly into an ffconcat manifest. It does not reject or escape apostrophes, backslashes, carriage returns, newlines, or other characters significant to ffconcat syntax.

Although ffmpeg is invoked through an argument array rather than a shell, that protection does not prevent injection into the separately parsed concat manifest. A crafted filename can terminate or alter a file directive and introduce additional manifest content. The use of -safe 0 weakens ffmpeg's path validation and permits absolute paths and protocol-style resources that would otherwise be rejected by safe mode.

Exploitation requires the attacker to create or control the name of a matching file in the selected input directory.

Attack Path

  1. An attacker obtains the ability to place or rename files in the directory supplied through --input-dir.
  2. The attacker creates a filename beginning with geo-video-, ending with .mp4, and containing quote or line-break characters that alter ffconcat syntax.
  3. The glob operation accepts the crafted filename because it matches geo-video-*.mp4.
  4. The script writes the filename verbatim into concat-list.txt.
  5. ffmpeg parses the attacker-influenced manifest with -safe 0.
  6. Subject to the protocols and features enabled in the installed ffmpeg build, ffmpeg may open an unintended local path or ...[truncated 879 chars]
Remediation
View remediation

Remediation Suggestions

  1. Reject filenames containing control characters, carriage returns, line feeds, apostrophes, backslashes, or other ffconcat-significant characters.
  2. Resolve every candidate with Path.resolve() and verify that it remains beneath the resolved input directory.
  3. Avoid -safe 0; use -safe 1 and safe relative filenames wherever possible.
  4. Create a private temporary directory and populate it with fixed, application-generated filenames such as video-0001.mp4. Copy or safely link validated inputs into that directory, then generate the manifest exclusively from those fixed names.
  5. Restrict permitted ffmpeg protocols with an explicit protocol whitelist when supported, excluding network protocols unless the workflow requires them.
  6. Create manifest and temporary files with restrictive permissions and unpredictable names, then remove them after processing.
  7. Check subprocess return codes for ffprobe and all ffmpeg operations, and reject malformed or unexpected media before concatenation.
  8. Add regression tests using filenames containing quotes, newlines, backslashes, absolute-path syntax, and URL-like text to confirm they are rejected or safely handled.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The declared behavior promises browser-based Doubao automation, login handling, copywriting, and video generation, but the described executable portions mainly cover local ffmpeg/post-processing steps and reference external/manual actions for the rest. This mismatch is dangerous because users may grant trust, credentials, or elevated tool access based on capabilities the skill does not actually implement or constrain, reducing transparency and making misuse harder to detect.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs use of shell commands and file-generating operations but declares no explicit tool scope or permissions boundary. In an agent environment, this can lead to over-broad access at runtime, making it easier for the skill to write files or invoke arbitrary commands beyond what a user expects.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Broad trigger phrases like '帮我用豆包做视频' and '批量生成短视频' are common conversational language and can cause accidental invocation outside a clearly intended security context. Unintended activation is more risky here because the skill includes shell, file operations, browser login guidance, and persistent-session handling, so a mistaken trigger could start a sensitive workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly recommends maintaining a persistent browser profile and session state for login reuse, but does not prominently warn users about the security and privacy implications of storing authenticated sessions. In the context of a browser-automation skill tied to a real account, persistent session storage increases the risk of account misuse, session hijacking on shared systems, and unintended reuse by later tasks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document explicitly recommends keeping Doubao login state alive by preserving browser cookies and using a persistent user data directory, but it provides no warning about credential/session sensitivity, local profile theft, shared-machine exposure, or the risks of reusing a broadly privileged browser profile for automation. In the context of a browser automation skill, persistent authenticated sessions materially increase the blast radius of compromise because anyone or any process with access to that profile can act as the user and consume account quotas or access account data.

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

python
'ffprobe', '-v', 'quiet', '-print_format', 'json',
        '-show_format', '-show_streams', filepath
    ]
    result = subprocess.run(cmd, capture_output=True, text=True)
    import json
    info = json.loads(result.stdout)
    return float(info['format']['duration'])

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

python
'ffprobe', '-v', 'quiet', '-print_format', 'json',
        '-show_format', '-show_streams', filepath
    ]
    result = subprocess.run(cmd, capture_output=True, text=True)
    import json
    info = json.loads(result.stdout)
    return float(info['format']['duration'])

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

python
'ffprobe', '-v', 'quiet', '-print_format', 'json',
        '-show_format', '-show_streams', filepath
    ]
    result = subprocess.run(cmd, capture_output=True, text=True)
    import json
    info = json.loads(result.stdout)
    return float(info['format']['duration'])

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

python
'ffprobe', '-v', 'quiet', '-print_format', 'json',
        '-show_format', '-show_streams', filepath
    ]
    result = subprocess.run(cmd, capture_output=True, text=True)
    import json
    info = json.loads(result.stdout)
    return float(info['format']['duration'])

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

python
output_path
    ]
    print(f"生成背景音乐: {output_path}")
    subprocess.run(cmd, capture_output=True)

def concat_videos(video_files, output_path):
    """拼接多个视频文件"""

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

All natural-language instructions, labels, and guidance in the file are presented only in Chinese, which can amount to forcing a specific language without user opt-in. There is no indication that the skill is region-specific or that alternative language support is intentionally limited and documented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring is entirely in Chinese, and the script continues to present user-facing descriptions and status messages in Chinese throughout the file. For a general-purpose utility, this is a natural-language locale constraint without opt-in or justification, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.