Back to skill

Security audit

低机位冷蓝与橙色火光科幻影像|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed AI-HIVE creative workflow, but its helper can send AI-HIVE credentials to an environment-selected MCP endpoint, so it should be reviewed before installation.

Install only if you are comfortable connecting this skill to AI-HIVE and sending prompts, task arguments, and possibly media metadata to that service. Prefer OAuth or a scoped API key, revoke keys immediately if exposed, do not run the helper with an untrusted AI_HIVE_MCP_URL value, and require explicit confirmation before any paid generation, upload, batch, send, or publish action.

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
User-Controlled MCP Endpoint Can Receive Authentication Credentials and Task Data## Vulnerability Details **File Location**: `scripts/ai_hive_mcp.py`, lines 19 and 47–75 **Vulnerability Type**: Unrestricted authenticated endpoint override **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 script permits `AI_HIVE_MCP_URL` to replace the trusted AI-HIVE endpoint without validating the URL scheme, hostname, port, or destination identity. The `post()` function then unconditionally adds either the bearer access token or API key returned by `auth_headers()` to requests sent to that endpoint. Consequently, an environment variable intended as a configuration override also controls where authentication credentials and MCP request payloads are disclosed. The code does not require HTTPS, restrict the endpoint to `ai-hive.iclip.cn`, or request explicit approval when the configured destination differs from the default. Sending credentials and task data to the documented AI-HIVE HTTPS endpoint is necessary for the declared authenticated MCP functionality. Allow ...[truncated 1597 chars]
Remediation
## Remediation Suggestions 1. Remove `AI_HIVE_MCP_URL` configurability if custom endpoints are not a documented requirement, and use the fixed trusted HTTPS endpoint. 2. If endpoint overrides are required, parse the URL before creating the request and enforce: - The `https` scheme. - An explicit hostname allowlist, preferably only `ai-hive.iclip.cn`. - The expected path, `/api/mcp`. - No embedded username or password. - No unexpected port. 3. Never attach AI-HIVE credentials to an endpoint that fails validation. 4. Require an explicit, interactive confirmation for any non-default destination, clearly stating that credentials and task payloads will be sent to that host. 5. Separate endpoint configuration from credential forwarding. Custom development endpoints should use distinct, endpoint-specific credentials rather than production AI-HIVE credentials. 6. Consider certificate or public-key pinning in controlled deployments where the operational trade-offs are acceptable. 7. Add automated tests covering malicious overrides such as plaintext HTTP, look-alike domains, embedded credentials, alternate ports, and attacker-controlled hosts. 8. Document that environment variables are part of the security boundary and should not be accepted from untrusted launchers, repositories, or CI jobs.
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
83% confidence
Finding
The script allows AI_HIVE_MCP_URL to be fully controlled by the environment, then sends authenticated POST requests to that URL using either an API key or bearer token. If an attacker can influence environment variables or wrapper configuration, they can redirect requests and exfiltrate credentials to an arbitrary endpoint or abuse the client as an SSRF primitive.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill advertises and demonstrates capabilities to read environment variables, read/write local files, and access the network, but does not declare permissions or narrowly scope those capabilities. In a skill ecosystem, this weakens user and platform visibility into what the skill can access and increases the chance of secret exposure, unauthorized local file interaction, or unintended remote calls.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documented purpose is a narrowly scoped creative workflow, but the referenced behavior acts like a generic remote MCP client that can inspect auth metadata, enumerate tools, and invoke arbitrary AI-HIVE tools using credentials from the environment. This mismatch is dangerous because users may consent to a benign-seeming cinematography helper while actually granting a broadly capable integration that can perform actions beyond the stated purpose.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The manifest enables implicit invocation for a third-party MCP-backed skill without defining trigger constraints, exclusions, or stronger user-consent boundaries. That increases the chance the agent will auto-select this skill in loosely related conversations and route user prompts or context to an external service, creating avoidable privacy, consent, and unexpected-action risk.

Static analysis

No suspicious patterns detected.