Back to skill

Security audit

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

Security checks for vulnerabilities and agentic risk

Overview

This skill is a TikTok commerce media workflow, but it needs review because it stores and uses an AI-HIVE API key while allowing a configurable API endpoint and only partially implements its advertised product-link workflow.

Install only if you trust the AI-HIVE service and are comfortable storing an API key locally. Avoid setting AI_HIVE_BASE_URL or --base-url unless you control the endpoint, prefer the default AI-HIVE URL, use a limited API key if available, review prompts and routing before any billable generation, and provide only media you are authorized to upload.

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

Error
Location
scripts/imagegen.py:91
Finding

Configurable API Origin Can Expose the Bearer API Key

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:91-100, 124-143; identical implementation in scripts/videogen.py:91-100, 124-143
Vulnerability Type: Unrestricted authenticated API endpoint configuration
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
class AiHiveClient:
    """AI Hive OpenAPI HTTP client."""

    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
            )

The same scripts expose the endpoint through the --base-url command-line argument and the AI_HIVE_BASE_URL environment variable.

Technical Analysis

The API origin is accepted from command-line input, an environment variable, or the local configuration file without validating its scheme or hostname. The client then attaches the AI-HIVE bearer credential to every request constructed from that origin.

Consequently, an attacker who can influence the invocation environment, command arguments, or configuration can redirect authenticated requests to an attacker-controlled server. An http:// endpoint would additionally transmit the bearer credent ...[truncated 1445 chars]

Remediation
View remediation

Remediation Suggestions

  1. Enforce HTTPS and reject every endpoint using another scheme.
  2. Use a strict hostname allowlist, with ai-hive.iclip.cn as the approved production host.
  3. Do not send the Authorization header when the request origin differs from the approved API origin.
  4. Disable cross-origin redirects for authenticated requests, or validate every redirect target before following it.
  5. Reject URLs containing embedded credentials, malformed hosts, ambiguous Unicode hostnames, unexpected ports, fragments, or non-API paths.
  6. If custom endpoints are required for development, place the capability behind an explicit development option and display a high-friction warning before transmitting credentials.
  7. Store development credentials separately and use limited-scope keys for non-production endpoints.
  8. Apply the same remediation to scripts/videogen.py, which contains the identical client implementation.
  9. Add tests confirming that HTTP endpoints, unapproved hosts, cross-origin redirects, and malformed URLs are rejected before any authenticated network request occurs.

T08 · Insecure Dependencies

Warning
Location
scripts/imagegen.py:7
Finding

Unpinned Dependency Installation Creates Supply-Chain Exposure

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:7, 18-22; scripts/videogen.py:7, 18-22; installation guidance also appears in SKILL.md:83-84
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Medium

Vulnerable Code and Installation Guidance

Both generation scripts direct the user to install the dependency with the following unrestricted command:

text
pip3 install requests

The project does not provide a locked dependency manifest, an exact audited version, or package integrity hashes.

Technical Analysis

Installing a dependency by name alone resolves the package and version from the user's currently configured Python package index. The resulting code is therefore mutable and depends on external repository state, local pip configuration, mirrors, proxies, and index priority.

Although requests is a legitimate package, the installation process is not reproducible or integrity-verified. A compromised package repository, malicious mirror, poisoned pip configuration, or compromised future package release could cause users to install code that was not included in or reviewed with this Skill.

Python packages and their transitive dependencies execute within the user's Python environment when imported and may also execute build-related code during installation, depending on the selected distribution.

Attack Path

  1. An attacker compromises or controls the Python package index, mirror, proxy, or pip configuration used by the victim.
  2. The user follows the Skill's installation instruction and runs pip3 install requests.
  3. Pip resolves an attacker-controlled or otherwise compromised package artifact because no version or cryptographic hash is required.
  4. Malicious code executes during package installation, package import, or subsequent script execution.
  5. The code runs with the privileges of the user who performed the installation or invoked the gen ...[truncated 648 chars]
Remediation
View remediation

Remediation Suggestions

  1. Add a dependency lock file containing an explicitly audited version of requests and all transitive dependencies.
  2. Record cryptographic hashes for every permitted distribution artifact.
  3. Instruct users to install dependencies with a hash-enforcing command such as pip install --require-hashes -r requirements.txt.
  4. Document the trusted package index and avoid untrusted extra indexes or mutable internal mirrors.
  5. Prefer installation inside a dedicated virtual environment running with ordinary user privileges.
  6. Integrate dependency vulnerability scanning and scheduled lock-file updates into project maintenance.
  7. Review dependency updates before changing locked versions or hashes.
  8. Apply the same locked dependency instructions to both scripts/imagegen.py, scripts/videogen.py, and SKILL.md.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
98% confidence
Finding

The skill is marketed as a specialized product-link conversion workflow, but the underlying behavior is described as generic AI-HIVE tool invocation with undeclared text and image capabilities. Overbroad hidden functionality increases attack surface and makes policy enforcement harder, especially where users may assume the skill is constrained to a narrow business use case.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is marketed as a specialized product-link conversion workflow, but the underlying behavior is described as generic AI-HIVE tool invocation with undeclared text and image capabilities. Overbroad hidden functionality increases attack surface and makes policy enforcement harder, especially where users may assume the skill is constrained to a narrow business use case.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is marketed as a specialized product-link conversion workflow, but the underlying behavior is described as generic AI-HIVE tool invocation with undeclared text and image capabilities. Overbroad hidden functionality increases attack surface and makes policy enforcement harder, especially where users may assume the skill is constrained to a narrow business use case.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is marketed as a specialized product-link conversion workflow, but the underlying behavior is described as generic AI-HIVE tool invocation with undeclared text and image capabilities. Overbroad hidden functionality increases attack surface and makes policy enforcement harder, especially where users may assume the skill is constrained to a narrow business use case.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest advertises product URL ingestion, fact extraction, creative rewriting, and TikTok-specific ad-prep, but the implementation only wraps generic media generation/upload APIs. This mismatch is dangerous because users and orchestrators may trust the skill to perform constrained, reviewed business logic when it actually forwards arbitrary prompts and media to a general backend, enabling deceptive capability claims and weakening security review boundaries.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises runnable commands that use environment variables, local file paths, shell execution, and networked API access, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, this weakens least-privilege controls and can let the skill invoke broader capabilities than reviewers or users would expect, increasing the chance of unintended data access, file modification, or external requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description states the skill delivers “英文钩子,” and the main description repeats that the output includes English hooks. This is a language-policy issue because it prescribes a specific output language without stating that the user can choose the language or opt in to English generation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger phrases include broad terms like TikTok, TikTok Shop, URL转视频, and cross-border advertising that can match many ordinary conversations unrelated to this skill’s specialized purpose. Overbroad activation can cause the agent to enter a more powerful, networked, or billable workflow unexpectedly, increasing the chance of data over-collection or inappropriate task routing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The default prompt hard-codes Chinese output without user choice, which can override user preference and reduce transparency about what the skill will produce. In a workflow involving compliance constraints, runnable commands, and marketing deliverables, forcing a language can cause misunderstanding of instructions, missed policy nuances, or unsafe operator execution due to translation ambiguity.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest allows implicit invocation with only broad natural-language matching from the skill metadata and default prompt, which can cause the skill to auto-trigger outside narrowly intended scenarios. In a skill that can generate runnable AI-HIVE commands and marketing content, unintended invocation increases the chance of unauthorized processing of product URLs, policy-sensitive ad generation, or bypass of user intent and review.

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
94% confidence
Finding

This code file contains natural-language descriptions and prompts entirely in Chinese, including the module docstring and later CLI help/output text, with no opt-in or alternative locale path. Under the policy rule for language/locale, this is a forced locale choice rather than a documented region-specific requirement.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The embedded skill configuration claims this skill is for converting product-link facts into TikTok commerce creative, but the exposed skill entrypoint only supports generate for images plus task/upload/init helpers. There is no code here to ingest product URLs, extract page facts, produce English hooks or UGC scripts, or generate TikTok vertical videos, so the actual behavior is materially different from the manifest-described workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file exposes a broad generic AI-Hive client with capabilities unrelated to the declared skill, including text chat, model enumeration, user-info access, and arbitrary media upload. In a skill ecosystem, this expands the effective permission surface and allows callers to use the package for actions outside the reviewed purpose, undermining least-privilege and creating opportunities for policy bypass or unreviewed data access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The top-level natural-language description is entirely in Chinese and presents the tool as a general-purpose skill, but it does not state that Chinese is optional or limited to a specific locale. For a general skill, hard-coding a single language in user-facing instructions can violate language/locale policy when no opt-in or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The docstring and argparse description identify the skill only as '商品链接转TikTok带货视频|AI-HIVE', and the generated metadata repeats the same Chinese-only skill name. This can be a natural-language policy issue because it fixes the skill's presented language/locale without any visible opt-in or alternative for users who may expect a different language.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The top-level docstring and generic CLI parser describe a broad tool covering text chat, image generation, video generation, model queries, media upload, and polling, yet the actual entrypoint executed in this file is skill_main() with only generate, task, upload, and init, and generate always routes to image generation. This documentation does not match the operational behavior of the file as shipped as a skill.

Content

No source excerpt is available for this finding.