Back to skill

Security audit

极简赛博动画视觉语言|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for an AI-HIVE animation workflow, but its helper script can send AI-HIVE credentials to an unvalidated override URL.

Review before installing. Prefer OAuth through the MCP client, avoid setting AI_HIVE_MCP_URL, use a dedicated revocable API key if needed, and confirm the endpoint is https://ai-hive.iclip.cn/api/mcp before running list-tools or call. Treat generation, upload, batch, sending, and publishing actions as potentially billable or sensitive.

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

Unrestricted MCP Endpoint Override Can Expose Authentication Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_hive_mcp.py, lines 19 and 46–74
Vulnerability Type: Unvalidated credential 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(
        "Missing credentials. OAuth users should complete login in their MCP "
        "client; this script requires AI_HIVE_API_KEY for tool calls, or run "
        "doctor only."
    )


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:
            result = parse_payload(
                response.read(),
                response.headers.get("content-type", ""),
            )
            return result, response.headers.get("mcp-session-id") or session_id

Technical Analysis

The MCP destination is read directly from the attacker-influenceable AI_HIVE_MCP_URL environment variable. The value is not parsed or validated before the client attaches either an AI_HIVE_ACCESS_TOKEN bearer credential or an AI_HIVE_API_KEY.

The implementation does not:

  • Require HTTPS.
  • Restrict the ...[truncated 2372 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove AI_HIVE_MCP_URL configurability if custom endpoints are not an explicit functional requirement.
  2. If endpoint overrides are required, parse the URL and enforce:
    • The https scheme.
    • An explicit hostname allowlist, normally only ai-hive.iclip.cn.
    • The expected port and MCP path.
    • No username, password, fragment, or ambiguous hostname encoding.
  3. Never attach AI-HIVE credentials to an endpoint outside the approved origin. Fail closed before constructing the request.
  4. Disable automatic redirects for authenticated requests, or manually validate every redirect target and strip credentials whenever the origin changes.
  5. Require explicit interactive confirmation for any approved non-default endpoint and clearly display the exact credential destination.
  6. Make doctor() inspect and validate the same endpoint used by post() rather than fixed metadata URLs that may not correspond to an override.
  7. Prefer short-lived, narrowly scoped OAuth tokens over long-lived API keys where the client supports OAuth.
  8. Add automated tests covering malicious hosts, plaintext HTTP URLs, embedded credentials, unexpected ports, deceptive hostname suffixes, and cross-origin redirects.
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 (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
91% 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 server and exfiltrate the API key or bearer token, making this a credential-leak/SSRF-style issue.

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 documented purpose is narrowly framed as an original-animation production workflow, but the referenced code behavior is a generic MCP client that can call arbitrary AI-HIVE tools, handle credentials, and perform remote connectivity functions beyond the declared use case. This mismatch is dangerous because users may grant trust and permissions based on the benign description while the implementation has materially broader authority, enabling unintended tool use, data exposure, or paid/remote actions outside user expectations.

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

The skill exposes operational capabilities implying environment access, file read/write, and network use, but does not declare an explicit tool scope or permission boundary. In a remote MCP-integrated workflow, this weakens least-privilege controls and makes it harder for users or platforms to understand and constrain what the skill may access, increasing the risk of unexpected data access or outbound actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger conditions are broad enough to match common requests about AI images, videos, short videos, games, or design, which can cause the skill to activate outside its supposed narrow purpose. Overbroad activation becomes more dangerous here because the skill is tied to external MCP/network actions and a broader-than-advertised backend capability set, increasing the chance of unnecessary credentialed tool access or workflow hijacking in unrelated conversations.

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, so the platform may auto-activate it in response to broad user intent matching. Because this skill connects to an external MCP service capable of content generation and potentially downstream paid operations, ambiguous activation increases the chance of unintended tool use, privacy exposure, or user confusion about when external services are being engaged.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains user-facing error messages, status text, and command descriptions in Chinese only, including runtime exceptions and CLI help strings. That imposes a specific language on users without opt-in or any documented locale constraint, which matches the natural-language policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest sets language: zh-CN, which indicates a fixed locale preference, but the file does not explicitly say the user can choose another language or opt in to Chinese-only interaction. Under the policy, forcing a specific language without user choice can be a natural-language policy concern unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.