Back to skill

Security audit

新派武侠与民俗奇幻动作短片|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent AI-HIVE video-generation workflow, but its helper script can send stored AI-HIVE credentials to an arbitrary endpoint chosen by an environment variable.

Review before installing. The workflow itself is disclosed and asks for confirmation before paid generation or publishing, but users should not run the included helper with AI_HIVE_API_KEY or AI_HIVE_ACCESS_TOKEN unless they are sure AI_HIVE_MCP_URL is unset or points only to the official AI-HIVE MCP endpoint. Prefer OAuth through a trusted MCP client, and revoke any AI-HIVE key that 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

Error
Location
scripts/ai_hive_mcp.py:17
Finding
Arbitrary MCP Endpoint Override Can Exfiltrate API Credentials## Vulnerability Details **File Location**: `scripts/ai_hive_mcp.py`, lines 17 and 51-74 **Vulnerability Type**: Credential exfiltration through an unvalidated 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} ``` ```python 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 destination used for authenticated MCP requests is taken directly from the `AI_HIVE_MCP_URL` environment variable. The code does not validate the URL scheme, hostname, port, or origin before attaching either an AI-HIVE bearer token or API key. Consequently, anyone able to influence the process environment or launch configuration can redirect authenticated requests from the intended AI-HIVE service to an attacker-controlled endpoint. This behavior is unnecessary for the Skill's declared operation because its documented MCP endpo ...[truncated 1737 chars]
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 endpoint configurability is required, parse and validate the destination before constructing the request: - Require HTTPS. - Require the exact approved hostname `ai-hive.iclip.cn`. - Require the expected path `/api/mcp`. - Reject embedded usernames or passwords. - Reject fragments and unexpected query parameters. - Reject nonstandard ports unless explicitly approved. - Compare normalized hostnames rather than relying on string prefixes. 3. Maintain an explicit destination allowlist and fail closed when validation fails. 4. Disable automatic redirects for authenticated requests, or validate every redirect destination before forwarding credentials. Never forward authorization headers across origins. 5. Separate endpoint selection from credential attachment. Only attach `Authorization` or `x-ai-hive-api-key` after confirming that the final request origin is trusted. 6. Prefer short-lived, narrowly scoped OAuth tokens over long-lived API keys where supported. 7. Add automated tests confirming that credentials are not sent when: - The endpoint uses HTTP. - The hostname differs from the approved service. - A deceptive hostname such as `ai-hive.iclip.cn.attacker.example` is supplied. - The URL contains user information or an unexpected port. - The server returns a cross-origin redirect. 8. Document credential rotation procedures and instruct affected users to revoke any key or token that may have been used with an untrusted endpoint.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (3)

Tainted flow: 'request' from os.environ.get (line 67, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
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:
Confidence
91% confidence
Finding
The script allows AI_HIVE_MCP_URL from the environment to fully control the POST destination while also attaching Authorization or x-ai-hive-api-key headers from environment credentials. If an attacker can influence the environment or wrapper configuration, they can redirect requests to an arbitrary server and exfiltrate API keys or bearer tokens.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The script claims to create a local, non-billable work order, but it embeds paid-capable tools such as upload, image generation, and video generation in the generated plan. Even though it sets a plan-only status and confirmation flags, downstream agents may rely on the candidate_tools list or deliverables and proceed into billable or externally sending actions based on this artifact, creating a policy/authorization gap.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill enables implicit invocation for an MCP-connected agent without defining trigger constraints, exclusions, or tighter confirmation boundaries. This can cause the agent to be auto-selected in loosely related conversations and reach an external generation service unexpectedly, increasing the chance of unreviewed data disclosure, unintended tool use, or user confusion about when external services are being engaged.

Static analysis

No suspicious patterns detected.