Back to skill

Security audit

开箱测评种草广告视频|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill fits its AI-HIVE ad-generation purpose, but its helper can send account credentials to any MCP URL supplied through the environment.

Review before installing. Use the fixed AI-HIVE endpoint or OAuth client flow, keep API keys in a secret store, do not set AI_HIVE_MCP_URL unless you fully trust the destination, and separately confirm any paid generation, bulk action, sending, or publication.

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

Credentials Can Be Transmitted 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", ) 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: body = error.read().decode("utf-8", errors="replace") if error.code == 401: raise SystemExit( "AI-HIVE MCP 返回 401。请确认 API Key 完整且未撤销;OAuth 用户应在客户端内重新连接," "不要把 OAuth token 粘贴到命令行。" ) raise SystemExit(f"AI-HIVE MCP HTTP {error.code}: {body[:800]}") ``` ### Technical Analysis The MCP destination is read from the externally controlled `AI_HIVE_MCP_URL` environment variable. The code does not validate the URL scheme, hostna ...[truncated 2761 chars]
Remediation
View remediation
str: parsed = urlparse(raw_url) if ( parsed.scheme != "https" or parsed.hostname not in ALLOWED_MCP_HOSTS or parsed.port not in (None, 443) or parsed.path not in ALLOWED_MCP_PATHS or parsed.username is not None or parsed.password is not None ): raise SystemExit("Refusing to send credentials to an unapproved MCP endpoint.") return raw_url ``` 3. **Separate endpoint selection from credential attachment.** Construct authentication headers only after destination validation. Unapproved destinations should receive no API key, bearer token, or session identifier. 4. **Prevent cross-origin credential forwarding.** Disable automatic redirects for authenticated requests or validate every redirect target against the same scheme, hostname, port, and path policy before following it. 5. **Apply least-privilege credential controls.** Prefer narrowly scoped, short-lived OAuth tokens where supported. Use account-side spending limits and revoke credentials immediately if an untrusted endpoint may have received them. 6. **Avoid unnecessary token support.** The documentation primarily directs OAuth users to a dedicated MCP client. If direct bearer-token use by this script is not required, remove `AI_HIVE_ACCESS_TOKEN` support to reduce the types of credentials exposed to this path. 7. **Add automated security tests.** Test ...[truncated 237 chars]
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 (11)

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 to MCP_URL, which is taken from the AI_HIVE_MCP_URL environment variable without validation. If an attacker can influence the environment or execution context, they can redirect requests, including API-key-bearing headers, to an arbitrary server, causing credential exfiltration and interaction with an untrusted endpoint.

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 declared purpose is a narrowly scoped ad-creation workflow, but the embedded operational guidance includes generic MCP connectivity, session setup, credential handling, and arbitrary tool invocation patterns. This mismatch is dangerous because trust and consent are anchored to the advertised business purpose, while the actual capability surface is broader and could be used to perform unintended remote actions or access infrastructure-level functions.

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
85% confidence
Finding

The skill exposes instructions and example code that use environment variables, local file I/O, and network access to connect to a remote MCP endpoint, but it does not declare any explicit tool scope or allowed-tools boundary. In practice this increases the blast radius: an agent may invoke broader capabilities than users expect, especially because the skill also discusses generic MCP tool calling rather than a tightly scoped advertising-only workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The activation text uses broad triggers such as commercial ads, AI images, AI videos, and short video production, which overlap with many ordinary creative requests. Over-broad triggering can cause the skill to activate in contexts the user did not intend, increasing the chance that remote MCP connectivity, planning steps, or generation-oriented flows are introduced unexpectedly.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill enables implicit invocation while exposing a broad advertising-generation workflow backed by a remote MCP tool that can perform model queries and potentially progress toward paid generation, batching, sending, or publishing. Even though the prompt says not to auto-pay or publish, implicit triggering increases the chance the skill is invoked from loosely related user requests, causing unreviewed external data flows, unintended tool use, or escalation into consequential marketing actions without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire skill file is written in Chinese and provides no indication that users may choose another language or locale. Under the policy rule for natural-language violations, a skill that effectively mandates a specific language without opt-in should be flagged unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file contains multiple user-facing error/help strings in Chinese, beginning at L040, and the CLI description/help text is also Chinese-only. For a general-purpose script, this imposes a specific language on users without opt-in or any documented justification that the tool is intended only for Chinese-speaking users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest sets language: zh-CN, which imposes a specific language/locale in the skill metadata. The file does not indicate that users may choose another language or that the locale restriction is optional or required for a justified region-specific reason.

Content

No source excerpt is available for this finding.