Back to skill

Security audit

AI虚拟买手穿搭内容|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

This skill is a mostly coherent AI-HIVE media workflow, but it needs Review because its scripts can send your API key to a configurable server and do not enforce the advertised real-SKU limits.

Review this skill before installing. Use it only with an AI-HIVE API key you are comfortable storing locally, avoid custom base URLs unless you fully trust the endpoint, keep generated media and uploaded references non-sensitive, and manually verify that prompts and outputs use only authorized real products before submitting paid generation tasks.

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

Bearer API Key Can Be Redirected to an Arbitrary Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:86-100, 128-143; duplicated in scripts/videogen.py:86-100, 128-143
Vulnerability Type: Unrestricted authenticated 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
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

Both API clients accept a base URL from the --base-url command-line option, the AI_HIVE_BASE_URL environment variable, or the local configuration file. The value is used without validating its scheme or hostname.

The client subsequently sends the real AI-HIVE API key in the Authorization: Bearer header to every URL constructed from that configurable base URL. Consequently, an attacker who can influence a command, environment variable, or configuration file can redirect authenticated requests to an attacker-controlled server.

The implementation does not require HTTPS, restrict the destination to an approved AI-HIVE hostname, or request confirmation before transmitting the credential to a custom endpoint. The same vulnerable implementation is present in both im ...[truncated 1290 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove runtime base-URL overrides unless they are required for a documented development workflow.
  2. Enforce HTTPS and reject URLs containing user information, fragments, unexpected ports, or non-network schemes.
  3. Maintain an explicit allowlist of approved API hostnames and verify the normalized hostname before adding the bearer header.
  4. Never send the production API key to a custom endpoint. If custom endpoints are supported, require a separate credential.
  5. Reject redirects to unapproved hosts, or disable redirects for authenticated API requests.
  6. Treat environment and configuration values as untrusted input and display the validated destination before authenticated operations.
  7. Add tests covering HTTP URLs, lookalike domains, subdomain confusion, embedded credentials, redirects, and malicious configuration values.
  8. Apply the same remediation to scripts/videogen.py, which duplicates the vulnerable client implementation.

T08 · Insecure Dependencies

Note
Location
SKILL.md:67
Finding

Unpinned Third-Party Runtime Dependency

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:67; scripts/imagegen.py:7-12; scripts/videogen.py:7-12
Vulnerability Type: Unpinned dependency installation and non-reproducible supply chain
Risk Level: Low

Vulnerable Code

python
try:
    import requests
except ImportError:
    print("缺少依赖:requests。请运行 pip3 install requests", file=sys.stderr)
    sys.exit(1)

The corresponding documentation instructs users to install requests but does not provide a version constraint, lockfile, package hash, or isolated installation procedure.

Technical Analysis

The project depends on the third-party requests package and directs users to install it using an unconstrained package-manager command. No requirements.txt, lockfile, version range, integrity hash, or package index restriction is included.

Dependency resolution therefore occurs against the package repository state at installation time. This makes installations non-reproducible and permits an unexpectedly changed, compromised, or incompatible future package release to enter the runtime environment.

The audited package name is correctly spelled, and no evidence of an intentionally malicious dependency was found. The issue is limited to inadequate dependency pinning and supply-chain hardening.

Attack Path

  1. A user runs the installation command recommended by the scripts or documentation.
  2. The package manager resolves the latest available requests release and its transitive dependencies at that time.
  3. If the resolved release or one of its dependencies has been compromised, tampered with at the configured package index, or contains a newly introduced vulnerability, that component is installed.
  4. The affected dependency executes within the user's Python environment when either generation script imports and uses it.

Impact Assessment

Impact depends on the behavior of the compromised or vulnerable dependency. Because Py ...[truncated 434 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add a dependency manifest with an explicitly reviewed requests version or narrowly bounded version range.
  2. Generate and verify cryptographic hashes, for example with pip-compile --generate-hashes.
  3. Pin and review transitive dependencies through a lockfile.
  4. Recommend installation inside a dedicated virtual environment rather than the user's global Python environment.
  5. Use a trusted package index explicitly and avoid unreviewed mirrors.
  6. Add automated dependency vulnerability scanning and a controlled update process.
  7. Keep image and video scripts on the same reviewed dependency set to prevent configuration drift.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A skill that claims to only create purchasable outfit content from authorized user SKUs but in practice includes generic media generation, account-related operations, and API-key/config management creates a trust-boundary failure. In this context, the mismatch is especially risky because the skill is intended for commercial content workflows involving assets, billing, and brand claims; users may rely on non-existent restrictions and accidentally trigger unauthorized content creation or expose sensitive account context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A skill that claims to only create purchasable outfit content from authorized user SKUs but in practice includes generic media generation, account-related operations, and API-key/config management creates a trust-boundary failure. In this context, the mismatch is especially risky because the skill is intended for commercial content workflows involving assets, billing, and brand claims; users may rely on non-existent restrictions and accidentally trigger unauthorized content creation or expose sensitive account context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A skill that claims to only create purchasable outfit content from authorized user SKUs but in practice includes generic media generation, account-related operations, and API-key/config management creates a trust-boundary failure. In this context, the mismatch is especially risky because the skill is intended for commercial content workflows involving assets, billing, and brand claims; users may rely on non-existent restrictions and accidentally trigger unauthorized content creation or expose sensitive account context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A skill that claims to only create purchasable outfit content from authorized user SKUs but in practice includes generic media generation, account-related operations, and API-key/config management creates a trust-boundary failure. In this context, the mismatch is especially risky because the skill is intended for commercial content workflows involving assets, billing, and brand claims; users may rely on non-existent restrictions and accidentally trigger unauthorized content creation or expose sensitive account context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file presents itself as a narrowly scoped virtual-stylist skill, but the implementation exposes a broad AI-Hive client with generic chat, model enumeration, account inspection, media upload, and arbitrary image/video generation. This scope mismatch is dangerous because callers may grant trust and permissions based on the advertised limited purpose, while the code can be repurposed for unrelated operations and data access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest promises that outputs will be composed only from user-provided real SKUs, but the code does not validate SKU inputs or restrict prompt content; it forwards arbitrary prompts and media directly to general video-generation models. This is dangerous because it defeats an important business and trust boundary, enabling fabricated, unauthorized, or non-purchasable content under the guise of a constrained commerce workflow.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises and demonstrates capabilities that imply shell execution, filesystem access, environment variable use, and network/API interaction, but it declares no explicit tool scope or permission boundaries. This creates an over-privilege and transparency problem: a host agent may expose broader capabilities than users or reviewers expect, increasing the chance of unsafe file access, command execution, or unintended outbound requests.

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 explicitly instructs the skill to produce a "production-ready Chinese workflow," which imposes a language choice regardless of user preference. This is a natural-language locale policy issue because the file does not offer any user language selection or opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file’s natural-language metadata and description are presented in Chinese (AI虚拟买手穿搭内容) without offering any user language choice or noting that the skill is region- or locale-specific. This can violate a language/locale policy when users are not given an opt-in or alternative locale.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The code invokes external binaries through subprocess to manipulate local media files. For a skill whose declared purpose is virtual stylist content generation via AI-HIVE OpenAPI and real-SKU outfit composition, shelling out to system-installed multimedia tools is an additional capability that is not explicitly justified in the manifest.

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

The manifest describes a stylist/content skill centered on assembling purchasable outfits from user-provided SKUs and, when generating assets, using AI-HIVE OpenAPI workflows such as config queries, uploads, polling, and downloads. This script instead provides standalone local ffmpeg operations like trim, aspect conversion, muting, loudness normalization, and concatenation, which are generic post-production capabilities not described in the manifest.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file is presented as a virtual stylist image skill, but it embeds a broader general-purpose AI client with text chat, video generation, model enumeration, uploads, and account queries. This scope mismatch is dangerous because downstream agents or policy layers may grant the skill more trust and permissions than intended, enabling capability smuggling beyond the declared use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains the primary description and CLI guidance entirely in Chinese, which effectively forces a specific language for users. The policy allows locale constraints only when users are given a choice or the restriction is clearly justified, neither of which appears here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The free-form chat endpoint allows arbitrary prompts and optional image inputs, which substantially expands the skill beyond a constrained virtual stylist image generator. In skill-based systems, this can bypass intent scoping and let callers repurpose the skill for unrelated or policy-sensitive text generation under the guise of a safer domain-specific tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring and user-facing CLI text are written entirely in Chinese, presenting the skill as a general-purpose tool rather than a region-specific or Chinese-only tool. This creates a natural-language locale constraint without offering user opt-in or documenting why a single language is required.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The user-info endpoint exposes account details and wallet balance that are unrelated to producing virtual-stylist content. In a skill that is supposed to handle styling and media generation, this creates unnecessary access to sensitive account metadata and broadens the blast radius if the skill is misused or invoked unexpectedly.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a skill that accepts real SKUs and uses AI-HIVE OpenAPI for configuration lookup, reference upload, routing, async polling, and asset download to produce styling content. This file does not perform any of those operations; it only collects CLI arguments and writes a deterministic local blueprint JSON, which is a materially narrower behavior than the manifest advertises.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The top-level docstring describes a '通用 AI 能力调用工具' covering broad AI-Hive functionality, while the embedded SKILL_CONFIG and wrapper entrypoint define a specific virtual stylist content skill. This creates active intent ambiguity in the file's own documentation about whether it is a generic tool or a narrowly scoped stylist skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill exposes user-info retrieval, including account or wallet data, even though that capability is unrelated to virtual stylist content generation. Unnecessary access to billing/account metadata increases privacy and reconnaissance risk if an agent or user invokes the tool outside its intended workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The skill downloads generated files to a default local directory automatically, without strong pre-download confirmation or clear warning about local persistence. While filenames are deterministic and not obviously attacker-controlled, silent disk writes can still surprise users, leak sensitive generated content onto shared systems, or consume storage unexpectedly.

Content

No source excerpt is available for this finding.