Back to skill

Security audit

开放世界都市任务感游戏预告|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

This AI-HIVE creative workflow is mostly disclosed, but its helper can send credentials to an environment-controlled MCP URL and can forward arbitrary remote tool calls.

Review before installing. Use OAuth through a trusted MCP client where possible, avoid setting `AI_HIVE_ACCESS_TOKEN` on the command line, do not set `AI_HIVE_MCP_URL` unless you fully trust the destination, and confirm exact model, price, and tool name before any generation or upload call.

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

Environment-Controlled MCP Endpoint Can Expose Authentication Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_hive_mcp.py, lines 19 and 45–74
Vulnerability Type: Arbitrary authenticated endpoint caused by an unrestricted environment-variable override
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",
    )
    try:
        with urllib.request.urlopen(request, timeout=60) as response:

Technical Analysis

The script permits AI_HIVE_MCP_URL to replace the declared AI-HIVE service URL without validating the scheme, hostname, port, or final redirect destination. The same request code unconditionally adds either the AI_HIVE_API_KEY value or an OAuth bearer token to the outbound request.

Consequently, whoever controls the process environment can redirect authenticated requests to an arbitrary endpoint. The code does not require HTTPS, restrict the destination to ai-hive.iclip.cn, or prevent cross-origin redirects. This behavior exceeds the minimum privileges required for ...[truncated 1468 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the AI_HIVE_MCP_URL override if alternate endpoints are not required:

    python
    MCP_URL = "https://ai-hive.iclip.cn/api/mcp"
    
  2. If configurability is necessary, validate the URL before adding credentials:

    • Require the https scheme.
    • Allowlist the exact hostname ai-hive.iclip.cn.
    • Require the expected /api/mcp path.
    • Reject user information embedded in the URL.
    • Reject unexpected ports.
    • Normalize and validate the parsed hostname rather than using substring checks.
  3. Prevent credential forwarding across redirects. Disable automatic redirects for authenticated requests or validate every redirect target before following it.

  4. Separate destination validation from request construction and only call auth_headers() after the destination has passed validation.

  5. Require an explicit command-line confirmation for any non-production endpoint and do not send production credentials to test or custom endpoints.

  6. Add automated tests covering HTTP URLs, lookalike domains, subdomain tricks, embedded credentials, nonstandard ports, and cross-origin redirects.

  7. If exploitation is suspected, immediately revoke the exposed API key or OAuth authorization, clear affected environment variables, and review AI-HIVE task and billing history.

Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

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

The script allows AI_HIVE_MCP_URL to be overridden from the environment and then sends authentication headers from AI_HIVE_API_KEY or AI_HIVE_ACCESS_TOKEN to that URL. If a user runs this helper in an environment where the MCP URL is maliciously changed, the tool can exfiltrate API keys or bearer tokens to an attacker-controlled 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
96% confidence
Finding

The documented purpose is a narrow creative workflow, but the referenced behavior appears to support general MCP/OAuth diagnosis and arbitrary remote tool invocation, which is materially broader than what the user is led to expect. That mismatch is dangerous because users may authorize credentials or execution under the assumption of a constrained content-generation skill, while the implementation can interact with remote infrastructure and potentially access or trigger unrelated capabilities.

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 code/network/file/env capabilities without declaring an explicit tool scope or allowlist, which weakens least-privilege controls and makes it harder for users or the host to understand what the skill may access. In this context, the same document also instructs use of remote MCP endpoints, API keys, local scripts, file output, and network calls, so an undeclared capability surface could enable broader-than-expected data access or remote actions if the runtime auto-grants tools.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger language is broad enough to match many generic creative requests, increasing the chance the skill is invoked outside its intended niche. In a skill that also references external connectivity, model routing, paid generation, and credentialed MCP usage, overbroad triggering can expand exposure by pulling users into a workflow with networked actions and billing implications when they did not specifically request it.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The search tags include many generic discovery terms such as AI image/video, editing, design, and short video, which can cause overly broad routing and unintended invocation. Because this skill also guides users toward remote MCP configuration and model/tool querying, excessive discoverability increases the chance of unnecessary credential handling, external calls, or paid workflow escalation in contexts that do not require this skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill enables allow_implicit_invocation without any visible trigger constraints, so the agent may invoke this skill in situations the user did not clearly intend. Because the skill connects to an external MCP service capable of image/video generation and related operations, unintended activation could cause unnecessary external data sharing, workflow execution, or confusion around actions that should require explicit user consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file presents all instructions and operational guidance exclusively in Chinese, and there is no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy rule, forcing a specific language without user opt-in 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
95% confidence
Finding

This code emits user-facing error text in Chinese, and similar Chinese-only strings appear throughout the script. The file does not offer a language or locale choice, so it imposes a specific language without user opt-in, which matches the policy-violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The argparse description and subcommand help strings are presented only in Chinese. Because the script does not provide an alternate locale or explicit opt-in for Chinese, it enforces a specific language for core user interaction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest describes a skill oriented around querying real-time models/pricing and then producing animation or game-trailer related content with confirmation for paid generation, batching, sending, and publishing. In code, the call subcommand accepts any tool name and forwards it to tools/call, with only a small read-only allowlist and a generic paid-confirmation gate, so the script can operate beyond the specifically described workflow if the remote MCP exposes broader tools.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The embedded skill title and category are presented only in Chinese, indicating a fixed language/locale choice in the skill's user-facing metadata. There is no accompanying language selection, opt-in, or justification that this skill is region-specific, so this may violate the policy against forcing a specific language without user choice.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The top-level docstring emphasizes diagnostics, public OAuth metadata inspection, and listing or calling tools when credentials are present, which understates the operational impact of arbitrary remote MCP tool execution. Later code implements full authenticated tools/call requests that may trigger billable or state-changing remote actions, making the documentation materially less restrictive than actual behavior.

Content

No source excerpt is available for this finding.