Back to skill

Security audit

凝视式长镜头与时空流动电影短片|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed AI-HIVE film workflow, but it includes broad remote tool access and a helper script that can send credentials to an environment-controlled endpoint.

Install only if you are comfortable giving this skill access to your AI-HIVE account tools. Prefer OAuth or a fixed trusted MCP configuration, do not set AI_HIVE_MCP_URL in normal use, and revoke/rotate any API key that may have been used with an untrusted endpoint. Consider disabling implicit invocation and require explicit confirmation before uploads, paid generation, batch operations, 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 Exfiltrate API Credentials## Vulnerability Details **File Location**: `scripts/ai_hive_mcp.py`, lines 19 and 47–74 **Vulnerability Type**: Credential disclosure through an unvalidated 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} ``` ```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", ) ``` ### Technical Analysis The MCP destination is read from the environment variable `AI_HIVE_MCP_URL`, but the value is not validated before authenticated requests are sent. The `post()` function unconditionally adds either the bearer access token or the API key returned by `auth_headers()`. Consequently, an environment value can redirect authenticated traffic away from the declared AI-HIVE service. There is no enforcement of HTTPS, no hostname allowlist, no expected-origin comparison, and no rejection of embedded credentials, unexpected ports, or attacker-controlled hosts. An endpoint override can be useful for testing, but forwarding production credentials to an arbitrary override exceeds the minimum privilege necessary for the Skill's declared AI-HIVE functionality. The legitimate operation only requires credentials to be transmitted to the trusted AI-HIVE MCP origin. ### Att ...[truncated 1618 chars]
Remediation
## Remediation Suggestions 1. Remove `AI_HIVE_MCP_URL` overriding if custom endpoints are not necessary. Use the fixed declared endpoint: `https://ai-hive.iclip.cn/api/mcp`. 2. If overriding is required for development, parse and validate the URL before creating a request: - Require the `https` scheme. - Allow only an explicit set of trusted hostnames. - Reject embedded usernames or passwords. - Reject unexpected ports. - Normalize the hostname before comparison. - Verify that credentials are only attached when the destination matches a trusted origin. 3. Separate endpoint selection from credential attachment. For example, permit custom endpoints only in an explicit unauthenticated development mode, and refuse to send `AI_HIVE_API_KEY` or `AI_HIVE_ACCESS_TOKEN` to them. 4. Fail closed with a clear error when the endpoint is not trusted rather than silently sending an unauthenticated request or accepting arbitrary destinations. 5. Add automated tests covering: - The default trusted endpoint. - HTTP downgrade attempts. - Subdomain and suffix-confusion hosts. - Embedded credentials. - Unexpected ports. - Internationalized or encoded hostnames. - Attempts to send credentials to a non-allowlisted origin. 6. Document the endpoint trust restriction and advise affected users to revoke and rotate any credential that may already have been sent to an untrusted endpoint.
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
89% confidence
Finding
The script allows AI_HIVE_MCP_URL to be overridden from the environment and then sends authentication material from AI_HIVE_API_KEY or AI_HIVE_ACCESS_TOKEN to that URL via post(). If an attacker can influence the environment or execution context, they can redirect requests to an attacker-controlled endpoint and capture API keys/tokens, which is effectively credential exfiltration/SSRF.

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill instructs use of environment variables, local file read/write scripts, and remote network access to an MCP endpoint, but no explicit permission declaration is present. That creates a transparency and sandboxing gap: users or hosting platforms may not realize the skill can access secrets, write local artifacts, and invoke external services, increasing the chance of unintended data exposure or unsafe execution.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documented purpose is a constrained film-creation workflow, but the referenced behavior extends to generic MCP connectivity, OAuth metadata inspection, tool enumeration, environment-based credential use, and potentially invoking arbitrary AI-HIVE tools with only a soft confirmation guard. This mismatch is dangerous because users may trust the skill as narrowly scoped while it effectively enables broader remote actions, including paid or sensitive operations outside the advertised workflow.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill enables implicit invocation without a narrowly constrained activation scope, which means the agent may auto-select this skill in response to loosely related user requests. Because the skill is connected to an external MCP service capable of content generation and potentially downstream paid or publishing actions, unintended invocation increases the risk of unauthorized external tool use, prompt/data leakage to the third-party endpoint, and confusing or unsafe automated behavior.

Static analysis

No suspicious patterns detected.