Back to skill

Security audit

商品链接转抖音带货视频|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its AI-HIVE e-commerce video purpose, but it needs Review because its scripts can send API keys to unvalidated custom endpoints and can write downloaded task outputs without path containment.

Review before installing. Use only the official AI-HIVE endpoint, avoid setting custom base URLs unless you fully trust them, keep the API key scoped and revocable, and run downloads into a disposable output directory. Do not rely on this skill for unattended or broadly triggered paid generation until endpoint validation and download path containment are hardened.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:94
Finding

API credentials can be transmitted to an arbitrary endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:94-100, 130-143; duplicated in scripts/videogen.py:94-100, 130-143
Vulnerability Type: Unrestricted credential-bearing API endpoint
Risk Level: Medium

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}"

def _request(self, method, url, **kwargs):
    self.config.log(f"{method} {url}")
    try:
        resp = requests.request(
            method, url, headers=self.headers, timeout=DEFAULT_TIMEOUT, **kwargs
        )

Technical Analysis

The API base URL may be supplied through the --base-url command-line option, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. The value is used without validating its scheme or hostname.

Every request made through _request() includes the AI-HIVE bearer credential. Consequently, a malicious or accidentally modified endpoint can receive the credential. An http:// endpoint would additionally expose the credential to interception over plaintext transport.

The same implementation is present in both image and video generation clients, so either script can trigger the issue.

Attack Path

  1. An attacker influences the command line, process environment, or ~/.ai-hive/config.json.
  2. The attacker sets the base URL to an endpo ...[truncated 747 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require an HTTPS URL and reject plaintext HTTP endpoints.
  2. Allowlist ai-hive.iclip.cn as the credential-bearing production host.
  3. If custom endpoints are required for development, place them behind an explicit opt-in option and require interactive confirmation.
  4. Parse the URL with urllib.parse.urlparse() and reject embedded credentials, unexpected ports, fragments, malformed hosts, and non-HTTPS schemes.
  5. Do not attach the bearer credential when the destination host differs from the approved API host.
  6. Disable redirects or validate every redirect destination before forwarding credentials.
  7. Warn when configuration-file ownership or permissions are unsafe, rather than relying only on post-read permission tightening.
  8. Apply the same correction to both scripts/imagegen.py and scripts/videogen.py.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:399
Finding

Untrusted task metadata can escape the configured download directory

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:399-413; duplicated in scripts/videogen.py:399-413
Vulnerability Type: Path traversal and arbitrary file overwrite
Risk Level: Medium

Vulnerable Code

python
out_dir = Path(output_dir)
out_dir.mkdir(parents=True, exist_ok=True)
task_type = task.get("taskType", "task")
for i, item in enumerate(succeeded):
    result_url = item.get("resultUrl")
    if not result_url:
        continue
    ext = ".mp4" if "video" in task_type.lower() else ".png"
    filename = f"{task_type}_{task_id}_{i+1}{ext}"
    out_path = out_dir / filename
    download_file(result_url, out_path)

# Tail frame
for item in succeeded:
    last_frame = item.get("lastFrameUrl")
    if last_frame:
        out_path = out_dir / f"{task_type}_{task_id}_lastframe.png"
        download_file(last_frame, out_path)

The destination is subsequently opened in overwrite mode:

python
with open(str(out_path), "wb") as f:
    for chunk in resp.iter_content(chunk_size=8192):
        if chunk:
            f.write(chunk)

Technical Analysis

Remote taskType metadata and the task identifier are inserted directly into local filenames. Neither value is restricted to safe filename characters, normalized to a basename, nor followed by a containment check.

If either value contains path separators or traversal components, joining it with out_dir can produce a path outside the intended download directory. Because download_file() opens the resulting path with "wb", an existing writable file can be truncated and replaced with bytes downloaded from the remote result URL.

Exploitation requires malicious task metadata or a malicious/custom API endpoint capable of returning crafted task responses. This condition can be combined with the unrestricted base URL issue.

Attack Path

  1. The client communicates with a malicious or compromised API endpoi ...[truncated 959 chars]
Remediation
View remediation

Remediation Suggestions

  1. Generate local filenames independently of remote task metadata.
  2. Restrict identifiers to a conservative character allowlist such as ASCII letters, digits, underscores, and hyphens.
  3. Replace or reject all path separators, traversal components, control characters, and platform-specific reserved names.
  4. Resolve the output directory and candidate destination, then verify that the destination remains within the resolved output directory before opening it.
  5. Use exclusive creation mode where overwriting is unnecessary, or require explicit approval before replacing an existing file.
  6. Consider writing to a temporary file and atomically renaming it after a successful download.
  7. Validate result URL schemes and hosts before downloading.
  8. Apply identical hardening to both scripts/imagegen.py and scripts/videogen.py.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This finding describes a significant scope gap between the stated AI-HIVE ecommerce-video workflow and actual behavior, including undeclared account/balance access and generic chat/model operations. In a commercial-content skill, such hidden breadth is especially risky because it may process proprietary product data, credentials, or paid API actions while the user believes they are only using a narrow content-conversion workflow.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding describes a significant scope gap between the stated AI-HIVE ecommerce-video workflow and actual behavior, including undeclared account/balance access and generic chat/model operations. In a commercial-content skill, such hidden breadth is especially risky because it may process proprietary product data, credentials, or paid API actions while the user believes they are only using a narrow content-conversion workflow.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding describes a significant scope gap between the stated AI-HIVE ecommerce-video workflow and actual behavior, including undeclared account/balance access and generic chat/model operations. In a commercial-content skill, such hidden breadth is especially risky because it may process proprietary product data, credentials, or paid API actions while the user believes they are only using a narrow content-conversion workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file implements a broad AI-Hive client with capabilities far beyond the declared skill purpose, including generic chat, model enumeration, upload, task polling, and video/image generation. This mismatch expands the skill’s effective privilege and attack surface, making it easier to repurpose the skill for unintended operations and undermining least-privilege expectations for a narrowly scoped product-link-to-Douyin-video workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The built skill entrypoint only supports image generation, task lookup, and upload, while the metadata claims product-link-to-Douyin-video generation. This deceptive or mismatched packaging can mislead users and reviewers about what data the skill consumes and what actions it performs, increasing the chance of unsafe invocation paths and unauthorized reuse of a generic media-generation client under a trusted business label.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises runnable commands that use environment variables, local files, shell execution, and network access, but it does not declare any tool scope such as permissions or allowed-tools. That creates an avoidable trust gap: an agent may invoke code-capable operations more broadly than reviewers or users expect, increasing the chance of unintended file access, secret exposure, or outbound requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The usage section lists '电商内容' as a trigger without narrowing context, constraints, or exclusion examples. Because this phrase can describe many ordinary e-commerce content tasks, it may cause the skill to activate for requests outside the intended 'product URL to Douyin video' workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The prompt explicitly instructs the skill to produce a "production-ready Chinese workflow," which imposes a language choice in natural language. This is a locale/language policy concern because the file does not offer any user opt-in or alternative language selection.

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

python
def run(args: list[str]) -> None:
    print(" ".join(args))
    subprocess.run(args, check=True)


def main() -> None:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module docstring and all user-facing guidance in this file are written only in Chinese, and the CLI prompts/messages throughout the skill assume Chinese as the required interaction language. For a general-purpose skill, this imposes a specific language/locale without any user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest focuses on transforming product materials into Douyin marketing assets via AI-Hive generation APIs. Exposing a user-info capability that retrieves user information and wallet balance is an account-management feature, not an obvious requirement for the declared content-generation purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file is presented as a narrowly scoped product-link-to-Douyin-video skill, but it actually implements a general-purpose AI Hive client with multiple unrelated capabilities. This scope expansion increases attack surface and enables operators or downstream agents to invoke functions outside the reviewed business purpose, undermining least-privilege and trust assumptions about the skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains user-facing descriptions, prompts, errors, and CLI help text in Chinese throughout, beginning with the module docstring and continuing across the interface. Under the language/locale policy rule, this is a natural-language policy concern because the skill does not offer an opt-in language choice or explain that it is intentionally region-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill exposes unrestricted text chat through cmd_chat, which is unrelated to the declared product-to-video purpose and can be used as a generic LLM access path. In an agent ecosystem, this becomes a capability smuggling issue: a caller may select this skill for a benign-seeming purpose but obtain broader model access than intended by policy or review.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generic image-generation command allows arbitrary image synthesis beyond the declared product-video conversion use case. That broadens the skill into a multi-purpose media generator and may bypass governance, content restrictions, or user expectations tied to a narrower e-commerce video tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file's natural-language description and skill identifiers are presented only in Chinese, including the argparse description and skill name. This creates a locale-specific experience without any indication that users can choose another language or that the tool is intentionally restricted to a Chinese-only context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code provides user-info and models commands to inspect wallet/account information and enumerate available models. Those administrative/discovery capabilities are useful for a generic API client, but they are not necessary parts of a product-link-to-Douyin-video skill as described in the manifest.

Content

No source excerpt is available for this finding.