Back to skill

Security audit

宣言式概念短片|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill largely matches its AI-HIVE advertising purpose, but its helper script can send AI-HIVE credentials to an environment-configured MCP endpoint, so it needs review before installation.

Install only if you intend to connect this agent to AI-HIVE for ad media generation. Prefer OAuth through the MCP client, avoid placing API keys in shells or logs, do not set AI_HIVE_MCP_URL unless you fully trust the endpoint, and confirm model, price, budget, and publishing actions before any paid generation.

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

Authentication Credentials Can Be Sent to an Arbitrary MCP Endpoint

Content
View full analysis
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 before `post()` attaches an AI-HIVE API key or OAuth bearer token and sends the request. There is no enforcement of: - HTTPS transport. - The expected `ai-hive.iclip.cn` hostname. - The expected `/api/mcp` path. - A safe port. - An approved endpoint allowlist. Consequently, a process launcher, wrapper script, compromised execution environment, or configuration mechanism that can set `AI_HIVE_MCP_URL` can direct authenticated requests to an attacker-controlled server. The transmitted request may include both the credential and user-supplied MCP tool arguments. This network behavior is necessary for the declared remote-generation functionality, ...[truncated 1639 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (9)

Tainted flow: 'request' from os.environ.get (line 67, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/ai_hive_mcp.py (reported line 28)May include surrounding context.

python
def fetch_json(url: str) -> dict:
    request = urllib.request.Request(url, headers={"accept": "application/json"})
    with urllib.request.urlopen(request, timeout=20) as response:
        return json.loads(response.read().decode("utf-8"))

Tainted flow: 'request' from os.environ.get (line 67, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The script sends authenticated requests, including API key or bearer token headers, to MCP_URL, which is taken from the AI_HIVE_MCP_URL environment variable without validation. If an attacker can influence that environment variable or execution context, they can redirect requests to an arbitrary host and cause credential exfiltration or unauthorized API calls.

Content

Scanner excerpt · scripts/ai_hive_mcp.py (reported line 74)May include surrounding context.

python
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:

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior promises a constrained ad-production workflow with confirmation gates, but the referenced operational content exposes a more general MCP connection, tool enumeration, and arbitrary call pattern. This mismatch is dangerous because users or orchestrators may trust the documented safeguards and business limits, while the actual capability set can be used to invoke unintended backend actions, bypass expected workflow controls, or mishandle billable operations.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/mcp-binding.md (reported line 63)May include surrounding context.

md
## Codex、Claude 与 ChatGPT

优先使用各客户端的远程 MCP/连接器界面;若支持 JSON 配置,使用 OAuth 最小配置。客户端必须支持 Streamable HTTP、OAuth 2.1、PKCE 和动态客户端注册。若出现 `unauthorized_client`,保留脱敏错误和客户端版本,通过 AI-HIVE 登录后的客服渠道反馈,不要把 access token 粘贴到聊天中。

## Gemini 与支持 Header 的客户端

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/mcp-binding.md (reported line 102)May include surrounding context.

md
## Codex、Claude 与 ChatGPT

优先使用各客户端的远程 MCP/连接器界面;若支持 JSON 配置,使用 OAuth 最小配置。客户端必须支持 Streamable HTTP、OAuth 2.1、PKCE 和动态客户端注册。若出现 `unauthorized_client`,保留脱敏错误和客户端版本,通过 AI-HIVE 登录后的客服渠道反馈,不要把 access token 粘贴到聊天中。

## Gemini 与支持 Header 的客户端

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises and demonstrates capabilities that involve network access, local file reads/writes, and environment-based credential use, but it does not declare an explicit tool scope or allowed-tools boundary. That creates an over-privileged integration surface where a host or user may assume a narrower advertising workflow, while the skill can in practice interact with broader local and remote resources.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The display name, short description, and default prompt are all hardcoded in Chinese, which can impose a specific language/locale on users without any stated opt-in or alternative. The file does not indicate that this is a region-specific skill or that users can choose another language.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation for a workflow that can drive external MCP-powered content generation, including image/video advertising tasks. Without explicit trigger constraints or exclusions, the agent may invoke this skill in loosely related conversations, causing unintended external tool access, privacy leakage of user/business data, or steering users into ad-generation flows they did not clearly request.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user-facing error text in Chinese, and the same pattern continues throughout the CLI messages. The file does not offer a language/locale option or explain that the skill is intentionally limited to Chinese-speaking users, which conflicts with the policy against forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.