Back to skill

Security audit

评论区痛点转广告|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its marketing media workflow, but its scripts can send the user's AI-HIVE API key to an arbitrary configured API URL.

Review this skill before installing. Use it only if you are comfortable giving it an AI-HIVE API key and uploading selected business media to AI-HIVE. Do not use --base-url, AI_HIVE_BASE_URL, or a modified ~/.ai-hive/config.json unless you fully trust the target server, because the current code will send the bearer API key there. Prefer a dedicated low-balance or revocable API key and verify commands before any billable 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/imagegen.py:89
Finding

Bearer API Key Disclosure Through an Unrestricted Base URL Override in the Image Generator

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:89-99, 132-143, 587
Vulnerability Type: Unvalidated API endpoint override causing credential disclosure
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
self.headers = {
    "Authorization": f"Bearer {config.api_key}",
    "Content-Type": "application/json",
}
python
resp = requests.request(
    method, url, headers=self.headers, timeout=DEFAULT_TIMEOUT, **kwargs
)
python
parser.add_argument("--base-url", help=f"API Base URL (default {DEFAULT_BASE_URL})")

Technical Analysis

The API origin can be replaced through the --base-url argument, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. The supplied value is accepted without validating its scheme, hostname, port, or origin.

The same client automatically attaches the AI-HIVE bearer API key to every request made against the resulting URL. Consequently, an attacker-controlled endpoint receives the API key in the Authorization header. The implementation also accepts plain HTTP URLs, allowing the credential and request contents to be transmitted without transport encryption.

A configurable API endpoint may be useful for development, but automatically forwarding a production credential to any arbitrary origin exceeds the minimum privileges required for the declared image-generation functionality.

Attack Path

  1. An attacker convinces the user to run the image generator with a malicious --base-url, modifies AI_HIVE_BASE_URL, or alters the base_url ...[truncated 1062 chars]
Remediation
View remediation

Remediation Suggestions

  • Restrict authenticated requests to an explicit HTTPS hostname allowlist, with ai-hive.iclip.cn as the default permitted origin.
  • Parse the URL with a standard URL parser and reject non-HTTPS schemes, embedded credentials, unexpected ports, fragments, malformed hosts, and ambiguous hostnames.
  • Disable cross-origin redirects for authenticated requests, or validate every redirect target before forwarding the Authorization header.
  • Do not send the production API key to custom endpoints. If custom development endpoints are necessary, require a separate credential and an explicit high-friction opt-in.
  • Ignore or reject untrusted AI_HIVE_BASE_URL values in normal production operation.
  • Validate the configuration file owner and permissions before reading credentials or endpoint settings.
  • Add automated tests proving that HTTP URLs, unknown hosts, and redirects to unknown origins are rejected.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/videogen.py:89
Finding

Bearer API Key Disclosure Through an Unrestricted Base URL Override in the Video Generator

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:89-99, 132-143, 587
Vulnerability Type: Unvalidated API endpoint override causing credential disclosure
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
self.headers = {
    "Authorization": f"Bearer {config.api_key}",
    "Content-Type": "application/json",
}
python
resp = requests.request(
    method, url, headers=self.headers, timeout=DEFAULT_TIMEOUT, **kwargs
)
python
parser.add_argument("--base-url", help=f"API Base URL (default {DEFAULT_BASE_URL})")

Technical Analysis

The video-generation client duplicates the unrestricted endpoint behavior found in the image generator. A command-line option, environment variable, or persistent configuration value can redirect authenticated API traffic to an arbitrary destination.

No validation ensures that the destination uses HTTPS or belongs to the intended AI-HIVE service. Since the bearer credential is attached before the request is sent, any selected destination receives the API key. This creates a direct credential-exfiltration primitive if an attacker can influence a generated command, environment setting, or configuration file.

Attack Path

  1. An attacker supplies a video-generation command containing an attacker-controlled --base-url, sets AI_HIVE_BASE_URL, or changes the saved configuration.
  2. The user runs video generation, task polling, or media upload.
  3. The client resolves the attacker URL as its API base.
  4. The client attaches the user's AI-HIVE API key to the reques ...[truncated 655 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove arbitrary production endpoint overrides unless they are operationally necessary.
  • Enforce an exact HTTPS origin allowlist before constructing authenticated requests.
  • Never forward the bearer token across redirects to a different scheme, host, or port.
  • Reject plain HTTP endpoints and URLs containing user information.
  • Require separate credentials for explicitly enabled test or self-hosted endpoints.
  • Protect the saved configuration against unauthorized modification and verify its ownership before use.
  • Consolidate the duplicated API client into one reviewed module so security corrections are consistently applied to image and video workflows.

T08 · Insecure Dependencies

Note
Location
scripts/imagegen.py:7
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:7, 21; scripts/videogen.py:7, 21; SKILL.md:67
Vulnerability Type: Unpinned package installation and mutable supply-chain dependency
Risk Level: Low

Vulnerable Installation Command

bash
pip3 install requests

The command is recommended by both generator scripts when the dependency is missing, while the documentation states that requests is required. The project does not include a version lock, package hash, or dependency lockfile.

Technical Analysis

Installing an unconstrained package causes the package manager to resolve whatever release is current at installation time. The reviewed source therefore does not fully determine the code that will execute in the user's environment.

Although requests is a well-known package and no typosquatted package name was observed, mutable dependency resolution remains a supply-chain weakness. A compromised package-index account, compromised distribution artifact, malicious mirror, or incompatible future release could introduce code or behavior that was not covered by this audit.

Attack Path

  1. The requests dependency is absent from the user's environment.
  2. The user follows the installation instruction displayed by the script or documentation.
  3. pip resolves the latest available package and transitive dependencies from its configured index or mirror.
  4. A compromised, substituted, or incompatible distribution is downloaded and installed.
  5. Package installation or subsequent import executes code with the privileges of the user running the command.
  6. That code can access data and credentials available to the Python process, including the AI-HIVE API key when the generator is later invoked.

Impact Assessment

A malicious dependency can execute with the installing user's local privileges and potentially read user-accessible files, environment variables, and API credentials; ...[truncated 255 chars]

Remediation
View remediation

Remediation Suggestions

  • Provide a reviewed dependency file with exact versions.
  • Include cryptographic hashes and install with:
bash
pip install --require-hashes -r requirements.txt
  • Lock transitive dependencies as well as direct dependencies.
  • Recommend installation inside a dedicated virtual environment rather than the user's global Python environment.
  • Use a trusted package index and document any approved internal mirror.
  • Add automated dependency vulnerability and integrity scanning to the release process.
  • Periodically update pinned versions through a controlled review and testing workflow.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (23)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Marketing-analysis skills often handle screenshots, comments, product facts, and brand assets; if actual implementation centers on generic chat, wallet/user-info queries, model browsing, or media generation, that is materially broader than promised. Such overreach can expose sensitive business data or trigger billable external operations without a reviewer realizing the true scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Marketing-analysis skills often handle screenshots, comments, product facts, and brand assets; if actual implementation centers on generic chat, wallet/user-info queries, model browsing, or media generation, that is materially broader than promised. Such overreach can expose sensitive business data or trigger billable external operations without a reviewer realizing the true scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Marketing-analysis skills often handle screenshots, comments, product facts, and brand assets; if actual implementation centers on generic chat, wallet/user-info queries, model browsing, or media generation, that is materially broader than promised. Such overreach can expose sensitive business data or trigger billable external operations without a reviewer realizing the true scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Marketing-analysis skills often handle screenshots, comments, product facts, and brand assets; if actual implementation centers on generic chat, wallet/user-info queries, model browsing, or media generation, that is materially broader than promised. Such overreach can expose sensitive business data or trigger billable external operations without a reviewer realizing the true scope.

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 workflows involving shell commands, local file access, environment variables, and network/API use, but it does not declare any tool scope restrictions such as allowed-tools or permissions. This creates an overly broad execution surface where a host agent may enable more capabilities than necessary, increasing the chance of unintended file access, secret exposure, or external requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The activation trigger uses broad phrases like comment insight, user pain points, short-video topics, and e-commerce growth, which can match many ordinary requests outside the intended scope. Overbroad triggering can cause the wrong skill to activate, pulling users into workflows involving uploads, shell commands, or external APIs when a simpler and safer response would suffice.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The usage conditions enumerate broad trigger phrases without clear boundaries for when the skill should not activate. This is dangerous in context because the skill references external generation and media-processing workflows, so accidental invocation may expose user content to unnecessary processing or cause confusion about what actions are being taken.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The natural-language default prompt explicitly requires a "production-ready Chinese workflow," which imposes a language choice regardless of user preference. This is a locale/language policy issue because the file does not offer an opt-in choice or document a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest describes a skill centered on analyzing comment exports/screenshots, deriving pain points, and optionally generating ad materials via the AI-HIVE OpenAPI workflow. This script instead performs generic local video editing operations such as trim, aspect conversion, muting, loudness normalization, and concatenation via ffmpeg, which is a production/editing capability not described as part of the skill's declared scope.

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

The file is packaged as a narrowly scoped comment-to-ad image skill, but it actually contains broader capabilities for account inspection, model enumeration, arbitrary media upload, text chat, and video generation. This capability mismatch increases attack surface and violates least-privilege expectations: an agent or user invoking the skill for a limited purpose may unknowingly gain access to unrelated operations that could expose account metadata or enable off-scope content generation.

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 natural-language descriptions and prompts exclusively in Chinese, including the module docstring and many CLI messages. That effectively forces a specific language/locale without offering user opt-in or documenting a justified region-specific constraint, which matches the language policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The generic chat capability is unrelated to the advertised purpose of converting comment pain points into ad-oriented image outputs. In an agent setting, this hidden extra primitive can be abused to send arbitrary prompts and attached images to external models, creating data exfiltration and policy-bypass risk beyond the user's expected workflow.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generic video generation path materially exceeds the declared scope of an image-focused comment-pain-point skill. Extra generation modes expand misuse potential, increase unexpected cost exposure, and let callers submit arbitrary media/prompt combinations to external services under the guise of a safer, narrower skill.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file implements a broadly capable AI-Hive client with text chat, image generation, model listing, upload, and task polling, while the declared skill is narrowly framed as comment-pain-point-to-ad video generation. This capability mismatch violates least privilege for skills and creates unnecessary attack surface, making it easier to repurpose the skill for unintended operations if invoked by an agent or user.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user-facing natural-language descriptions that assume Chinese as the interaction language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Generic text chat is unrelated to the declared single-purpose video skill and materially broadens what an agent can do with the bound API key. This can enable prompt-based misuse, policy evasion through alternate endpoints, or repurposing the skill as a general LLM interface rather than the narrowly described comment-to-ad transformer.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The initialization flow uses Chinese-only messages and prompts for browser guidance, confirmation, and API key entry. Users are not given any language choice, and no justified regional constraint is stated.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The metadata and description claim safeguards around transforming authentic comment pain points without enabling misuse, but the generate behavior does not enforce those constraints. In practice, the skill forwards arbitrary prompts and media into a generic video generation flow, so stated business-policy protections are documentation-only and can be bypassed easily.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This Python file contains user-facing natural-language strings entirely in Chinese, including the skill description, argument description, and search aliases, but does not indicate that the skill is intended only for Chinese-language users or offer any language/locale choice. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The top-level docstring says this is a '通用 AI 能力调用工具' that wraps chat, image, video, model query, upload, and polling. Later, the fixed skill configuration and specialized parser present the file as a narrow '评论区痛点转广告' image skill, so the inline documentation and the actual intended skill identity diverge.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill exposes a user-info capability, including wallet/balance inspection, that is unrelated to producing comment-derived advertising videos. Even if read-only, unnecessary access to account metadata increases privacy exposure and gives the skill visibility into information outside its stated purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Generic image generation exceeds the stated purpose of converting comment pain points into ad-video outputs and is not clearly justified by the skill contract. This creates extra capability that can be abused for unrelated content generation and weakens assurance that the skill does only what its metadata says.

Content

No source excerpt is available for this finding.