Back to skill

Security audit

AI大模型专家|海外短剧多语言本地化与发行

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent AI-HIVE media workflow, but it needs review because its API key can be sent to an unvalidated custom endpoint.

Install only after reviewing the endpoint and dependency risks. Use the default AI-HIVE HTTPS endpoint, avoid --base-url and AI_HIVE_BASE_URL unless you fully trust the server and use a separate limited key, run setup in a dedicated virtual environment with pinned dependencies, upload only intended media, and rotate the API key if it may have been used with an untrusted endpoint.

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

Bearer API Key Disclosure Through an Unrestricted Custom API Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:91-99, 130-143; scripts/videogen.py:91-99, 130-143
Vulnerability Type: Unrestricted credential forwarding to a configurable endpoint
Risk Level: High

Vulnerable Code

The following logic appears in both affected scripts:

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

The selected URL is subsequently used with the bearer credential:

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 scripts allow the API base URL to be supplied through a command-line argument, the AI_HIVE_BASE_URL environment variable, or ~/.ai-hive/config.json. The value is accepted without enforcing HTTPS, verifying the destination hostname, or requiring confirmation for a nonstandard endpoint.

AiHiveClient then attaches the AI-HIVE API key to every request as an Authorization: Bearer header. Consequently, changing the base URL redirects authenticated requests and discloses the credential to the selected server. Generation prompts, task identifiers, pricing data, and media-upload metadata may also be exposed.

Attack Path

  1. An attacker ...[truncated 1257 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict authenticated requests to an explicit allowlist, with ai-hive.iclip.cn as the default permitted hostname.
  2. Parse endpoints with urllib.parse.urlparse and reject URLs that do not use HTTPS.
  3. Reject URLs containing embedded credentials, unexpected ports, fragments, or malformed hostnames.
  4. Do not forward an AI-HIVE credential to custom endpoints. Require a separate credential when custom API-compatible servers are supported.
  5. Require an explicit interactive confirmation before using any nonstandard endpoint and display the exact destination hostname.
  6. Protect the configuration file against unauthorized modification and warn when its ownership or permissions are unsafe.
  7. Apply the same validation in both imagegen.py and videogen.py, preferably through a shared, centrally tested configuration module.
  8. Add automated tests confirming that HTTP endpoints and unapproved hosts are rejected before any authenticated request is made.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:136
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:136-139
Vulnerability Type: Unpinned package installation from the active pip index
Risk Level: Medium

Vulnerable Code

bash
pip3 install requests
python3 "$SKILL_PATH/scripts/videogen.py" init --skill-name ai-model-expert-drama-global-drama-localization

Technical Analysis

The initialization instructions install requests without a version constraint, integrity hash, lock file, isolated environment, or explicit trusted package index. The installed artifact therefore depends on the package version and index configuration available at execution time.

If the active package index, mirror, network path, or upstream release is compromised, an attacker-controlled package can be installed. The scripts import requests immediately at startup, so malicious code contained in the installed package can execute when the documented initialization or generation workflow is used.

Even without a supply-chain compromise, an unpinned dependency can introduce incompatible behavior or future vulnerabilities and prevents reproducible security review.

Attack Path

  1. An attacker compromises or controls the pip index or mirror configured on the victim's system, or a malicious upstream package release becomes available.
  2. The user follows the documented command pip3 install requests.
  3. pip resolves and installs the attacker-controlled or otherwise unaudited package version.
  4. The user invokes videogen.py or imagegen.py.
  5. Python imports the installed requests package, allowing malicious package code to execute with the privileges of the user running the command.

Impact Assessment

A malicious dependency executes with the local privileges of the invoking user. It could access files available to that user, including ~/.ai-hive/config.json and its API key, modify user-owned files, inspect environment variables, initiate network connections, or ...[truncated 293 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin requests and its transitive dependencies to reviewed versions in a lock file.
  2. Use hash verification, such as pip install --require-hashes -r requirements.txt, with SHA-256 hashes for every artifact.
  3. Direct installation to an explicitly trusted HTTPS package index rather than implicitly accepting the user's active index configuration.
  4. Install dependencies in a dedicated virtual environment with no elevated privileges.
  5. Periodically review and update pinned versions after vulnerability scanning and compatibility testing.
  6. Document the supported Python version and provide a reproducible dependency manifest.
  7. Consider distributing a signed package or verified environment definition to reduce runtime dependency resolution.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A second aspect of the same mismatch is more sensitive: the skill reportedly opens a browser, guides the user to log in, queries account information such as wallet balance, and persists API keys to a local config file, yet these account-management behaviors are not reflected in the skill’s stated purpose. Hidden or under-disclosed credential collection and local secret persistence materially raise the risk of secret exposure, privacy leakage, and over-trust by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A second aspect of the same mismatch is more sensitive: the skill reportedly opens a browser, guides the user to log in, queries account information such as wallet balance, and persists API keys to a local config file, yet these account-management behaviors are not reflected in the skill’s stated purpose. Hidden or under-disclosed credential collection and local secret persistence materially raise the risk of secret exposure, privacy leakage, and over-trust by users.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises executable scripts that use shell, network access, filesystem access, and environment variables, but it does not declare any explicit tool scope or permission boundaries. That increases the risk of over-broad execution in host environments, makes review harder, and can enable unintended access to local files, secrets, or network resources if the skill is invoked automatically.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The metadata sets language: zh-CN, which indicates a fixed language/locale. The file describes multilingual localization for overseas markets, but it does not offer the user a language choice or explain why interaction must be limited to Simplified Chinese.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger language is broad and overlaps with common topic terms, which can cause the skill to activate in conversations that merely mention short dramas, localization, or related media topics. In a skill that can invoke scripts, access files, use network APIs, and handle credentials, unintended activation increases the chance of unnecessary data exposure or accidental external actions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file is packaged as a skill for drama localization/planning, but the implementation is actually a generic AI-Hive client supporting chat, media upload, image generation, video generation, model enumeration, and task polling. This capability mismatch is dangerous because users, policy layers, or reviewers may grant the skill broader trust than intended, enabling unreviewed access to external AI/media functions and expanding the attack surface beyond the declared purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file contains user-facing docstrings, prompts, help text, and status messages that consistently force Chinese-language interaction. Under the policy, a skill should not impose a specific language or locale unless it offers user opt-in or clearly documents a justified regional constraint.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code supports arbitrary media upload plus generic video generation, which materially exceeds a drama-localization/planning role. In context, this broadens the skill from planning/localization into a general-purpose content generation and file-transfer client, which can be abused to exfiltrate local media to a remote service or perform actions that users did not expect this skill to have.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring presents the skill entirely in Chinese as the user-facing description and instructions, with no indication that another language can be selected. This is a natural-language locale policy concern because the skill appears to impose a specific language rather than offering opt-in or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill exposes broad AI-Hive platform capabilities such as account inspection, model enumeration, generic generation plumbing, and raw upload/task handling that go beyond the advertised short-drama localization/video workflow. In an agent setting, this expands the action surface available to prompts or downstream wrappers, increasing the chance of unauthorized data access, unintended spending, or misuse of the user's linked AI-Hive account.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The standalone text-chat path turns a specialized short-drama/video skill into a general-purpose model access proxy. In an agent environment, that enables prompt-driven use outside the declared scope, including arbitrary model interaction, multimodal uploads, and potentially billable operations not aligned with user expectations or least-privilege design.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code file contains multiple user-facing natural-language strings entirely in Chinese, including the docstring, CLI description, and generated metadata, with no indication that the user can opt into another language. Under the policy, forcing a specific language without user choice can be a locale-policy violation unless the constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The top-level docstring says this file is a '通用 AI 能力调用工具' covering text chat, image generation, video generation, model queries, uploads, and polling. However, the bottom section repackages the executable as a fixed GPT Image 2 image skill with a specialized parser and skill_main, so the documentation describes a broader tool identity than what runs when the file is executed directly.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill exposes user/account information and model listing functions that are not necessary for a narrowly scoped drama-localization helper. Even if these endpoints are legitimate, unnecessary introspection increases information exposure and can aid reconnaissance about account state, available models, balances, and platform capabilities.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The user-info capability exposes account and wallet information unrelated to the declared drama-localization use case. Even if not directly destructive, it unnecessarily reveals sensitive account metadata and balances, which can aid profiling, social engineering, or abuse planning when an agent can invoke tools more broadly than intended.

Content

No source excerpt is available for this finding.