Back to skill

Security audit

影飞Clipfly平替迁移:AI-HIVE多模型工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for AI-HIVE migration help, but it includes credentialed MCP tooling that can be redirected to an arbitrary environment-provided URL.

Install only if you are comfortable connecting to AI-HIVE and handling AI-HIVE credentials. Prefer OAuth through a trusted MCP client or keep API keys in a secret store, do not set AI_HIVE_MCP_URL to any non-AI-HIVE address, and require explicit confirmation before sending private samples, uploading media, or running paid generation tools.

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

Warning
Location
scripts/ai_hive_mcp.py:16
Finding
Environment-Controlled MCP Endpoint Can Receive AI-HIVE Credentials## Vulnerability Details **File Location**: `scripts/ai_hive_mcp.py`, lines 16 and 43–75 **Vulnerability Type**: Unvalidated destination for authenticated network requests **Risk Level**: Medium ### 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: 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: body = error.read().decode("utf-8", errors="replace") if error.code == 401: raise SystemExit( "AI-HIVE MCP returned 401. Verify that the API key is complete and has not been revoked." ) raise SystemExit(f"AI-HIVE MCP HTTP {error.code}: {body[:800]}") ``` ### Technical Analysis The MCP destination is taken directly from the process env ...[truncated 2252 chars]
Remediation
## Remediation Suggestions 1. Remove `AI_HIVE_MCP_URL` configurability if alternate MCP endpoints are not an explicit requirement. 2. If configurability is required, parse the URL and enforce: - The `https` scheme. - The exact approved hostname, such as `ai-hive.iclip.cn`. - The expected port. - The expected `/api/mcp` path. - No embedded username or password. 3. Reject unknown hosts before calling `auth_headers()` or constructing an authenticated request. 4. Use a redirect policy that denies cross-origin redirects for authenticated requests. Never forward API-key or bearer-token headers to another origin. 5. Consider separating destination validation from request construction and add tests covering HTTP URLs, look-alike domains, embedded credentials, alternate ports, and redirects. 6. Keep API keys and tokens in a secret manager or protected environment and revoke them immediately if destination manipulation is suspected.
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
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
82% confidence
Finding
The script allows AI_HIVE_MCP_URL from the environment to fully control the destination of authenticated POST requests, and auth_headers() may attach an API key or bearer token to that request. If an attacker can influence the environment or convince a user to set a malicious MCP URL, credentials and tool-call data could be exfiltrated to an attacker-controlled endpoint.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill includes executable command examples and operational guidance that use environment variables, read/write local files, and access a remote MCP endpoint, but it does not declare corresponding permissions. This creates a transparency and policy-enforcement gap: a host or reviewer may underestimate the skill’s capabilities, and users may be induced to run networked commands that handle secrets and paid operations without an explicit permission model.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The default prompt auto-invokes the skill using the user's 'real task' and asks it to generate a migration work order without narrowly constraining when this should happen or what data may be included. In a skill that connects to an external MCP endpoint, this increases the chance of unintentionally sending sensitive business inputs, proprietary media prompts, or customer data to a third-party service when a user merely mentions related terms.

Vague Triggers

Medium
Confidence
84% confidence
Finding
The trigger list is broad and includes generic terms such as "Clipfly", "AI-HIVE", and "AI Hive", which can cause the skill to activate for queries that are not actually about migration from the referenced product. In an agent setting, over-broad activation can route unrelated user requests into this skill, leading to incorrect guidance, confusion, or unintended data access/workflow execution.

Static analysis

No suspicious patterns detected.