Back to skill

Security audit

AI大模型专家|Kie.ai 替代方案|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its AI-HIVE migration and media-generation purpose, but needs Review because it stores an API key and can send authenticated requests or selected media to configurable/server-supplied endpoints without strong destination controls.

Install only if you intend to use AI-HIVE for Kie.ai migration testing and are comfortable storing an AI-HIVE API key locally. Use a limited-scope or low-balance key if possible, keep the default official endpoint, avoid untrusted --base-url or AI_HIVE_BASE_URL values, and upload only media you are authorized to send to the service. Review generated files and downloads before using them in production.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:92
Finding

API Key Disclosure Through an Arbitrary Base URL in the Image Client

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 92–99 and 130–143
Vulnerability Type: Arbitrary credential destination
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
self.headers = {
    "Authorization": f"Bearer {config.api_key}",
    "Content-Type": "application/json",
}
python
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 image client accepts its API base URL from a command-line option, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. It does not require HTTPS, validate the hostname, restrict ports, or warn when the endpoint differs from the official AI-HIVE service.

The client subsequently attaches the AI-HIVE bearer credential to every API request made through _request(). Consequently, a maliciously supplied base URL causes the legitimate API key to be transmitted to an attacker-controlled server. Supporting arbitrary credential-bearing endpoints is not required for the documented production workflow and violates least-destination principles for secrets.

Attack Path

  1. An attacker persuades the user to run the client with a malicious --base-url, modifies AI_HIVE_BASE_URL, or alters ~/.ai-hive/config.json.
  2. The user invokes an ordinary command such as model listing, image generation, task polling, or media upload.
  3. _resolve_base_url() ...[truncated 536 chars]
Remediation
View remediation

Remediation Suggestions

  • Allow authenticated requests only to an explicit allowlist of official AI-HIVE API hostnames.
  • Require HTTPS and reject URLs containing user information, unexpected ports, fragments, or non-HTTP schemes.
  • Remove production support for arbitrary base URLs unless it is operationally necessary.
  • If custom endpoints are needed for development, require an explicit unsafe-development option and a separate non-production credential.
  • Disable cross-origin redirects for authenticated requests or validate every redirect destination before forwarding credentials.
  • Display a clear confirmation warning before sending a credential to any non-default destination.
  • Protect the configuration file from unauthorized modification in addition to retaining its existing 0600 permissions.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/videogen.py:92
Finding

API Key Disclosure Through an Arbitrary Base URL in the Video Client

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 92–99 and 130–143
Vulnerability Type: Arbitrary credential destination
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
self.headers = {
    "Authorization": f"Bearer {config.api_key}",
    "Content-Type": "application/json",
}
python
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 video client duplicates the image client's endpoint-resolution and authenticated-request implementation. A command-line argument, environment variable, or configuration entry can redirect authenticated traffic to an arbitrary destination. No scheme, hostname, port, or redirect validation protects the bearer credential.

Because the Authorization header is constructed independently of the destination, the client treats an attacker-controlled endpoint as trusted and discloses the API key during an otherwise normal operation.

Attack Path

  1. An attacker introduces a hostile --base-url, AI_HIVE_BASE_URL, or configuration-file value.
  2. The victim runs a video generation, task query, model query, or upload command.
  3. The client constructs its OpenAPI URL from the hostile base.
  4. The HTTP client sends the victim's bearer API key to the hostile server.
  5. The attacker reuses the captured key against the legitimate service.

Impact Assessment

The capture ...[truncated 262 chars]

Remediation
View remediation

Remediation Suggestions

  • Restrict credential-bearing requests to an allowlist of official service hosts.
  • Enforce HTTPS with certificate verification and reject unusual ports or embedded URL credentials.
  • Separate development endpoint overrides from production credentials.
  • Require explicit confirmation for non-default destinations.
  • Prevent authenticated cross-origin redirects, including redirects to private or loopback addresses.
  • Consolidate the duplicated HTTP client into one hardened implementation so security fixes apply consistently.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/imagegen.py:277
Finding

Unvalidated Server-Directed Media Transfers in the Image Client

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 277–290 and 311–325
Vulnerability Type: Unvalidated upload and download destinations
Risk Level: Low

Vulnerable Code

python
media_id = token["mediaId"]
upload_url = token["upload"]["url"]
upload_method = token["upload"].get("method", "PUT")
upload_headers = token["upload"].get("headers", {})

# PUT to object storage without the API key; use the returned headers
print(f"[2/3] Uploading file to object storage...")
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 download_file(url, out_path, timeout=300):
    """Stream a file download and display progress."""
    print(f"[download] {out_path.name}")
    try:
        resp = requests.get(url, stream=True, timeout=timeout)
        resp.raise_for_status()
        total = int(resp.headers.get("content-length", 0))
        downloaded = 0
        with open(str(out_path), "wb") as f:
            for chunk in resp.iter_content(chunk_size=8192):
                if chunk:
                    f.write(chunk)
                    downloaded += len(chunk)

Technical Analysis

The client trusts upload URLs, HTTP methods, and headers returned by the configured API. It also downloads task results from server-provided URLs without validating their scheme, hostname, resolved IP address, redirect destinations, content type, or size.

The upload does not include the AI-HIVE bearer credential, which limits the severity. Nevertheless, it sends the entire user-selected media file and server-supplied headers to the returned destination. If the configured API is compromised or malicious, it can direct the client to attacker-controlled or internal network locations. Downloads have no maximum-byte enforcement and can consume ...[truncated 1005 chars]

Remediation
View remediation

Remediation Suggestions

  • Require HTTPS for upload and result URLs.
  • Allowlist documented object-storage and result-delivery domains.
  • Resolve destinations and reject loopback, private, link-local, multicast, and cloud-metadata address ranges.
  • Revalidate all redirect targets and limit the number of redirects.
  • Restrict upload methods to the documented method, preferably PUT.
  • Filter server-provided upload headers against an explicit allowlist.
  • Enforce maximum upload and download sizes before and during transfer.
  • Validate response content types and file signatures before assigning image extensions.
  • Require explicit user confirmation before transmitting potentially sensitive reference media.
  • Delete partial downloads after transfer failures or size-limit violations.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/videogen.py:277
Finding

Unvalidated Server-Directed Media Transfers in the Video Client

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 277–290 and 311–325
Vulnerability Type: Unvalidated upload and download destinations
Risk Level: Low

Vulnerable Code

python
media_id = token["mediaId"]
upload_url = token["upload"]["url"]
upload_method = token["upload"].get("method", "PUT")
upload_headers = token["upload"].get("headers", {})

# PUT to object storage without the API key; use the returned headers
print(f"[2/3] Uploading file to object storage...")
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 download_file(url, out_path, timeout=300):
    """Stream a file download and display progress."""
    print(f"[download] {out_path.name}")
    try:
        resp = requests.get(url, stream=True, timeout=timeout)
        resp.raise_for_status()
        total = int(resp.headers.get("content-length", 0))
        downloaded = 0
        with open(str(out_path), "wb") as f:
            for chunk in resp.iter_content(chunk_size=8192):
                if chunk:
                    f.write(chunk)
                    downloaded += len(chunk)

Technical Analysis

The video client uses server-supplied destinations for uploads and result downloads without establishing that they belong to trusted object-storage infrastructure. It does not enforce HTTPS, limit permitted methods or headers, reject internal IP ranges, constrain redirects, or impose a maximum download size.

This behavior is necessary in principle for presigned media transfer, but the implementation grants the server excessive control over where the local client sends selected images, videos, and audio. A compromised server or malicious custom base endpoint can abuse that trust.

Attack Path

  1. An attacker controls the configured ...[truncated 805 chars]
Remediation
View remediation

Remediation Suggestions

  • Permit media transfers only to documented HTTPS storage and delivery domains.
  • Reject destinations resolving to loopback, private, link-local, multicast, or cloud-metadata networks.
  • Revalidate redirect destinations before following them.
  • Restrict upload methods and headers to an explicit allowlist.
  • Apply configurable media-size limits before upload and hard byte limits while downloading.
  • Validate content type and media signatures before storing results.
  • Prompt for confirmation when uploading sensitive reference assets.
  • Consolidate this duplicated transfer implementation with the image client into a single hardened module.
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 (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented as a broad migration/comparison advisor, but it reportedly performs direct AI-HIVE text/image/video API execution, local file reads, uploads, downloads, and account queries without clearly declaring those behaviors. In context, this is especially risky because a comparative-advice skill carries an expectation of analysis rather than active processing of local assets and remote service interaction, so users may disclose files or credentials under false assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a broad migration/comparison advisor, but it reportedly performs direct AI-HIVE text/image/video API execution, local file reads, uploads, downloads, and account queries without clearly declaring those behaviors. In context, this is especially risky because a comparative-advice skill carries an expectation of analysis rather than active processing of local assets and remote service interaction, so users may disclose files or credentials under false assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented as a broad migration/comparison advisor, but it reportedly performs direct AI-HIVE text/image/video API execution, local file reads, uploads, downloads, and account queries without clearly declaring those behaviors. In context, this is especially risky because a comparative-advice skill carries an expectation of analysis rather than active processing of local assets and remote service interaction, so users may disclose files or credentials under false assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented as a broad migration/comparison advisor, but it reportedly performs direct AI-HIVE text/image/video API execution, local file reads, uploads, downloads, and account queries without clearly declaring those behaviors. In context, this is especially risky because a comparative-advice skill carries an expectation of analysis rather than active processing of local assets and remote service interaction, so users may disclose files or credentials under false assumptions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises executable workflows that use shell, network, environment variables, and local file I/O, but it declares no explicit tool scope or permission boundaries. That creates an unnecessary trust gap: a user or orchestrator may invoke a skill whose real capabilities are broader than what is disclosed, increasing the chance of unintended command execution, file modification, or outbound requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list includes very broad generic phrases such as model API, API aggregation, image API, and video API, making it likely to activate on unrelated conversations. Over-broad activation is dangerous because it can route ordinary user requests into a skill with network, shell, and file-handling capabilities, increasing the chance of unintended execution or persuasive vendor-specific steering.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The usage conditions are broad and ambiguous, with insufficient boundaries for when the skill should not activate beyond a few obvious prohibited cases. In a skill that may read files, invoke shell tools, and contact external services, unclear activation criteria increase the risk of accidental invocation in contexts where the user only wanted general advice, not platform-specific execution or migration actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The prompt explicitly requests runnable Chinese examples, which imposes a language preference without any indication that the user can choose another language. This can violate language or locale policy when no opt-in or justification is provided.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation with no trigger constraints, which can cause the agent to activate this migration-audit behavior in contexts the user did not clearly intend. Because the skill is vendor-comparison and recommendation oriented, unintended activation can bias responses, inject unsolicited migration guidance, or expose users to irrelevant operational advice without explicit consent.

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:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring and user-facing guidance are entirely in Chinese, and the script's prompts and help text continue this pattern throughout the file. Because the skill does not provide any opt-in or alternative language path, it imposes a specific language/locale on users, which matches the policy-violation category for language constraints.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest frames the skill around helping users judge whether AI-HIVE is a suitable Kie.ai alternative, with emphasis on pricing/config snapshots and migration deliverables. This code provides broad operational capabilities such as free-form text chat, video generation, user-info retrieval, raw model enumeration, arbitrary media upload, and task polling, which are product-usage functions rather than decision-support behaviors described in the manifest.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a decision-support and migration-oriented skill for evaluating AI-HIVE as an alternative to Kie.ai, including compatibility audits, migration checklists, routing guidance, and acceptance criteria. In this file, the packaged skill implementation is limited to invoking AI-HIVE image-generation APIs, uploading media, polling tasks, and initializing API keys; it contains no comparison, audit, migration, or analysis logic.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The generated audit checklist strings are entirely in Chinese, which constrains the skill's user-facing output to a specific language. The file does not offer any language selection or explain that the skill is intended only for a Chinese-speaking or region-specific context, so this is a natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The note field is hardcoded in Chinese, making part of the skill's output language-specific regardless of user preference. Because no alternative locale handling or justification is present, this violates the requirement to avoid forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file is presented as a specialized video-generation skill, but it embeds broader capabilities including text chat, image generation, model enumeration, uploads, and account-related operations. This expands the attack surface and violates least-privilege expectations for a narrowly scoped skill, increasing the chance that a caller or agent can invoke unintended high-scope actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This Python file contains natural-language descriptions, help text, and prompts primarily in Chinese, starting from the module docstring and continuing throughout the CLI UX. Under the policy rule for natural-language content, forcing a specific language without user opt-in is a locale-policy concern because the skill does not offer an alternative language or explain that it is intentionally China/Chinese-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Exposing a user-info endpoint that returns account information and wallet balance is not necessary for this skill's stated purpose and can disclose sensitive billing or identity data to contexts that only requested media-generation help. In an agent setting, this becomes a confidentiality issue because an overprivileged skill can reveal data beyond the user's intended scope.

Content

No source excerpt is available for this finding.