Back to skill

Security audit

连载角色一致性守护|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

This skill discloses AI-HIVE media generation workflows, but its broad activation, external uploads, chargeable task creation, and weak endpoint scoping deserve review before installation.

Install only if you expect a Chinese AI-HIVE workflow that may upload authorized media to AI-HIVE, create potentially billable image/video generation tasks, and store an AI-HIVE API key locally. Before use, keep the default AI-HIVE endpoint, avoid setting AI_HIVE_BASE_URL or --base-url unless you control the endpoint, use a limited API key if available, and require explicit confirmation before uploads or paid generation.

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/imagegen.py:94
Finding

API Key Disclosure Through a User-Configurable API Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:94-99, 128-143; equivalent implementation in scripts/videogen.py:94-99, 128-143
Vulnerability Type: Arbitrary credential transmission caused by insufficient endpoint validation
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
        )

Technical Analysis

The API base URL may be supplied through a command-line argument, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. The value is accepted without verifying its scheme or hostname.

The client subsequently attaches the AI-HIVE bearer token to every request made against that endpoint. Consequently, an arbitrary endpoint configured through any of these channels receives the user's API key. The implementation does not enforce HTTPS, restrict destinations to the documented AI-HIVE domain, or warn the user before sending credentials to a nonstandard destination.

The same vulnerable implementation is present in both imagegen.py and videogen.py.

Attack Path

  1. An attacker modifies the v ...[truncated 1095 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict normal API operations to the documented https://ai-hive.iclip.cn hostname.
  2. Reject non-HTTPS URLs and URLs containing embedded credentials, unexpected ports, fragments, or unapproved hostnames.
  3. If custom endpoints are a legitimate requirement, require an explicit opt-in flag and interactive confirmation before transmitting a credential.
  4. Use separate, endpoint-specific credentials instead of reusing the production AI-HIVE key with custom servers.
  5. Validate the ownership and permissions of ~/.ai-hive/config.json before trusting its contents.
  6. Display the selected endpoint before authenticated operations without displaying the API key.
  7. Apply the same endpoint-validation changes to both scripts/imagegen.py and scripts/videogen.py.
  8. Add automated tests confirming that HTTP endpoints, lookalike domains, malformed URLs, and unapproved hosts are rejected.

T08 · Insecure Dependencies

Note
Location
scripts/imagegen.py:10
Finding

Unpinned Runtime Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:67, scripts/imagegen.py:10-13; equivalent dependency handling in scripts/videogen.py:10-13
Vulnerability Type: Unpinned third-party dependency and non-reproducible installation
Risk Level: Low

Vulnerable Code

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

The documented installation command is:

bash
pip3 install requests

Technical Analysis

The project instructs users to install requests without specifying a reviewed version, dependency lockfile, integrity hash, package index, or isolated environment. The resolved package and its transitive dependencies can therefore change after the Skill has been audited.

Although no malicious dependency is bundled in the reviewed project, this installation pattern is not reproducible and expands the effective codebase beyond the audited artifact. It may install a future compromised, vulnerable, or incompatible release.

Attack Path

  1. A user invokes one of the generation scripts without requests installed.
  2. The script instructs the user to execute pip3 install requests.
  3. The package manager resolves the current package and transitive dependency versions rather than versions reviewed with this project.
  4. If the configured package index, network path, package release, or dependency has been compromised, attacker-controlled installation or runtime code may be installed.
  5. That code executes with the privileges of the user running pip, either during package installation or when the generation script imports the package.

Impact Assessment

Exploitation depends on a compromised package source, release, dependency, or package-manager configuration. If exploitation occurs, malicious dependency code could run with the invoking user's privileges and access files, environment var ...[truncated 188 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add a dependency manifest containing a reviewed, exact requests version.
  2. Generate and verify cryptographic hashes for the package and its transitive dependencies.
  3. Provide a lockfile to make installations reproducible.
  4. Direct users to install dependencies in a dedicated virtual environment.
  5. Specify the trusted official package index in installation documentation.
  6. Integrate dependency vulnerability and integrity scanning into the release process.
  7. Periodically update pinned versions after security review rather than resolving the latest version at installation time.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
96% confidence
Finding

The skill is marketed as a specialized continuity QA tool, but the effective behavior appears closer to a generic generation/task-management client. In security terms, misrepresentation of core function undermines trust boundaries: users may provide copyrighted or sensitive reference assets believing they will only be analyzed, while the skill may instead upload, transform, or generate content through external services.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is marketed as a specialized continuity QA tool, but the effective behavior appears closer to a generic generation/task-management client. In security terms, misrepresentation of core function undermines trust boundaries: users may provide copyrighted or sensitive reference assets believing they will only be analyzed, while the skill may instead upload, transform, or generate content through external services.

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 continuity QA tool, but the effective behavior appears closer to a generic generation/task-management client. In security terms, misrepresentation of core function undermines trust boundaries: users may provide copyrighted or sensitive reference assets believing they will only be analyzed, while the skill may instead upload, transform, or generate content through external services.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is marketed as a specialized continuity QA tool, but the effective behavior appears closer to a generic generation/task-management client. In security terms, misrepresentation of core function undermines trust boundaries: users may provide copyrighted or sensitive reference assets believing they will only be analyzed, while the skill may instead upload, transform, or generate content through external services.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The advertised skill is for serialized character-consistency analysis, but the implemented entrypoints expose generic image generation, media upload, and task management. This is a capability mismatch that can mislead users and upstream agents into granting broader generation and file-handling privileges than the declared purpose requires, increasing the risk of unauthorized content generation or policy bypass through a seemingly narrow skill.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file is packaged as a serialized-character consistency skill, but the implementation exposes broad chat, image, video generation, upload, and task-polling capabilities. This capability mismatch is dangerous because downstream systems, reviewers, or users may grant trust, permissions, or policy exceptions based on the advertised purpose while the code can be used for substantially broader content generation workflows.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises executable examples and operational workflows that imply access to environment variables, filesystem, shell, and network, but it does not declare any explicit tool scope or permissions boundaries. That creates a least-privilege failure: an integrator or agent may grant broader capabilities than necessary, increasing the blast radius if the skill is invoked on untrusted inputs or later expanded with hidden tool use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger conditions are broad enough to match common marketing and content-production requests, which can cause the skill to activate outside its intended narrow use case. Over-broad activation is risky here because the skill appears to have network, file, and generation-related capabilities; unintended invocation could expose unrelated user content to external processing or cause unnecessary tool use and charges.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill can be implicitly invoked and its default prompt broadly transforms user requests into executable workflows and runnable AI-HIVE commands without tightly constraining when it should activate. In a capability that may upload reference materials, query external APIs, and generate production-ready outputs, ambiguous scope increases the chance of unintended activation and unsafe assistance outside the intended serialized-character-consistency use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The prompt explicitly says to produce a "production-ready Chinese workflow," which imposes a language choice in natural language. There is no indication that the user opted into Chinese output or that the skill is limited to a Chinese-only, region-specific use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language strings in the module docstring and argparse description are entirely in Chinese, and the skill metadata also hard-codes a Chinese skill name. This can constitute a language/locale policy violation when the skill does not document any user opt-in or alternative locale support.

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:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module documentation describes a generic AI capability invocation tool rather than a narrowly scoped character-consistency skill. Misleading documentation and parser descriptions can cause reviewers, agents, or permission systems to misunderstand the actual capability set, undermining trust boundaries and enabling overbroad use under a specialized label.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring and all user-facing guidance are written only in Chinese, and the skill does not indicate that language choice is optional or that the tool is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill includes a user-info endpoint that retrieves account information and wallet balance, which is not necessary for serialized character-consistency protection. Unnecessary access to account metadata expands the data exposure surface and may leak sensitive billing or identity details if the skill is invoked in broader automation contexts.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring and parser descriptions present the tool as a general-purpose AI client, which directly contradicts the narrower packaged identity of a character-consistency guard. This can mislead operators and automated governance controls, increasing the chance the skill is approved or invoked in contexts where generic media generation should not be available.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file-level docstring and nearly all user-facing messages are written only in Chinese, with no indication that the user can choose another language. This creates a natural-language policy concern because the skill effectively imposes a locale on all interactions rather than offering an opt-in or documenting a justified region-specific restriction.

Content

No source excerpt is available for this finding.