Back to skill

Security audit

低机位冷蓝与橙色火光科幻影像|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed AI-HIVE creative workflow, but its helper script can send API credentials to an arbitrary environment-selected MCP URL.

Install only if you trust AI-HIVE and understand this is a Chinese-localized workflow that can use your AI-HIVE credentials for remote MCP calls. Do not set AI_HIVE_MCP_URL to any non-AI-HIVE address, prefer OAuth or a tightly scoped/revocable API key, and confirm model, price, batch, upload, send, and publish actions before running generation commands.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ai_hive_mcp.py:17
Finding

Credential Disclosure Through an Unrestricted MCP Endpoint Override

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_hive_mcp.py, lines 17 and 48–69
Vulnerability Type: Credential exfiltration through an attacker-controlled network endpoint
Risk Level: High

Vulnerable Code

python
MCP_URL = os.environ.get("AI_HIVE_MCP_URL", "https://ai-hive.iclip.cn/api/mcp")
python
def auth_headers() -> dict[str, str]:
    key = os.environ.get("AI_HIVE_API_KEY", "").strip()
    token = os.environ.get("AI_HIVE_ACCESS_TOKEN", "").strip()
    if token:
        return {"authorization": f"Bearer {token}"}
    if key:
        return {"x-ai-hive-api-key": key}
    raise SystemExit(
        "缺少凭据。OAuth 用户请在 MCP 客户端中完成登录;本脚本调用工具时需通过环境变量提供 "
        "AI_HIVE_API_KEY,或仅运行 doctor。"
    )


def post(payload: dict, session_id: str | None = None) -> tuple[dict, str | None]:
    headers = {
        "content-type": "application/json",
        "accept": "application/json, text/event-stream",
        **auth_headers(),
    }
    if session_id:
        headers["mcp-session-id"] = session_id
    request = urllib.request.Request(
        MCP_URL,
        data=json.dumps(payload, ensure_ascii=False).encode("utf-8"),
        headers=headers,
        method="POST",
    )

Technical Analysis

The authenticated request destination is read from the AI_HIVE_MCP_URL environment variable without validating its scheme, hostname, port, or path. The same request automatically includes either the bearer token from AI_HIVE_ACCESS_TOKEN or the API key from AI_HIVE_API_KEY.

Consequently, any party capable of influencing the process environment or launch configuration can redirect authenticated requests away from the documented AI-HIVE service. The override may point to an attacker-controlled HTTP or HTTPS endpoint, causing the secret to be transmitted in the Authorization or x-ai-hive-api-key header.

Endpoint configurability is not required by the declared ...[truncated 1931 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the AI_HIVE_MCP_URL override for normal authenticated operation and pin the destination to: https://ai-hive.iclip.cn/api/mcp.

  2. If endpoint configurability is operationally necessary, parse and validate the URL before reading or attaching any credential. Require all of the following:

    • Scheme exactly https.
    • Hostname exactly ai-hive.iclip.cn.
    • Default HTTPS port only.
    • Path exactly /api/mcp.
    • No embedded username or password.
    • No unapproved query string or fragment.
  3. Disable automatic cross-origin redirects for authenticated requests. If redirects must be supported, validate every redirect target against the same origin allowlist before forwarding credentials.

  4. Separate development support from production operation. Custom endpoints should require an explicit unsafe-development flag and isolated test credentials that cannot invoke production or paid tools.

  5. Scope credentials server-side to the minimum required tools and operations. Prefer short-lived OAuth tokens over long-lived API keys, and separate read-only credentials from credentials capable of paid generation.

  6. Add automated tests confirming that credentials are never sent when:

    • The URL uses plaintext HTTP.
    • The hostname differs from ai-hive.iclip.cn.
    • The port or path is changed.
    • A same-origin endpoint redirects to a different origin.
  7. Document immediate key revocation and token invalidation procedures for users who may have executed the client with an untrusted endpoint override.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (18)

Tainted flow: 'request' from os.environ.get (line 67, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/ai_hive_mcp.py (reported line 28)May include surrounding context.

python
def fetch_json(url: str) -> dict:
    request = urllib.request.Request(url, headers={"accept": "application/json"})
    with urllib.request.urlopen(request, timeout=20) as response:
        return json.loads(response.read().decode("utf-8"))

Tainted flow: 'request' from os.environ.get (line 67, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The script allows AI_HIVE_MCP_URL from the environment to control the POST destination while automatically attaching API credentials from environment variables. If an attacker can influence the runtime environment or convince a user to use an untrusted MCP URL, the tool can exfiltrate the API key or bearer token to an arbitrary server.

Content

Scanner excerpt · scripts/ai_hive_mcp.py (reported line 74)May include surrounding context.

python
method="POST",
    )
    try:
        with urllib.request.urlopen(request, timeout=60) as response:
            result = parse_payload(response.read(), response.headers.get("content-type", ""))
            return result, response.headers.get("mcp-session-id") or session_id
    except urllib.error.HTTPError as error:

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose is a narrow creative workflow, but the referenced behavior is effectively a generic MCP connector and arbitrary tool caller. That mismatch is dangerous because users or orchestrators may grant trust and trigger the skill under the assumption of limited, domain-specific behavior, while the actual implementation can invoke broader remote capabilities, increasing the risk of unintended actions, data exposure, or permission misuse.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/mcp-binding.md (reported line 63)May include surrounding context.

md
## Codex、Claude 与 ChatGPT

优先使用各客户端的远程 MCP/连接器界面;若支持 JSON 配置,使用 OAuth 最小配置。客户端必须支持 Streamable HTTP、OAuth 2.1、PKCE 和动态客户端注册。若出现 `unauthorized_client`,保留脱敏错误和客户端版本,通过 AI-HIVE 登录后的客服渠道反馈,不要把 access token 粘贴到聊天中。

## Gemini 与支持 Header 的客户端

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/mcp-binding.md (reported line 102)May include surrounding context.

md
## Codex、Claude 与 ChatGPT

优先使用各客户端的远程 MCP/连接器界面;若支持 JSON 配置,使用 OAuth 最小配置。客户端必须支持 Streamable HTTP、OAuth 2.1、PKCE 和动态客户端注册。若出现 `unauthorized_client`,保留脱敏错误和客户端版本,通过 AI-HIVE 登录后的客服渠道反馈,不要把 access token 粘贴到聊天中。

## Gemini 与支持 Header 的客户端

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises networked MCP usage, local scripts, environment-variable secrets, and file read/write examples, but it does not declare an explicit tool allowlist or permission scope. In a skill ecosystem, undeclared capabilities increase the chance that a broadly-triggered skill can access files, environment data, or remote endpoints beyond what users expect, especially when the documentation includes generic tool-calling patterns.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger text includes broad search intents such as AI images, AI video, short-video production, and master-aesthetic queries, which can overlap with many ordinary creative requests. Overbroad activation becomes more dangerous here because the skill also references networked MCP access and generic tool-calling behavior, so accidental invocation could expand the operational surface unexpectedly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The display name, description, and default prompt are entirely in Chinese, and the file provides no indication that users can choose another language or opt in to this locale. That can violate language or locale policy where skills must not force a specific language without user choice.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest sets allow_implicit_invocation to true without any narrowing conditions, so the skill can be auto-selected in broader situations than the user may expect. Because this skill connects to an external MCP service for image/video generation workflows, overly broad invocation increases the chance of unintended tool use, unexpected data disclosure to the third-party endpoint, or user confusion about when the skill becomes active.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document presents all operational instructions in Chinese and does not indicate that the user can choose another language or that the skill is limited to a Chinese-language context. 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.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The only local safeguard is a generic --confirm-paid check for non-read-only tools, but the manifest claims separate confirmation is required for paid generation, batch execution, sending, and public release. As written, a single confirmation gate does not enforce those distinct consent boundaries and may allow sensitive or externally visible operations with insufficient user approval.

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 emits Chinese-only error text in user-visible output, which imposes a specific language on users without opt-in. The same pattern appears throughout the CLI, indicating a language policy issue rather than an incidental internal string.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script's primary credential error path is Chinese-only, so users who do not read Chinese may be unable to understand required safety guidance. Because the tool does not offer language selection or justify a Chinese-only scope, this is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This authentication failure message contains important operational guidance but is only available in Chinese. Critical user-facing instructions should not force a locale unless the tool explicitly documents and justifies that constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The diagnostic output includes a Chinese-only 'next' instruction shown directly to users. This enforces a specific language in a general-purpose tool with no visible language-selection mechanism.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Multiple user-facing parser descriptions, validation errors, and confirmation messages are written only in Chinese. Taken together, these strings make the CLI effectively Chinese-only without documenting a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The CLI can invoke any MCP tool name provided by the user, while the skill description scopes behavior to cinema-planning and says certain sensitive actions should require separate confirmation. If the remote MCP exposes broader capabilities, this script becomes a generic privileged tool runner that may trigger unintended actions outside the declared use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

L006 将 metadata.language 设为 zh-CN,但文档中未见提供语言选择、用户 opt-in,或说明该语言限制为何是必要的区域合规要求。按自然语言策略要求,强制单一语言而不给用户选择可能构成语言/locale 政策问题。

Content

No source excerpt is available for this finding.