Back to skill

Security audit

游戏Demo视频设计师|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed AI-HIVE video workflow, but it needs review because its helper can send API credentials to an environment-selected MCP endpoint and the remote tool scope is broad.

Review this before installing. Use the fixed AI-HIVE endpoint, prefer OAuth through the MCP client, avoid setting AI_HIVE_MCP_URL unless you fully trust the destination, and do not run paid or publishing tools without checking model, price, task count, and budget.

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:19
Finding

Unvalidated MCP Endpoint Override Can Expose Authentication Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_hive_mcp.py, lines 19 and 47–72
Vulnerability Type: Credential disclosure through an untrusted network destination
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 MCP destination can be overridden through the AI_HIVE_MCP_URL environment variable. The value is used without validating its scheme, hostname, port, or path. At the same time, post() unconditionally obtains authentication headers and attaches either an OAuth bearer token or an AI-HIVE API key to requests sent to that destination.

Consequently, control over the process environment or launch configuration can redirect authenticated requests to an attacker-controlled server. The code also does not explicitly require HTTPS, so an override using plaintext HTTP would expose credentials and request content in transit.

The network access itself is necessary for the Skill's declared remote AI-HIVE functionality. However, transmitting service credenti ...[truncated 1641 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the AI_HIVE_MCP_URL override if custom endpoints are not required.
  2. If endpoint customization is required, parse the URL and enforce:
    • The https scheme.
    • An explicit allowlist of trusted hostnames.
    • The expected port and MCP path.
    • No embedded user information or URL fragments.
  3. Refuse to attach Authorization or x-ai-hive-api-key headers unless the final destination exactly matches an approved origin.
  4. Prevent cross-origin credential forwarding after redirects, or disable redirects for authenticated MCP requests.
  5. Separate development endpoint support from production operation. Require an explicit development flag and disable real credentials for non-production destinations by default.
  6. Prefer a fixed constant for the production endpoint and fail closed when URL validation fails.
  7. Add automated tests covering malicious overrides, plaintext HTTP, unexpected ports, lookalike domains, embedded credentials, and cross-origin redirects.

A suitable validation pattern would compare the parsed scheme, normalized hostname, port, and path against a fixed allowlist before constructing any authenticated request.

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

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 posts authentication material from environment variables to MCP_URL, which is also controllable via AI_HIVE_MCP_URL. If that environment variable is set to an attacker-controlled endpoint, the helper will transmit the API key or bearer token in request headers, causing credential exfiltration to an untrusted 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 skill is presented as a narrow, domain-specific workflow for game demo video design, but the documented code paths expose generic AI-HIVE MCP connectivity, tool enumeration, and arbitrary remote tool invocation. This mismatch is dangerous because users and orchestrators may trust the skill as narrowly scoped while it can perform materially broader actions, including potentially billable or externally visible operations through MCP beyond the advertised planning workflow.

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 documents executable scripts and remote MCP access with network, environment variable, and local file capabilities, but it does not declare an explicit tool scope such as permissions or allowed-tools. That creates an overbroad execution surface where a host agent may expose more capabilities than the user expects, increasing the risk of unintended file access, secret handling, or remote actions if the skill is invoked in a permissive environment.

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: true without any visible trigger constraints, allowing the skill to be invoked based on broad contextual matching rather than an explicit user request. Because this skill can reach an external MCP service for image/video generation, unintended activation could cause unreviewed tool use, privacy leakage in prompts, or progression toward paid/content-generation workflows even if the description says payment or publishing should be separately confirmed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The entire skill is written as a Chinese-only workflow and does not indicate that users may choose another language or locale. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This Python file includes multiple natural-language error/help strings in Chinese only, such as the SSE parse error, missing-credential guidance, and billing confirmation message. Because the script does not offer a language or locale choice, it effectively forces a specific language on users, which matches the policy-violation criterion for locale/language constraints without opt-in.

Content

No source excerpt is available for this finding.