Back to skill

Security audit

游戏Demo视频设计师|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent AI-HIVE video-generation workflow, but its helper script can send AI-HIVE credentials to an environment-selected MCP URL, which needs review before installation.

Review before installing. Use OAuth or an API key only with the documented AI-HIVE endpoint, avoid setting AI_HIVE_MCP_URL unless you fully trust the target server, and confirm pricing before any image/video generation, batch action, sending, or public 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

Warning
Location
scripts/ai_hive_mcp.py:19
Finding
Credential Disclosure Through an Unvalidated MCP Endpoint Override## Vulnerability Details **File Location**: `scripts/ai_hive_mcp.py`, lines 19 and 47–71 **Vulnerability Type**: Unvalidated credential destination **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", ) ``` ### Technical Analysis The client reads an API key or OAuth access token from the process environment and attaches it to every authenticated MCP request. However, the destination is independently controlled by the `AI_HIVE_MCP_URL` environment variable. The code does not require HTTPS, verify that the hostname is `ai-hive.iclip.cn`, restrict the URL path to `/api/mcp`, or otherwise bind AI-HIVE credentials to their intended origin. Therefore, a malicious or accidentally modified environment can redirect authenticated requests to an arbitrary server. This exceeds the minimum privileges needed for the declared functionality. The Skill documents a specific AI-HIVE endpoint, so transmitting AI-HIVE credentials to arbitrary conf ...[truncated 1326 chars]
Remediation
## Remediation Suggestions 1. Remove the `AI_HIVE_MCP_URL` override if custom MCP endpoints are not required: ```python MCP_URL = "https://ai-hive.iclip.cn/api/mcp" ``` 2. If configurability is required, validate the URL before constructing an authenticated request: - Require the `https` scheme. - Require an exact allowlisted hostname. - Require the expected port and `/api/mcp` path. - Reject embedded user information, fragments, and ambiguous hostnames. 3. Prevent credential forwarding across redirects. Disable automatic redirects for authenticated requests or verify every redirect target against the same origin allowlist before resending credentials. 4. Bind each credential to its intended endpoint. Custom servers should use separately named credential variables rather than automatically receiving `AI_HIVE_API_KEY` or `AI_HIVE_ACCESS_TOKEN`. 5. Fail closed with a clear error when the endpoint does not match the approved AI-HIVE origin. 6. Add tests covering HTTP URLs, attacker-controlled domains, deceptive subdomains, alternate ports, embedded credentials, and cross-origin redirects. 7. If a credential may already have been exposed, revoke it immediately, create a replacement, and inspect account activity and billing records for unauthorized operations.
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 (6)

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
91% confidence
Finding
The script allows AI_HIVE_MCP_URL from the environment to control the destination of authenticated POST requests, and auth_headers() may attach an API key or bearer token to those requests. If an attacker can influence the environment or execution context, they can redirect traffic to an arbitrary server and capture credentials or tool-call payloads.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill advertises and documents use of environment variables, local file reads/writes, and outbound network access, yet no explicit permission declaration is present. This creates a capability-transparency gap: a user or hosting platform may invoke a skill that can access secrets, write artifacts, and contact a remote MCP endpoint without those powers being clearly declared and constrained.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding
The skill is presented as a narrowly scoped 'game demo video designer' workflow, but the documented behavior includes generic MCP initialization, session management, tool enumeration, arbitrary tool invocation, and local file generation. That mismatch is dangerous because users may consent to a creative planning skill while actually enabling a broader remote-control client that can exercise additional capabilities against the MCP service.

Vague Triggers

Medium
Confidence
82% confidence
Finding
The trigger description contains broad search phrases such as AI images, AI video, anime/game, and short-video production, which can cause the skill to activate for loosely related requests. Overbroad invocation increases the chance that users are routed into a skill with networked/tool-executing behavior when they did not intend to use this specific workflow or authorize its side effects.

Vague Triggers

Medium
Confidence
80% confidence
Finding
The search tags are very broad category labels rather than tightly scoped identifiers, making accidental or excessive routing more likely. In this skill's context, that matters because invocation can lead to remote MCP connectivity guidance, credential use, and tool access pathways beyond simple content advice.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill enables implicit invocation without any visible trigger constraints, so the platform may auto-activate it for broad, loosely related user requests. Because this skill connects to an external MCP service capable of content generation and potentially downstream paid actions, ambiguous activation increases the chance of unintended tool use, privacy exposure in prompts, or user confusion about when third-party processing occurs.

Static analysis

No suspicious patterns detected.