Back to skill

Security audit

SHEIN 电商视频生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its video-generation purpose, but it can send your AI Hive API key to a user-configurable server, so it needs review before use.

Review before installing. Use only the default AI Hive endpoint or a trusted enterprise endpoint, do not set AI_HIVE_BASE_URL from untrusted instructions, and rotate the AI Hive API key if it may have been sent to an unexpected server. Prefer installing dependencies in an isolated environment with pinned versions.

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/videogen.py:91
Finding

Arbitrary API Base URL Can Disclose the AI Hive API Key

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 91-100 and 128-143
Vulnerability Type: Unrestricted credential-bearing network 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
        )

The unrestricted endpoint is exposed through both the command line and the environment:

python
def add_common_args(parser):
    parser.add_argument("--api-key", help="AI Hive API Key (sk-api-*)")
    parser.add_argument("--base-url", help=f"API Base URL (default {DEFAULT_BASE_URL})")
    parser.add_argument("--verbose", action="store_true", help="Verbose logging")

Technical Analysis

The application accepts an arbitrary API base URL from --base-url, AI_HIVE_BASE_URL, or the local configuration file. It performs no scheme validation, hostname allowlisting, or confirmation before attaching the AI Hive API key as an Authorization: Bearer header.

Consequently, the destination can be an attacker-controlled HTTPS host or even a plaintext HTTP endpoint. The API key is then transmitted to that destination wh ...[truncated 1774 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove --base-url and AI_HIVE_BASE_URL if custom endpoints are not essential to the declared Skill.
  2. Allowlist the expected HTTPS origin, such as https://ai-hive.iclip.cn.
  3. Parse endpoints with urllib.parse.urlparse and reject:
    • Any scheme other than HTTPS.
    • URLs containing embedded user information.
    • Unexpected hostnames or ports.
    • Fragments or malformed authority components.
  4. Never attach the AI Hive Bearer token to an endpoint outside the approved origin.
  5. If custom enterprise endpoints are a legitimate requirement, require explicit interactive confirmation before transmitting credentials and use separately scoped credentials for each origin.
  6. Treat changes to the configured endpoint as security-sensitive and display the exact destination before making an authenticated request.
  7. Document immediate key revocation and rotation procedures for users who may have sent a key to an untrusted endpoint.

T08 · Insecure Dependencies

Note
Location
SKILL.md:67
Finding

Unpinned Runtime Dependency Installation Creates Supply-Chain Exposure

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 67
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Low

Vulnerable Code

bash
pip3 install requests

Technical Analysis

The documented installation command installs the latest version of requests and its transitive dependencies available from the user's currently configured Python package index. It does not specify reviewed versions, package hashes, an explicit trusted index, or an isolated environment.

The effective dependency set can therefore change without any modification to the Skill package. The command also inherits local pip configuration, including alternative or attacker-controlled indexes. If installation occurs into a privileged or shared Python environment, any compromised package installation behavior receives the privileges of the invoking user.

No evidence was found that the current requests package is malicious. The confirmed weakness is the non-reproducible and insufficiently constrained dependency installation process.

Attack Path

  1. A user follows the installation command in SKILL.md.
  2. Pip reads its active index and configuration from the command line, environment, and local or global pip configuration.
  3. Because no version or hash is pinned, pip resolves whichever compatible package versions are currently offered by that index.
  4. A compromised repository, dependency maintainer account, package release, or local index configuration supplies altered package content.
  5. The package is installed with the invoking user's privileges.
  6. The altered code executes during installation where supported or when videogen.py subsequently imports and uses the dependency.

Impact Assessment

The potential impact is determined by the privileges used for package installation. Compromised dependency code could:

  • Read the AI Hive API key and other files accessible to the user.

...[truncated 424 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin requests and all transitive dependencies to reviewed versions in a lock file.
  2. Require package hashes by using a hashed requirements file with pip install --require-hashes -r requirements.txt.
  3. Direct users to create and activate a dedicated virtual environment rather than installing into a shared interpreter.
  4. Specify an explicitly trusted package index where organizational policy permits.
  5. Use automated dependency scanning and a controlled process for updating pinned versions.
  6. Avoid recommending privileged or system-wide pip installation.
  7. Consider distributing the Skill with reproducible dependency metadata rather than a mutable one-line installation command.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (11)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains user-facing natural-language content only in Chinese across the substantive changelog entries. Under the policy rule, forcing a specific language without user opt-in or a documented justification is a language/locale policy violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes Python scripts, installs dependencies, and appears to require shell, network, and file access, but it does not declare any explicit tool scope or permissions. That creates an overbroad and opaque execution model where an agent may grant more capabilities than reviewers or users expect, increasing the chance of unauthorized file access, network egress, or command execution if the script or its inputs are abused.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file’s instructional content is predominantly in Chinese, including the title and operational guidance, while not indicating that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking/regional context. Under the policy for natural-language violations, a skill that effectively enforces a specific language without opt-in should be flagged.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file is explicitly implemented as a generic AI Hive client supporting chat, image, video, model enumeration, uploads, and task polling, while the advertised skill is narrowly framed as SHEIN video generation/editing. This capability mismatch increases the attack surface and enables callers to use the skill as a general-purpose model access wrapper rather than a constrained ecommerce video tool.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring states this is a 'general AI capability invocation tool,' which contradicts the claimed SHEIN-specific skill purpose. In a security review, this kind of mismatch is dangerous because it signals the implementation may intentionally expose broader functions than users or policy expect, undermining trust boundaries and review assumptions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module docstring and user-facing instructions are written entirely in Chinese, and later prompts/messages in the CLI are also Chinese-only. For a general-purpose skill, this imposes a specific language on users without opt-in, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Text chat is unrelated to a SHEIN video-generation/editing skill and provides a separate prompt-driven capability channel that can be repurposed for unintended tasks. Because it accepts arbitrary user/system prompts and optional uploaded images, it materially expands misuse potential beyond the declared workflow.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Standalone image generation is outside the declared SHEIN video-editing purpose and introduces an additional generative modality that can be abused independently of video workflows. This broadening is especially concerning because the file already contains a dedicated skill wrapper, yet still retains unrelated generic image generation paths.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example value on L2 uses Chinese text ('请替换为你的APIKey') embedded directly in the configuration, which imposes a specific language in user-facing content. The policy for this audit flags language or locale constraints when they are forced without user opt-in or an explicit justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

Fetching user information and wallet balance is an account-management capability, not a direct requirement for generating or editing SHEIN ecommerce videos. This adds access to account metadata beyond what the manifest describes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Broad model listing/discovery exceeds the stated scope and can be used to enumerate platform capabilities beyond the intended SHEIN video models. While not severe on its own, it weakens containment by helping users pivot this skill into a general model exploration tool.

Content

No source excerpt is available for this finding.