Back to skill

Security audit

商品植入微短剧|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended for AI-HIVE media production, but its scripts handle persistent API credentials and allow credential-bearing requests to a configurable endpoint without enough safeguards.

Install only if you are comfortable using AI-HIVE for external media generation and local API-key storage. Keep the default AI-HIVE endpoint, avoid setting --base-url or AI_HIVE_BASE_URL unless you fully trust the endpoint, use a scoped/revocable API key, do not upload unlicensed or sensitive media, and review any generated command before running it because generation may incur cost.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:91
Finding

Bearer credentials can be transmitted to an arbitrary API endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:91-100, 130-143; mirrored in scripts/videogen.py:91-100, 130-143
Vulnerability Type: Unrestricted credential-bearing endpoint configuration
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 argument, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. The value is accepted without validating its scheme or hostname.

The HTTP client subsequently attaches the AI-HIVE bearer credential to every request made through that base URL. Consequently, a configured endpoint does not need to belong to AI-HIVE to receive the credential. The code also permits an unencrypted http:// endpoint, which could expose credentials and request content to a network observer.

This behavior exists independently in both image and video generation scripts.

Attack Path

  1. An attacker influences a command, environment variable, wrapper script, or configuration file used to launch ...[truncated 1222 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require the https scheme for every credential-bearing API endpoint.
  2. Allowlist the expected hostname, such as ai-hive.iclip.cn, in normal operation.
  3. Reject URLs containing embedded credentials, unexpected ports, fragments, or non-HTTPS schemes.
  4. If custom endpoints are required for development, place them behind an explicit option such as --allow-unsafe-custom-endpoint.
  5. Display the normalized destination and require confirmation before sending credentials to a nonstandard host.
  6. Separate credentials by endpoint so that a production AI-HIVE key is never automatically reused with a custom server.
  7. Apply the same validation to command-line, environment, and configuration-file values.
  8. Add automated tests covering HTTP URLs, lookalike domains, user-information components, redirects, and malformed hosts.
  9. Consider disabling automatic redirects for authenticated requests or stripping the authorization header whenever a redirect changes the origin.

T08 · Insecure Dependencies

Note
Location
scripts/imagegen.py:9
Finding

Third-party runtime dependencies are installed without version or integrity constraints

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:9-15; equivalent dependency handling is present in scripts/videogen.py:9-15; installation guidance is documented in SKILL.md:67
Vulnerability Type: Unpinned and non-reproducible dependency installation
Risk Level: Low

Vulnerable Code

python
try:
    import requests
except ImportError:
    print("Missing dependency: requests. Run pip3 install requests", file=sys.stderr)
    sys.exit(1)

The displayed snippet is an English rendering of the user-facing message; the executable installation command in the source is pip3 install requests.

Technical Analysis

The project depends on the third-party requests package but provides no lockfile, version constraint, package hash, or verified installation manifest. The installation command resolves whichever package release the configured package index currently serves.

The project also relies on locally installed FFmpeg tools without documenting a reviewed version or trusted distribution source. This makes installations non-reproducible and leaves dependency trust entirely to the user's current package-index and system-package configuration.

This is a supply-chain hardening weakness rather than evidence that the current requests or FFmpeg projects are malicious.

Attack Path

  1. A user runs the documented unconstrained installation command in an environment where requests is absent.
  2. The package installer contacts its configured package index or mirror.
  3. The installer resolves a package version without consulting a project-controlled lockfile or expected hash.
  4. If the index, mirror, resolver configuration, or future package release is compromised, attacker-controlled package code may be installed.
  5. Installed package code executes when the generation scripts import and use the dependency.

For FFmpeg, a compromised or untrusted executable found through the local `PA ...[truncated 552 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add a reviewed dependency manifest with explicit version constraints.
  2. Generate a lockfile containing cryptographic hashes for all direct and transitive Python dependencies.
  3. Document installation through a command such as pip install --require-hashes -r requirements.txt.
  4. Use an isolated virtual environment rather than modifying the global Python installation.
  5. Define supported Python and requests versions and periodically review them for known vulnerabilities.
  6. Document trusted FFmpeg installation sources and a supported minimum version.
  7. In controlled deployments, invoke a configured absolute path to the reviewed FFmpeg binaries instead of relying only on ambient PATH resolution.
  8. Add dependency and container-image scanning to the release process.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a specialized branded-content workflow, but the reported implementation behaves more like a general AI-HIVE wrapper with undeclared chat, image generation, and user-info functions. In context, that makes the issue more dangerous because marketing and ecommerce users may trigger external generation or account-related actions under the assumption they are using a narrowly scoped creative-planning tool.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a specialized branded-content workflow, but the reported implementation behaves more like a general AI-HIVE wrapper with undeclared chat, image generation, and user-info functions. In context, that makes the issue more dangerous because marketing and ecommerce users may trigger external generation or account-related actions under the assumption they are using a narrowly scoped creative-planning tool.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a specialized branded-content workflow, but the reported implementation behaves more like a general AI-HIVE wrapper with undeclared chat, image generation, and user-info functions. In context, that makes the issue more dangerous because marketing and ecommerce users may trigger external generation or account-related actions under the assumption they are using a narrowly scoped creative-planning tool.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a specialized branded-content workflow, but the reported implementation behaves more like a general AI-HIVE wrapper with undeclared chat, image generation, and user-info functions. In context, that makes the issue more dangerous because marketing and ecommerce users may trigger external generation or account-related actions under the assumption they are using a narrowly scoped creative-planning tool.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises and demonstrates code paths that rely on environment variables, file access, shell execution, and network calls, but it does not declare any explicit tool scope or allowed-tools policy. This creates an overbroad execution surface where a host may grant more capability than users or reviewers expect, increasing the risk of unintended file access, command execution, or outbound requests if the surrounding agent honors the examples or inferred capabilities.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The default prompt hard-codes Chinese output and a specific workflow style without checking user preference or language choice. While not a direct code-execution issue, it can override user intent, reduce transparency, and increase the risk of miscommunication in a skill that produces operational instructions and deliverables for advertising workflows.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill enables implicit invocation with no visible trigger constraints, exclusions, or user-confirmation guardrails. In a workflow that can generate production-ready instructions and runnable AI-HIVE commands, this increases the chance the skill is auto-selected in contexts the user did not clearly intend, leading to unintended content generation, external API use, or marketing/ad-production actions.

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:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file-level documentation says this is a '通用 AI 能力调用工具' that wraps text chat, image generation, video generation, model queries, media upload, and task polling. That directly conflicts with the manifest's representation of a specialized skill for product-placement micro-drama creation, indicating the code/documentation intent is broader than the declared skill intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module description and all user-facing guidance are presented in Chinese, which imposes a specific language on users without any opt-in or fallback. Under the policy rule, forcing a language/locale without user choice is a natural-language policy violation unless clearly justified as 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 script includes browser-driven API key acquisition and local credential storage, which is a sensitive-account-management feature unrelated to the narrow creative skill purpose. Embedding credential setup into the skill encourages end users to grant persistent API access and store secrets locally, increasing the attack surface if the skill is misused, repurposed, or run in an unsafe environment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill-specific wrapper exposes generic task querying and arbitrary media upload capabilities in addition to the advertised product-placement image generation flow. That broadens the effective privilege and usage scope of the skill, enabling it to act as a general AI-Hive client rather than a narrowly bounded creative helper, which increases the chance of unauthorized data upload or off-purpose API use.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a domain-specific skill for generating 商品植入微短剧 outputs such as plot premises, insertion points, character/scene boards, storyboards, and finished assets. In practice, this file is a general-purpose CLI for chat, image, video, upload, task polling, and API-key setup, and the skill-specific path at L812-L830 merely forwards a free-form prompt to a generic video model without enforcing the stated marketing/drama workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains user-facing natural-language strings, including the module docstring and CLI help, that force Chinese as the interaction language. The policy requires flagging language or locale constraints when the skill does not offer user opt-in or clearly justify the restriction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest centers on creating product-placement micro-dramas and using AI-HIVE for asset generation in that workflow. This file additionally implements standalone user-info lookup, model enumeration, text chat, and image generation commands, which are broad platform capabilities rather than purpose-specific functions for the declared micro-drama skill.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The inline documentation explicitly frames the module as a general AI capability invocation tool. That directly conflicts with the surrounding skill manifest and embedded SKILL_CONFIG branding the file as a specific 商品植入微短剧 skill, indicating intent/documentation drift.

Content

No source excerpt is available for this finding.