Back to skill

Security audit

新品视觉TVC广告宣传|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches an AI-HIVE advertising workflow, but its helper can send AI-HIVE credentials to an unvalidated endpoint override and can invoke arbitrary remote MCP tools.

Install only if you intend to use AI-HIVE and are comfortable connecting a remote MCP service for advertising asset generation. Prefer OAuth through a trusted MCP client, keep API keys out of prompts and logs, do not set AI_HIVE_MCP_URL unless you fully trust the endpoint, and require explicit review before paid generation, uploads, bulk 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:15
Finding

Credentials Can Be Sent to a User-Controlled 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 read from the mutable `AI_HIVE_MCP_URL` environment variable. However, `post()` unconditionally adds either the `AI_HIVE_ACCESS_TOKEN` bearer token or the `AI_HIVE_API_KEY` header to requests sent to that destination. The implementation does not verify that the configured URL: - Uses HTTPS. - Resolves to the intended `ai-hive.iclip.cn` host. - Uses the expected `/api/mcp` path. - Belongs to an explicit trusted-origin allowlist. Consequently, control over the process environment or launch configuration is sufficient to redirect authenticated requests to an unrelated server. Endpoint configurability can be useful for testing, but forwarding production credentials to an arbitrary override exceeds the minimum privilege necessary for the ...[truncated 1716 chars]
Remediation
View remediation
str: candidate = os.environ.get("AI_HIVE_MCP_URL", TRUSTED_MCP_URL) parsed = urlsplit(candidate) if ( parsed.scheme != "https" or parsed.hostname != "ai-hive.iclip.cn" or parsed.port not in (None, 443) or parsed.path != "/api/mcp" or parsed.username is not None or pa ...[truncated 179 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 (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
93% confidence
Finding

The script builds outbound authenticated requests to MCP_URL, which is controllable via the AI_HIVE_MCP_URL environment variable. If an attacker can influence the environment, they can redirect the client to an arbitrary server and cause disclosure of the API key or bearer token in request headers, effectively turning this into SSRF with credential exfiltration.

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

The declared purpose is a constrained ad-production workflow, but the referenced behavior exposes generic MCP/OAuth diagnostics and arbitrary tool invocation patterns instead of narrowly implementing that workflow. This mismatch is dangerous because users or downstream agents may trust the benign marketing description while the skill actually grants a broader remote-action surface that could be repurposed for unintended network operations, data access, or privilege misuse.

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

The skill advertises executable scripts, environment-variable based authentication, local file output, and remote MCP/network access, but it does not declare any explicit tool scope or allowed-tools boundary. That makes the effective capability set broader than the user-facing contract and increases the chance that an agent can read/write files, access secrets, or make network calls beyond the narrowly described advertising workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description is entirely in Chinese and the metadata explicitly sets language: zh-CN, which indicates a fixed language/locale expectation. The file does not offer an opt-in choice for other languages or explain that the skill is restricted to a China-specific compliance or operational context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill enables allow_implicit_invocation without any visible trigger constraints, so the platform may invoke this advertising workflow based on broad user intent matching rather than explicit user selection. Because the skill connects to an external MCP service capable of generating marketing assets and potentially leading into paid, bulk, send, or publish actions, unintended invocation increases the risk of unreviewed external data sharing, prompt routing, and action escalation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script emits user-facing error text in Chinese, and similar Chinese-only messages appear throughout the CLI. For a general-purpose helper script, this imposes a specific language on users without opt-in or a documented region-specific justification, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.