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 can send AI-HIVE credentials to an environment-selected MCP URL and exposes broader tool-calling than the stated workflow needs.

Review before installing. Prefer the OAuth/client MCP configuration that uses https://ai-hive.iclip.cn/api/mcp directly. Do not set AI_HIVE_MCP_URL unless you fully trust the endpoint, keep API keys in a secret store, and require explicit confirmation before uploads, paid generation, batch work, sending, or publishing.

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## Vulnerability Details **File Location**: `scripts/ai_hive_mcp.py`, lines 19–76 **Vulnerability Type**: Unvalidated network destination for authenticated requests **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 MCP destination can be overridden through the `AI_HIVE_MCP_URL` environment variable without validation of its scheme, hostname, port, or path. The `post()` function then unconditionally attaches either the `AI_HIVE_ACCESS_TOKEN` bearer token or the `AI_HIVE_API_KEY` to requests sent to that destination. Consequently, an attacker who can influence the process environment or launch configuration can redirect authenticated requests away from the documented AI-HIVE endpoint. The implementation also does not require HTTPS, so an o ...[truncated 1974 chars]
Remediation
## Remediation Suggestions 1. Remove the `AI_HIVE_MCP_URL` override if custom endpoints are not required, and use the fixed documented endpoint: ```python MCP_URL = "https://ai-hive.iclip.cn/api/mcp" ``` 2. If endpoint configurability is required, validate the parsed URL before attaching credentials: - Require the `https` scheme. - Allowlist the exact hostname `ai-hive.iclip.cn`. - Require the expected `/api/mcp` path. - Reject embedded user information, unexpected ports, fragments, and malformed URLs. 3. Disable automatic redirects or verify that every redirect remains on the approved HTTPS origin before forwarding authentication headers. 4. Separate development and production behavior. Custom development endpoints should require an explicit development flag and must not receive production API keys or access tokens. 5. Apply least privilege to credentials: - Prefer OAuth with narrowly scoped, revocable tokens. - Use separate credentials for development and production. - Rotate credentials immediately if endpoint redirection or disclosure is suspected. 6. Add automated tests confirming that credentials are never sent when: - The URL uses plaintext HTTP. - The hostname differs from the approved service. - The path or port is unexpected. - A redirect targets another origin.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (4)

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
87% confidence
Finding
The script sends authenticated requests, including API keys or bearer tokens, to MCP_URL, which is taken from the AI_HIVE_MCP_URL environment variable without validation. If an attacker can influence the environment, they can redirect requests to an attacker-controlled endpoint and capture credentials or tool-call payloads, making this an environment-driven credential exfiltration risk.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill advertises and documents capabilities that use environment variables, local file read/write, and network access to interact with a remote MCP endpoint, but it does not declare corresponding permissions. This creates a transparency and consent gap: a user or host may invoke a skill believing it is narrowly scoped to animation planning while it can access secrets, write files, and reach external services.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The described purpose is a specific original-animation workflow, but the documented behavior includes generic MCP connectivity, arbitrary tool listing/calling, OAuth/API-key based remote access, and local file generation. That broader operational surface can be abused to perform actions outside the user’s expected intent, increasing the risk of unauthorized external actions, misuse of credentials, and invocation of non-read-only tools.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The skill enables implicit invocation for a capability that can connect to an external MCP service and initiate image/video generation workflows. Even though the prompt says not to auto-pay, batch, or publish, broad implicit activation can cause the agent to invoke this skill based on loose user intent, increasing the chance of unintended third-party data disclosure, unreviewed external calls, or users being steered into a sensitive generation workflow without clear consent.

Static analysis

No suspicious patterns detected.