Back to skill

Security audit

凝视式长镜头与时空流动电影短片|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent AI-HIVE image/video workflow, but its helper script can send AI-HIVE credentials to an environment-overridden MCP URL and can invoke broad MCP tools, so it needs review before install.

Install only if you intend to connect your AI-HIVE account and are comfortable with an external MCP service for media generation. Prefer the fixed https://ai-hive.iclip.cn/api/mcp endpoint, do not set AI_HIVE_MCP_URL with real credentials, use scoped/revocable API keys or managed OAuth, and confirm model, price, quantity, upload, paid generation, batch, send, and publish actions before running them.

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

Credential Exfiltration Through a User-Controlled MCP Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_hive_mcp.py, lines 19 and 46–71
Vulnerability Type: Authentication credentials sent to an unrestricted, environment-controlled 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 is read from the AI_HIVE_MCP_URL environment variable without validating its scheme or hostname. The same process automatically reads AI_HIVE_API_KEY or AI_HIVE_ACCESS_TOKEN and includes that credential in every MCP POST request.

Consequently, a process capable of influencing the environment can redirect authenticated traffic away from the declared AI-HIVE service. There is no requirement that the destination use HTTPS and no allowlist restricting authentication headers to ai-hive.iclip.cn.

Although sending credentials to the legitimate AI-HIVE endpoint is necessary for authenticated MCP access, allowing the destination to be changed independently of the credentials exceeds the minimum priv ...[truncated 1535 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove AI_HIVE_MCP_URL configurability from production use and use the fixed declared endpoint: https://ai-hive.iclip.cn/api/mcp.
  2. If custom endpoints are necessary for development, parse the URL and enforce:
    • HTTPS only;
    • an explicit hostname allowlist;
    • the expected port;
    • the expected MCP path;
    • rejection of embedded credentials and unexpected redirects.
  3. Attach Authorization and x-ai-hive-api-key headers only after confirming that the final request destination is an approved AI-HIVE origin.
  4. Disable automatic redirects for authenticated requests, or revalidate every redirect target and strip credentials whenever the origin changes.
  5. Require a separate, explicit development-only flag before using a custom endpoint. Refuse to combine production credentials with an unapproved endpoint.
  6. Prefer OAuth tokens with narrowly scoped permissions, short lifetimes, revocation support, and server-side spending limits.
  7. Add automated tests verifying that HTTP URLs, lookalike domains, alternate ports, user-info URLs, and cross-origin redirects cannot receive credentials.
  8. Document immediate credential revocation and rotation procedures for suspected exposure.
Vulnerability Patterns
  • 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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

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

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

The skill presents itself as a narrowly scoped creative workflow, but the detected behavior indicates a generic MCP/OAuth connection and arbitrary tool-calling wrapper. That mismatch is dangerous because users may consent to a benign-seeming film-planning skill while actually enabling broad remote tool access, which can be abused for unintended network operations, data access, or cost-incurring actions.

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 exposes operational capabilities involving environment access, file read/write, and network use without declaring any explicit tool scope or allowlist. In a skill that also documents remote MCP connectivity and local script execution, this increases the risk of over-broad capability use, accidental data exposure, and invocation of higher-risk actions beyond the user’s expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The user-facing name, description, and default prompt are entirely in Chinese, which effectively constrains the skill to a specific language without indicating a user choice or opt-in mechanism. This may violate language or locale policy where skills are expected to accommodate user preference unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill enables implicit invocation without any visible trigger constraints, allowing the platform to auto-select it based on broad user intent. Because this skill connects to an external MCP endpoint capable of content generation and potentially paid operations, accidental or overly broad invocation increases the chance of unintended tool use, privacy exposure, or workflow steering without clear user consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, and there is no indication that the skill is region-specific or that users may opt into another language. Under the language/locale policy rule, forcing a specific language without 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
96% confidence
Finding

This Python file contains multiple user-facing error/help strings in Chinese, beginning at L040, with no indication that the skill is intentionally region-specific or that users can opt into another language. That creates a natural-language locale policy issue because the skill effectively forces one language for interaction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script exposes a generic 'tools/call' interface for arbitrary MCP tools, while the skill description presents a much narrower cinema-planning and generation workflow. If the remote MCP endpoint offers broader capabilities than the manifest suggests, this helper can be used to invoke them with the operator's credentials, expanding the effective privilege and action surface beyond expected user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest sets metadata.language: zh-CN, and the surrounding skill content is entirely Chinese, which indicates a fixed locale expectation. The file does not explicitly state that users may choose another language or opt into Chinese output, so this can conflict with language-choice policy requirements.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest frames the skill as a creative assistant for film-style ideation and generation, with OAuth handled by the MCP client and paid actions separately confirmed. This script additionally accepts AI_HIVE_ACCESS_TOKEN directly from the environment and uses it for authenticated API calls, which is an account-level credential handling capability not reflected in that purpose statement.

Content

No source excerpt is available for this finding.