Back to skill

Security audit

1688 电商视频生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

This looks like a legitimate AI Hive video skill, but it can send API keys and selected media to an unvalidated custom endpoint.

Review the endpoint settings before installing or running this skill. Use only the default trusted AI Hive base URL unless you intentionally operate a custom deployment, avoid passing sensitive business media unless upload is expected, protect the saved API key, and prefer an isolated environment with pinned dependencies.

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

Unrestricted API Base URL Override Can Disclose Credentials and User Media

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 91-101, 125-143, 266-305, and 585-588
Vulnerability Type: Unvalidated external service 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
class AiHiveClient:
    """封装 AI Hive OpenAPI HTTP 调用。"""

    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
            )
python
media_id = token["mediaId"]
upload_url = token["upload"]["url"]
upload_method = token["upload"].get("method", "PUT")
upload_headers = token["upload"].get("headers", {})

# PUT 到 OSS — 不携带 API Key,使用返回的 headers
print(f"[2/3] 上传文件到对象存储...")
with open(str(path), "rb") as f:
    try:
        oss_resp = requests.request(
            upload_method, upload_url, headers=upload_headers,
            data=f, timeout=300,
        )
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_BASE_URL})")
    parser.add_argument("--verbose", action="sto
...[truncated 2551 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove --base-url and AI_HIVE_BASE_URL overrides from the production Skill interface unless custom deployments are a documented requirement.
  2. Allow-list the expected API hostname, such as ai-hive.iclip.cn, and require an https URL with an expected port.
  3. If custom endpoints must remain supported, require an explicit high-friction confirmation before sending credentials and clearly display the target origin.
  4. Use separate credentials for custom endpoints rather than sending the production AI Hive key to arbitrary configured hosts.
  5. Validate every upload and download URL returned by the API. Require HTTPS and restrict destinations to approved object-storage hostnames.
  6. Reject URL user information, unexpected ports, redirects to untrusted hosts, and non-HTTP methods not required by the upload protocol.
  7. Consider disabling automatic redirects or revalidating the destination after every redirect to prevent allow-list bypass.
  8. Document that selected media is transmitted to an external generation service and obtain appropriate user approval before uploading sensitive business assets.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:66
Finding

Third-Party Dependency Is Installed Without Version or Integrity Pinning

Content
View full analysis

Vulnerability Details

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

Vulnerable Code

bash
pip3 install requests

Technical Analysis

The installation instructions direct users to install requests without specifying a reviewed version, a lock file, an integrity hash, or a trusted package index. The package and its transitive dependencies are therefore resolved dynamically from the active pip configuration at installation time.

This makes installation non-reproducible and causes the effective dependency code to vary over time and across environments. Although requests is the correct package name and there is no evidence that the project intentionally references a malicious dependency, a compromised or attacker-controlled package index could provide untrusted code under that name or influence transitive dependency resolution.

Python packages may execute build-backend or setup logic during installation. Malicious package code can also execute when videogen.py imports requests.

Attack Path

  1. A user follows the documented installation command.
  2. The user's pip configuration points to a compromised, malicious, or untrusted package index, or an upstream package release is compromised.
  3. Because no version and hash are pinned, pip resolves and installs the package artifacts provided by that source.
  4. Malicious installation logic may execute during package installation, or malicious runtime logic executes when videogen.py imports requests.
  5. The dependency code runs with the privileges of the user executing pip or the Skill.

Impact Assessment

If dependency resolution is compromised, attacker-controlled Python code could execute with the installing user's privileges. Depending on those privileges, this could expose local files and credentials, alter user-owned files, access the network, or compromise su ...[truncated 286 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin requests and its transitive dependencies to reviewed versions in a requirements or lock file.
  2. Include SHA-256 hashes and install with hash verification, for example through pip install --require-hashes -r requirements.txt.
  3. Specify or document the trusted Python Package Index source and avoid inheriting unknown user-level mirror configuration in automated installation.
  4. Review and update pinned versions on a controlled schedule using dependency vulnerability scanning.
  5. Prefer installation in an isolated virtual environment with only the permissions needed to run the Skill.
  6. Add the dependency manifest and lock or constraints file to the audited project so dependency changes are visible during code review.
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 (10)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes shell commands, installs a package, performs file I/O, and appears capable of networked task execution, yet it declares no explicit tool or permission scope. This creates unnecessary ambient authority: an agent may run broader actions than a reviewer or user expects, increasing the risk of unintended command execution, filesystem access, or outbound requests during use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description and the entire skill content are written in Chinese and present the workflow as Chinese-only, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the constraint is explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file embeds a full generic AI Hive client with chat, image, video, model discovery, upload, and account APIs, while the advertised skill is narrowly scoped to 1688 video generation/editing. This creates unnecessary capability expansion: if an agent or orchestrator invokes the wrong entrypoint or repurposes the script, the skill can perform actions outside user expectations and outside least-privilege boundaries.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module presents itself as a generic AI capability tool rather than a specialized 1688 video skill, which is a security-signaling mismatch. Misleading identity increases the chance that a broader-than-intended tool is approved, reused, or invoked under a narrower trust assumption, enabling capability confusion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains user-facing natural-language strings and documentation entirely in Chinese, including the module docstring and CLI guidance. Because the skill presents a fixed language experience with no opt-in or alternative locale, it violates the language/locale policy for natural-language behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Exposing arbitrary text chat in a video-generation skill materially broadens what the skill can do, including sending unrestricted user/system prompts and uploaded media to general-purpose text models. In agent environments, this violates least functionality and can be abused as an unsanctioned general LLM tool, increasing data leakage and policy bypass risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Standalone image generation is not required for the declared video-editing workflow, yet the script exposes it as a first-class capability. This unnecessary expansion allows consumers to use the skill for unrelated generation tasks, undermining scope-based trust decisions and increasing the blast radius of API-key-backed actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all substantive skill information in Chinese, including behavior descriptions and operational notes, with no indication that users may choose another language. That can violate a language/locale policy when users are not explicitly opted into Chinese-only documentation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example API key placeholder uses Chinese text ('请替换为你的APIKey'), which imposes a specific language in user-facing configuration content. There is no indication that the skill is region-specific or that alternative locales are supported, so this appears to violate the language/locale policy requirement.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The code defines and exposes a user-info operation, and the CLI help states it queries user information and wallet balance. Accessing account/profile/billing data is not an obvious requirement for generating or editing product showcase videos for 1688 merchants.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.