Back to skill

Security audit

Fotor懒设计平替迁移:AI-HIVE多模型工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for AI-HIVE migration trials, but its helper can send AI-HIVE credentials to an environment-controlled MCP URL that is not disclosed to users.

Review this skill before installing. Use OAuth or a tightly scoped AI-HIVE API key, do not set AI_HIVE_MCP_URL unless you fully trust the endpoint, revoke any key used with an unexpected endpoint, and require explicit confirmation before paid, batch, upload, or publishing actions.

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
Credential Disclosure Through a User-Controlled MCP Endpoint<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ai_hive_mcp.py`, lines 17 and 47-70 **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} 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 taken directly from the `AI_HIVE_MCP_URL` environment variable. The value is not validated for its scheme, hostname, port, embedded credentials, or relationship to the expected AI-HIVE origin. At the same time, `auth_headers()` retrieves an API key or OAuth access token and `post()` unconditionally attaches that credential to requests sent to `MCP_URL`. Consequently, anyone able to influence the process environment or launch configuration can redirect authenticated requests to an arbitrary server. Supporting a configurable destination is not necessary for the Skill's declared operation against `https://ai-hive.iclip.cn/api/mcp`. This configuration therefore exceeds the minimum flexibility required and creates a c ...[truncated 2041 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Remove unnecessary endpoint configurability.** Use a fixed constant when the helper is intended exclusively for AI-HIVE: ```python MCP_URL = "https://ai-hive.iclip.cn/api/mcp" ``` 2. **If endpoint configuration must remain, validate it before loading or attaching credentials.** Require: - Scheme: exactly `https`. - Hostname: exactly `ai-hive.iclip.cn`. - Path: exactly `/api/mcp`. - No embedded username or password. - No fragment or unexpected port. 3. **Bind credentials to an approved origin.** Do not call `auth_headers()` unless the validated request origin matches the origin for which the credential was issued. 4. **Control redirects.** Reject redirects to a different origin and ensure authorization or API-key headers are never forwarded across origins. 5. **Fail closed.** If validation fails, terminate before constructing or sending an authenticated request. Do not silently fall back to the supplied URL. 6. **Separate custom-server credentials.** If arbitrary MCP servers are an intentional feature, require distinct credentials configured for each approved origin rather than reusing `AI_HIVE_API_KEY` or `AI_HIVE_ACCESS_TOKEN`. 7. **Add automated security tests.** Verify that HTTP URLs, lookalike domains, subdomains, embedded credentials, alternate ports, and cross-origin redirects are rejected before any sensitive header is transmitted. 8. **Document credential response procedures.** Users who may have executed the helper with an untrusted `AI_HIVE_MCP_URL` should revoke and rotate the affected API key or OAuth authorization and review account activity. ]]>
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
82% confidence
Finding
The script reads API credentials from environment variables and then sends authenticated requests to MCP_URL, which is also environment-controlled. In an untrusted execution environment, an attacker who can set AI_HIVE_MCP_URL could redirect requests and capture the x-ai-hive-api-key or bearer token, causing credential exfiltration to an attacker-controlled server.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill instructs users to run local scripts, read/write files, access environment variables for API keys, and make network calls to a remote MCP endpoint, but it declares no permissions. This mismatch reduces transparency and can bypass platform trust expectations, increasing the risk of unintended secret exposure, local file access, or unreviewed outbound requests if the skill is executed in an automated environment.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The CLI description explicitly says the script does not call remote or paid tools, but the generated plan instructs users to query AI-HIVE for live tools, models, pricing, and limits. Even if this script itself only writes JSON, that mismatch can mislead downstream agents or operators into approving or executing a workflow under false assumptions about network access, cost exposure, and external data handling.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The skill enables implicit invocation without any visible trigger constraints, so the agent may activate this skill for loosely related user requests. Because the skill can reach an external MCP endpoint, unintended invocation can cause unnecessary data exposure to a third-party service or steer users into a workflow they did not explicitly request.

Static analysis

No suspicious patterns detected.