Back to skill

Security audit

豆包全家桶(视频图片生成)

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches Doubao media generation, but some download and output-path behavior is too broad and could affect local files or internal URLs if misused.

Install only if you trust the workflows that will invoke it. Prefer setting OUTPUT_ROOT to a dedicated folder, avoid passing untrusted URLs or absolute output paths, keep webhook mode bound to localhost unless you understand the exposure, and treat delete-task commands as destructive account actions.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/common.py:350
Finding

Unrestricted URL Retrieval Enables SSRF and Local File Reads

Content
View full analysis
Path: """Download a file from URL to local path.""" output_path.parent.mkdir(parents=True, exist_ok=True) request = urllib.request.Request(url, method="GET") with urllib.request.urlopen(request) as response: output_path.write_bytes(response.read()) return output_path ``` The caller passes the command-line URL directly to this function: ```python log_params("Download video started", url=args.url, name=args.name) if args.output: output_path = Path(args.output) else: output_path = default_output_path( "videos", args.scene, suffix=".mp4", name=args.name ) download_file(args.url, output_path) ``` ### Technical Analysis The download function passes a caller-controlled URL directly to `urllib.request.urlopen` without validating: - The URI scheme - The destination hostname - The resolved IP address - Redirect targets - URL-embedded credentials - Whether the destination is a loopback, private, link-local, or reserved address - Whether the response originates from an expected Volcengine media host `urllib.request` supports handlers beyond ordinary HTTPS retrieval. Depending on the runtime configuration, a `file:` URI can read a local file. HTTP and HTTPS URLs can also target local services, private network hosts, or cloud metadata endpoints. The same helper is used to download generated videos. The broad URL support exceeds the minimum privilege required for that function, which only needs to retrieve media from known or validated remote sources. ### Attack Path 1. An attacker persuades the Agent or user to invoke `download_video.py` with a crafted `--url`. 2. The URL identifies a local file, loopbac ...[truncated 1164 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/download_video.py:33
Finding

Unrestricted Output Paths Permit Arbitrary File Overwrite

Content
View full analysis
Path: """Download a file from URL to local path.""" output_path.parent.mkdir(parents=True, exist_ok=True) request = urllib.request.Request(url, method="GET") with urllib.request.urlopen(request) as response: output_path.write_bytes(response.read()) return output_path ``` Image output follows the same unsafe pattern: ```python def save_image_payload(image_data: Any, output_path: Path) -> Path: output_path = Path(output_path).resolve() output_path.parent.mkdir(parents=True, exist_ok=True) b64_json = getattr(image_data, "b64_json", None) if b64_json: output_path.write_bytes(base64.b64decode(b64_json)) return output_path ``` ### Technical Analysis The `--output` arguments accept arbitrary absolute paths and relative paths containing traversal components. The resolved destination is not checked against `OUTPUT_ROOT` or another approved output directory. The write operations: - Create missing parent directories - Follow normal filesystem path resolution - Overwrite existing files - Do not reject symlink targets - Do not require confirmation before replacing a file As a result, generated or downloaded bytes c ...[truncated 1548 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/common.py:201
Finding

Unbounded Response Buffering Enables Resource Exhaustion

Content
View full analysis
Path: """Download a file from URL to local path.""" output_path.parent.mkdir(parents=True, exist_ok=True) request = urllib.request.Request(url, method="GET") with urllib.request.urlopen(request) as response: output_path.write_bytes(response.read()) return output_path ``` ### Technical Analysis Both download paths invoke `response.read()` without a byte limit. The full response is first buffered in process memory and is then written to disk. The code also does not set an explicit network timeout, validate `Content-Length`, enforce a maximum file size, or confirm that the response is an expected image or video media type. A malicious, compromised, or incorrectly configured endpoint can therefore return an extremely large payload or respond indefinitely slowly. Large responses can exhaust memory before the file write completes, while unrestricted output can consume available disk space. ### Attack Path 1. An attacker supplies or causes the service to return a URL controlled by the attacker. 2. The endpoint returns a very large response, misleading length metadata, or a slow continuous stream. 3. The script calls `response.read()` and attempts to buffer the complete response. 4. Process memory grows until the download finishes or the process is terminated. 5. If buffering succeeds, the payload is written without a disk-size limit. 6. The Agent process or host ma ...[truncated 458 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (25)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented primarily as a media-generation helper, yet it also documents running a local webhook server, exposing HTTP endpoints, persisting verification tokens, and managing task state. Those are materially different and higher-risk behaviors because they open a listening service, create persistent local state, and expand the attack surface beyond simple content generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented primarily as a media-generation helper, yet it also documents running a local webhook server, exposing HTTP endpoints, persisting verification tokens, and managing task state. Those are materially different and higher-risk behaviors because they open a listening service, create persistent local state, and expand the attack surface beyond simple content generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented primarily as a media-generation helper, yet it also documents running a local webhook server, exposing HTTP endpoints, persisting verification tokens, and managing task state. Those are materially different and higher-risk behaviors because they open a listening service, create persistent local state, and expand the attack surface beyond simple content generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented primarily as a media-generation helper, yet it also documents running a local webhook server, exposing HTTP endpoints, persisting verification tokens, and managing task state. Those are materially different and higher-risk behaviors because they open a listening service, create persistent local state, and expand the attack surface beyond simple content generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented primarily as a media-generation helper, yet it also documents running a local webhook server, exposing HTTP endpoints, persisting verification tokens, and managing task state. Those are materially different and higher-risk behaviors because they open a listening service, create persistent local state, and expand the attack surface beyond simple content generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented primarily as a media-generation helper, yet it also documents running a local webhook server, exposing HTTP endpoints, persisting verification tokens, and managing task state. Those are materially different and higher-risk behaviors because they open a listening service, create persistent local state, and expand the attack surface beyond simple content generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented primarily as a media-generation helper, yet it also documents running a local webhook server, exposing HTTP endpoints, persisting verification tokens, and managing task state. Those are materially different and higher-risk behaviors because they open a listening service, create persistent local state, and expand the attack surface beyond simple content generation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares capabilities that require environment access, file reads/writes, and network use, but it does not define any explicit tool scope such as allowed-tools or permissions. That leaves the agent with broader-than-necessary authority and makes accidental or unsafe invocation harder to constrain or audit, especially because the skill can read env secrets, download remote content, and write outputs locally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill writes generated outputs to local directories and additionally instructs copying videos into project paths, but it does not clearly warn users that running it will create or duplicate local files. In agent environments, silent file creation and duplication can overwrite storage expectations, leak sensitive generated content into project trees, or create persistence that users did not anticipate.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The webhook mode instructs users to start a local server and auto-detect callback addresses, but it does not clearly warn that this opens a listening network service and may reveal local IP/network metadata. In some environments, this can expose an unnecessary inbound surface or leak endpoint information to remote services.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

The document is written entirely in Chinese and is presented as a general prompt guide, but it does not state that the skill is region-specific or that users may choose another language for the guidance itself. Under the policy rule for language/locale constraints, this can be read as imposing a specific language without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file contains user-facing instructional content only in Chinese, with no opt-in or alternative language guidance. Under the stated policy, forcing a specific language without user choice is a natural-language policy concern unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/common.py (reported line 304)May include surrounding context.

python
timeout: int = 900,
) -> dict[str, Any]:
    """Poll a video task until succeeded, failed, expired, or cancelled."""
    deadline = __import__("time").monotonic() + timeout
    import time

    last_status: str | None = None

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script performs a destructive remote action by canceling/deleting video-generation tasks, but the skill metadata describes only generating images or videos and saving results locally. This capability gap is security-relevant because users or orchestrators may invoke the skill under incomplete assumptions, enabling unintended deletion of remote resources and potential disruption or loss of in-progress work.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script exposes an optional web-search tool via the --web-search flag and passes tools=[{"type": "web_search"}] to the model API, which expands the skill beyond its declared purpose of image/video generation and local saving. This increases data exposure and prompt-scope risk because user prompts and generation context may be sent to a network-enabled tool without that capability being disclosed in the skill description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This is substantively the same issue as SDI-1: the code implements optional network search unrelated to the stated image-to-image save workflow. Undeclared capability expansion is security-relevant because it can cause unexpected outbound requests, privacy issues, and broader prompt injection exposure from retrieved web content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script’s natural-language interface is written in Chinese, including the argument parser description and help text, and it also provides a Chinese default prompt. This effectively imposes a specific language/locale on users without any opt-in or stated justification, matching the language/locale policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes a skill that uses Doubao/Ark to generate images or videos and save the results locally. This file additionally implements a local HTTP service with GET endpoints to enumerate all video-generation tasks and retrieve stored callback metadata, which is a broader management/query interface not conveyed by the manifest description.

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 presents user-facing descriptions and status messages in Chinese only, including the argparse description/help strings and printed endpoint guidance. The file does not offer a language selection mechanism or document that the tool is intentionally limited to a Chinese-speaking or region-specific audience, which creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file includes natural-language strings shown to users in Chinese, such as the missing API key error, status prints, and runtime exceptions, without any indication of locale selection or opt-in. That can violate a language/locale policy when the skill imposes a specific language on all users by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script includes a Chinese default prompt and presents user-facing CLI text in Chinese, which effectively assumes a specific language/locale. There is no visible opt-in, alternative language path, or justification that this skill is intended only for a Chinese-language environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The default prompt and CLI descriptions are written in Chinese, and the script presents itself as a Chinese-only interface. This may violate language/locale policy expectations because users are not offered any language or locale choice or opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The user-facing argparse description and argument help are written only in Chinese, which imposes a specific language on users without any visible opt-in or alternative locale handling. This matches the natural-language policy category for forced language/locale usage.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

清单描述将该技能定位为使用豆包生成图片或视频并保存到本地,而本脚本除了调用图像生成外,还允许通过 --web-search 启用 web_search 工具。联网搜索并不是“文生图并保存本地”的明显必需实现细节,因此代码能力比描述更宽。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest says the skill generates images or videos and saves the result locally. This server also stores a webhook authentication token, a webhook log file, and a SQLite database of task status metadata, which are operational artifacts not reflected in the declared behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.