Back to skill

Security audit

videogenCN

Security checks for vulnerabilities and agentic risk

Overview

This video-generation skill mostly matches its purpose, but one provider setting can redirect API keys and submitted media to an arbitrary endpoint, and result downloads are not tightly validated.

Review this before installing. Use it only if you are comfortable sending prompts and selected images to the named video providers. Keep DASHSCOPE_API_BASE limited to cn, sg, or us, avoid running it in an environment you do not control, and avoid submitting sensitive images or secrets in prompts. A virtual environment and pinned dependencies would reduce install risk.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/providers/bailian.py:72
Finding

Arbitrary Bailian API Base Can Disclose the API Key and Submitted Media

Content
View full analysis
str: base = os.environ.get("DASHSCOPE_API_BASE", DEFAULT_API_BASE) return API_ENDPOINTS.get(base, base) @property def api_key(self) -> str: val = os.environ.get(self.env_var) if not val: raise ConfigError( f"{self.env_var} environment variable not set.\n" f"Set it with: export {self.env_var}='your-api-key'\n" f"Get a key at: https://bailian.console.aliyun.com/") return val def auth_headers(self) -> dict: return {"Authorization": f"Bearer {self.api_key}"} ``` The resulting endpoint and authorization header are used during submission: ```python def submit(self, body: dict, oss_used: bool = False) -> str: headers = { "Content-Type": "application/json", **self.auth_headers(), "X-DashScope-Async": "enable", } if oss_used: headers["X-DashScope-OssResourceResolve"] = "enable" data = safe_json( safe_request("POST", self.api_base + SUBMIT_PATH, headers=headers, json=body, label="Bailian submit"), label="Bailian submit") task_id = data.get("output", {}).get("task_id") if not task_id: raise APIError( f"Bailian submit failed: " f"{data.get('code')} {data.get('message')}") return task_id ``` ### Technical Analysis The documentation presents `DASHSCOPE_API_BASE` as a region selector with expected values such as `cn`, `sg`, and `us`. The implementation nevertheless accepts any unrecognized value as a complete API base URL: ```python return API_ENDPOINTS.get(base, base) ``` No scheme or hostname allowlist is enforced. The Bailian API key is subsequently ad ...[truncated 1738 chars]
Remediation
View remediation
str: region = os.environ.get("DASHSCOPE_API_BASE", "cn") try: return API_ENDPOINTS[region] except KeyError: raise ConfigError( "DASHSCOPE_API_BASE must be one of: " + ", ".join(sorted(API_ENDPOINTS)) ) ``` 2. Do not accept arbitrary URLs through the same variable used for region selection. 3. If custom enterprise endpoints are required, place them behind a separate, explicitly named configuration option. 4. For custom endpoints: - Require HTTPS. - Validate the normalized hostname against an administrator-controlled allowlist. - Reject embedded credentials, fragments, nonstandard schemes, and ambiguous URL forms. - Prevent redirects from forwarding authorization headers to other hosts. 5. Add tests confirming that attacker-controlled hosts, HTTP endpoints, malformed URLs, and hostname-confusion inputs are rejected. 6. Document that prompts and selected images are transmitted to the configured provider and should not contain unrelated secrets. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_video.py:49
Finding

Provider-Controlled Video URLs Are Downloaded Without Destination or Size Validation

Content
View full analysis
int: """Download a video from URL, write to output_path, return byte count.""" rsp = _safe_request("GET", url, timeout=300, label="Video download") if rsp.status_code != 200: raise APIError( f"video download failed (HTTP {rsp.status_code}): {rsp.text[:300]}") output_path.parent.mkdir(parents=True, exist_ok=True) output_path.write_bytes(rsp.content) return len(rsp.content) ``` ### Technical Analysis The download URL originates in a remote provider response. It is passed directly to `requests` without validating: - The URL scheme. - The destination hostname or resolved IP address. - Whether the destination is a loopback, link-local, private, or internal address. - Redirect destinations. - The response `Content-Type`. - The expected media format. - The response size. Because `rsp.content` buffers the complete response in memory before writing it to disk, a large response can consume substantial memory and disk space. A compromised provider, malicious endpoint configured through the Bailian override, or intercepted provider workflow could return a URL targeting an internal service or an excessively large resource. The downloaded file is also written without verifying that it is an MP4 or other expected video format. ### Attack Path 1. An attacker compromises a provider response path or redirects Bailian requests through the unrestricted API-base configuration. 2. The malicious response marks a generation task as successful and supplies a crafted `video_url`. 3. The URL points to one of the following: - A loopback or internal-network HTTP endpoint. - A cloud metadata or link-local endpoint. - A redirect chain leading to an i ...[truncated 1247 chars]
Remediation
View remediation
MAX_VIDEO_BYTES: raise APIError("download exceeded maximum allowed size") out.write(chunk) ``` 6. Enforce a reasonable maximum output size. 7. Validate `Content-Length` where present, while still enforcing a streamed byte limit. 8. Verify that `Content-Type` is an expected video media type. 9. Validate the downloaded file signature or container format before moving it to the final output path. 10. Download to a securely created temporary file and atomically rename it only after validation succeeds. 11. Add tests covering private IP destinations, redirects, oversized chunked responses, missing or incorrect content types, and partial downloads. ]]>

T08 · Insecure Dependencies

Note
Location
SKILL.md:232
Finding

Runtime Dependency Is Installed Without Version or Integrity Pinning

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The markdown explicitly instructs the agent to 'Write in Chinese' as a prompt-writing rule. This is a language policy constraint presented as mandatory behavior, and the file does not offer the user a language choice or explain that Chinese is optional.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
| `--ratio` | 16:9 / 9:16 / 1:1 / 3:4 / 4:3 / 21:9 | 16:9 |
| `-s/--size` | exact `W*H` for size-based models | from resolution+ratio |
| `-n/--negative` | negative prompt (Wan only) | — |
| `--no-prompt-extend` | disable prompt rewriting (Wan only) | extend on |
| `--no-prompt-optimizer` | disable built-in prompt optimizer (MiniMax only) | optimizer on |
| `--audio` | enable audio on PixVerse/Kling/Vidu/Jimeng | off |
| `--no-audio` | silent output on Wan audio models | audio on |

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module docstring states the tool generates video via multiple Chinese providers, and the CLI description later repeats that the script is specifically for Chinese video models. This imposes a locale/provider constraint in user-facing language without offering a user choice or documenting the limitation as an explicit opt-in policy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The provider automatically uploads local media files to Alibaba DashScope temporary OSS storage for certain model families when a local path is supplied, and only prints a post-upload message after the transfer. Because there is no explicit user confirmation or prominent pre-upload warning at the upload point, a user may unintentionally send sensitive local images to a remote third-party service, creating a privacy and data-handling risk even if the upload is expected by the feature design.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/providers/minimax.py (reported line 20)May include surrounding context.

python
class MiniMaxProvider(VideoProvider):
    name = "minimax"
    env_var = "MINIMAX_API_KEY"
    _default_api_base = "https://api.minimax.chat/v1"

    POLL_DEADLINE = 1200

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The submit path transmits the request body, including the user's prompt, to an external MiniMax API. While this network call is central to the provider's purpose, this file does not include a user-facing warning or disclosure for prompt data being sent off-system, unlike the explicit upload message used for local files.

Content

No source excerpt is available for this finding.