Back to skill

Security audit

Wan2.5 视频生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its video-generation purpose, but it can send your API key and selected media to an arbitrary configured API server.

Review this before installing if you will use a real AI Hive API key or private media. Keep the default AI Hive endpoint unless you fully trust the configured base URL, and avoid letting environment variables or config files set the API destination unexpectedly.

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

Error
Location
scripts/videogen.py:67
Finding

Unvalidated API Base URL Can Expose the API Key and Uploaded Media

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:67-76, scripts/videogen.py:105-115, and scripts/videogen.py:128-130
Vulnerability Type: User-controlled credential destination
Risk Level: High

Vulnerable Code

python
def _resolve_base_url(self, cli_url):
    if cli_url:
        return cli_url.rstrip("/")
    env_url = os.environ.get("AI_HIVE_BASE_URL")
    if env_url:
        return env_url.rstrip("/")
    file_config = self._read_config_file()
    if file_config.get("base_url"):
        return file_config["base_url"].rstrip("/")
    return DEFAULT_BASE_URL
python
def __init__(self, config):
    self.config = config
    self.base = config.base_url
    self.headers = {
        "Authorization": f"Bearer {config.api_key}",
        "Content-Type": "application/json",
    }

def _url(self, path):
    return f"{self.base}/openapi/v1/{path}"
python
resp = requests.request(
    method, url, headers=self.headers, timeout=DEFAULT_TIMEOUT, **kwargs
)

Technical Analysis

The API base URL can be supplied through the --base-url command-line option, the AI_HIVE_BASE_URL environment variable, or the local configuration file. The value is only normalized by removing trailing slashes. The application does not enforce HTTPS, validate the hostname, reject embedded credentials or unexpected ports, or restrict the destination to the documented AI Hive service.

AiHiveClient subsequently adds the user's AI Hive API key to the Authorization header of every API request. Therefore, any party that can influence the base URL can redirect authenticated requests to a server under its control.

This issue also affects media confidentiality. A malicious replacement server can respond to the upload-token request with an attacker-controlled object-storage URL. The upload code will then transfer the user-selected media to that URL using the method and heade ...[truncated 2047 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove runtime base URL overrides if alternate endpoints are not an operational requirement.
  2. If overrides are required, parse the URL with urllib.parse.urlsplit and enforce:
    • The https scheme;
    • An explicit allowlist of approved hostnames, such as ai-hive.iclip.cn;
    • Approved ports only;
    • No embedded username or password;
    • No fragments or ambiguous hostname representations.
  3. Resolve and validate the final URL before attaching the Authorization header. Credentials should only be sent to explicitly trusted origins.
  4. Maintain separate authenticated and unauthenticated HTTP clients so API credentials cannot accidentally be attached to object-storage or other third-party requests.
  5. Validate upload-token responses before transferring user media. Restrict upload schemes to HTTPS and, where possible, allowlist the approved object-storage domains.
  6. If custom enterprise endpoints must be supported, require explicit user confirmation before sending credentials or media to a non-default origin. Display the normalized destination hostname in that confirmation.
  7. Consider ignoring AI_HIVE_BASE_URL in untrusted automation contexts, or require a dedicated opt-in flag before environment-based endpoint overrides are accepted.
  8. Add automated tests confirming that HTTP URLs, embedded credentials, deceptive subdomains, unapproved hosts, and unexpected ports are rejected before any authenticated request is issued.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documents capabilities that involve network access, shell execution, file reads/writes, and environment/config handling, but it declares no explicit tool scope or permission boundaries. In an agent setting, that omission can lead to over-privileged execution, making it easier for the skill to access local files, stored credentials, or arbitrary network destinations beyond what users would reasonably expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The description uses extremely broad trigger language covering many unrelated AI video tools, marketplaces, ad platforms, and generic comparison/migration intents. That can cause the skill to activate in contexts where the user did not actually ask to run this workflow, increasing the chance of unnecessary API use, unintended uploads of local media, or disclosure of task/content metadata to external services.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The repeated claims of applicability across broad competitor, platform, and commerce scenarios reinforce an overbroad matching surface without clear boundaries. In practice, this increases the probability of accidental invocation and can route user prompts or local assets into an external video-generation pipeline when the conversation was only exploratory or comparative.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file contains user-facing docstrings, CLI descriptions, prompts, and status messages that are predominantly Chinese, with no indication that users may choose another language. Under the language/locale policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing natural language almost exclusively in Chinese, which can amount to forcing a specific language without user opt-in. The file does not state that the skill is intended only for a Chinese-speaking or region-specific audience, nor does it offer an alternative language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The document states the skill is for '中文或英文用户', which imposes a language scope in natural-language policy terms. There is no explicit opt-in or explanation that the skill can accommodate other languages or why the restriction is necessary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The example API key value uses Chinese-only instructional text ("请替换为你的APIKey"), which imposes a specific language in user-facing configuration content. There is no indication that the skill is region-specific or that users may choose another language, so this appears to violate the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.