Back to skill

Security audit

群像出场动画|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches an AI-HIVE animation workflow, but its helper script can send AI-HIVE credentials to an environment-selected server.

Install only if you intend to use AI-HIVE and are comfortable sending prompts, uploaded assets, and generation metadata to that service. Prefer OAuth or a client secret store, never paste tokens into chats or logs, and do not run the helper with AI_HIVE_MCP_URL set unless you have verified it is the official AI-HIVE HTTPS endpoint. Revoke any AI-HIVE API key if it may have been used with an untrusted endpoint.

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

Warning
Location
scripts/ai_hive_mcp.py:19
Finding

Environment-Controlled MCP Endpoint Can Receive AI-HIVE Credentials and Tool Data

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_hive_mcp.py, lines 19 and 47–70
Vulnerability Type: Unrestricted authenticated endpoint override
Risk Level: Medium

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 MCP destination is read from the AI_HIVE_MCP_URL environment variable, but the value is not validated before an API key or bearer token is attached to the request. The implementation does not require HTTPS, enforce the documented ai-hive.iclip.cn host and /api/mcp path, or otherwise establish that the recipient is an authorized AI-HIVE endpoint.

Consequently, an attacker who can influence the process environment or launcher configuration can redirect authenticated MCP requests to an arbitrary server. The request body can also contain MCP initialization data, tool names, prompts, task identifiers, asset references, and other tool arguments.

Remote networking itself is necessary for the Skill’s declared MCP functionality. However, sending credentials to an ...[truncated 1605 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove AI_HIVE_MCP_URL configurability if custom endpoints are not required.
  2. If configurability is necessary, parse the URL and enforce:
    • The https scheme.
    • The exact approved hostname, such as ai-hive.iclip.cn.
    • The expected port.
    • The expected /api/mcp path.
    • No embedded username or password.
  3. Refuse to attach credentials unless the destination passes the allowlist.
  4. Add explicit redirect handling and reject redirects to a different origin before forwarding authorization headers.
  5. Separate endpoint selection from credential construction so credentials cannot be generated for an untrusted origin.
  6. Consider certificate pinning or an equivalent stronger trust policy where operationally appropriate.
  7. Add automated tests covering HTTP URLs, look-alike domains, user-info URL tricks, unexpected ports, alternate paths, and cross-origin redirects.
  8. Document that endpoint overrides must not be accepted from untrusted project-level environment files or launcher configurations.

A suitable validation pattern is:

python
from urllib.parse import urlparse

EXPECTED_HOST = "ai-hive.iclip.cn"
EXPECTED_PATH = "/api/mcp"

def validated_mcp_url(raw_url: str) -> str:
    parsed = urlparse(raw_url)
    if (
        parsed.scheme != "https"
        or parsed.hostname != EXPECTED_HOST
        or parsed.port not in (None, 443)
        or parsed.path != EXPECTED_PATH
        or parsed.params
        or parsed.query
        or parsed.fragment
        or parsed.username
        or parsed.password
    ):
        raise SystemExit("Refusing to send credentials to an unapproved MCP endpoint.")
    return raw_url

Credential headers should only be added after this validation succeeds.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (10)

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 also attaching credentials from AI_HIVE_API_KEY or AI_HIVE_ACCESS_TOKEN. If an attacker can influence the environment, they can redirect authenticated requests to an arbitrary endpoint and capture the API key or bearer token, causing credential exfiltration and unauthorized API use.

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 declared purpose is a narrowly scoped animation workflow, but the referenced operational behavior is a generic MCP diagnostic/authentication/tool-calling surface that can invoke arbitrary MCP tools once credentials are present. This mismatch is dangerous because users and orchestrators may trust the narrow description while the implementation has materially broader capabilities, creating confused-deputy risk, unintended external actions, data exposure, or paid operations outside the promised confirmation gates.

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

The skill advertises executable scripts and MCP/network usage but does not declare any explicit tool scope or allowed-tools boundary. That makes the effective capability set broader and less auditable than the manifest suggests, increasing the chance that a host agent may grant file, environment, or network access unnecessarily and enabling misuse if the skill or linked scripts are invoked in an over-privileged runtime.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest declares an external HTTP MCP for text, image, and video generation but does not warn users that prompts, uploaded assets, or potentially sensitive creative material may be transmitted to a remote provider. Because this skill targets original character assets and media generation, users may submit proprietary or unpublished content, making undisclosed third-party transmission materially risky.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill enables implicit invocation with no visible trigger constraints, so it may activate in response to broad user requests and route content to the external AI-HIVE MCP unexpectedly. In this context, the skill can generate media and interact with a remote service, which increases the chance of unanticipated tool use, data disclosure, or user confusion about when the skill is being engaged.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains multiple user-facing error/help strings in Chinese, such as the exception text in parse_payload, credential guidance, CLI description/help text, and confirmation/error messages. Because the file provides no opt-in, locale selection, or justification that the skill is China/Chinese-only, it violates the policy against forcing a specific language without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all instructions and operational guidance exclusively in Chinese, with no indication that users may choose another language or locale. Under the policy for natural-language violations, forcing a specific language without user opt-in is a reportable issue.

Content

No source excerpt is available for this finding.