Back to skill

Security audit

达芬奇DaVinci Resolve平替迁移:AI-HIVE多模型工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly describes a legitimate AI-HIVE migration workflow, but its helper script can send AI-HIVE credentials to an environment-overridden URL.

Review before installing. Prefer OAuth through the client, use a scoped and revocable AI-HIVE credential, do not set AI_HIVE_MCP_URL, and only run the helper after confirming it will contact https://ai-hive.iclip.cn/api/mcp. Paid generation remains user-confirmed, but the helper should be hardened by removing or validating the endpoint override before routine use.

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-overridable MCP endpoint can disclose AI-HIVE credentials## Vulnerability Details **File Location**: `scripts/ai_hive_mcp.py`, lines 19 and 47–74 **Vulnerability Type**: Arbitrary authenticated 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", ) 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 from the `AI_HIVE_MCP_URL` environment variable without validating its scheme, hostname, port, or path. The `post()` function then unconditionally adds either the `AI_HIVE_ACCESS_TOKEN` bearer token or the `AI_HIVE_API_KEY` header to requests sent to that destination. Consequently, an untrusted process launcher, shell configuration, CI environment, wrapper script, or other actor capable of influencing the process environment can redirect authenticated requests away from the documented AI-HIV ...[truncated 2282 chars]
Remediation
## Remediation Suggestions 1. **Remove the endpoint override if it is not required.** Use a fixed authenticated endpoint: ```python MCP_URL = "https://ai-hive.iclip.cn/api/mcp" ``` 2. **If configurability is operationally necessary, strictly validate the destination before attaching credentials.** Require: - Scheme: `https` - Hostname: exactly `ai-hive.iclip.cn` - Default HTTPS port only - Expected path: `/api/mcp` - No embedded username or password - No URL fragments or unexpected query parameters 3. **Never send AI-HIVE credentials to custom endpoints.** Custom destinations should require a separate, explicit credential variable and a prominent confirmation. AI-HIVE credentials must remain bound to the canonical AI-HIVE origin. 4. **Prevent credential forwarding across redirects.** Disable automatic redirects for authenticated requests or validate every redirect target and strip authorization headers whenever the origin changes. 5. **Fail closed before constructing the authenticated request.** Validate and normalize the URL first, then call `auth_headers()` only after confirming that the destination is trusted. 6. **Prefer scoped, revocable credentials.** Use OAuth tokens restricted to the minimum required scope, short lifetimes, and server-side spending limits. Avoid long-lived API keys where possible. 7. **Document incident response.** If an override or redirect is suspected, immediately revoke the exposed key or token, inspect service usage and billing, and issue a new credential. A hardened validation pattern could begin with: ```python from urllib.parse import urlsplit EXPECTED_SCHEME = "https" EXPECTED_HOST = "ai-hive.iclip.cn" EXPECTED_PATH = "/api/mcp" def validate_mcp_url(raw_url: str) -> str: parsed = urlsplit(raw_url) if ( parsed.scheme != EXPECTED_SCHEME or parsed.hostname != EXPECTED_HOST or parsed.port not in (None, 443) or parsed.path != EXPECTED_PATH or parsed.use ...[truncated 228 chars]
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 builds authenticated requests using environment-sourced API keys or bearer tokens and sends them to MCP_URL, which is overrideable via AI_HIVE_MCP_URL. If that environment variable is attacker-controlled, credentials can be transmitted to an arbitrary host, resulting in secret exfiltration and unauthorized use of the user's AI-HIVE account.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill instructs users to run local scripts, export API keys, read/write files, and connect to a remote MCP endpoint, which are operational capabilities equivalent to env, file, and network access, yet no permissions are declared. This creates a transparency and consent gap: a user or host system may treat the skill as low-privilege while it actually drives sensitive actions involving credentials and external services.

Intent-Code Divergence

Medium
Confidence
86% confidence
Finding
The script's CLI description explicitly says it does not call remote or paid tools, but the generated plan instructs the user to query same-day AI-HIVE tools, pricing, limits, and record task IDs, which implies external service interaction and potentially billable usage. This mismatch is dangerous because downstream agents or users may rely on the safety claim to skip confirmation or risk review, leading to unintended external data sharing, costs, or execution of actions outside the stated boundary.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The manifest enables implicit invocation, but the trigger conditions are only loosely described in free-form Chinese metadata rather than enforced as clear, narrow constraints. This can cause the skill to activate in broader contexts than intended, potentially routing user requests or data to the external MCP endpoint without sufficiently explicit user intent.

Static analysis

No suspicious patterns detected.