Back to skill

Security audit

品牌 Logo 创意应用|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed AI-HIVE advertising workflow, but its helper script can send AI-HIVE credentials to a user-overridden endpoint and can call broader MCP tools than the narrow workflow implies.

Install only if you intend to use AI-HIVE for this workflow and are comfortable connecting an AI-HIVE account or API key. Prefer OAuth through your MCP client, do not paste tokens into chat or logs, avoid setting AI_HIVE_MCP_URL, and review any generated or billable action before confirming it.

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 Exfiltrated Through a User-Overridable 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 script reads `AI_HIVE_API_KEY` or `AI_HIVE_ACCESS_TOKEN` from the environment and attaches the resulting credential to every MCP request. However, the destination is independently controlled by the `AI_HIVE_MCP_URL` environment variable. The code does not validate that the configured URL: - Uses HTTPS. - Has the exact trusted hostname `ai-hive.iclip.cn`. - Uses an approved port and path. - Has not been redirected to another origin. Consequently, anyone who can influence the process environment or launch configuration can cause the script to transmit the credential to an arbitrary HTTP or HTTPS endpoint. Allowing endpoint customization is not necessary for the Skill’s declared use of the fixed AI-HIVE service and therefore exceeds the ...[truncated 1863 chars]
Remediation
View remediation
str: parsed = urlparse(url) if parsed.scheme != "https": raise SystemExit("The MCP endpoint must use HTTPS.") if parsed.hostname not in TRUSTED_HOSTS: raise SystemExit("The MCP endpoint host is not trusted.") if parsed.port not in (None, 443): raise SystemExit("The MCP endpoint must use port 443.") if parsed.path != "/api/mcp": raise SystemExit("The MCP endpoint path is not permitted.") if parsed.username or parsed.password or parsed.fragment: raise SystemExit("The MCP endpoint contains unsupported URL components.") return url ``` 3. **Disable redirects or validate every redirect destination.** Authentication headers must never be forwarded to a different origin. 4. **Bind credentials to the trusted origin.** Construct authentication headers only after the destination has passed validation. 5. **Prefer short-lived, narrowly scoped OAuth tokens** over long-lived API keys where supported. 6. **Document the override as dangerous or remove it from production builds.** If retained for testing, require an explicit development flag and refuse to send real credentials to non-production hosts. 7. **Revoke affected credentials** if the script has previously been run with an untrusted or unexpected `AI_HIVE_MCP_URL`. ]]>
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 (10)

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 authentication material from environment variables to a remote endpoint whose URL can be overridden via AI_HIVE_MCP_URL. If an attacker can influence that environment variable or execution context, they can redirect requests and cause API keys or bearer tokens to be transmitted to an attacker-controlled server, resulting in 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 documented purpose is a constrained brand-logo advertising workflow, but the referenced behavior includes a generic MCP client capable of listing and calling arbitrary tools. That mismatch is security-relevant because users may trust the skill as a narrow business workflow while it actually enables much broader actions, creating room for privilege overreach, unreviewed tool use, billing risk, and unexpected data exposure.

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

The skill exposes operational guidance for network access, local file reads/writes, environment-variable based credential use, and arbitrary MCP tool invocation, but it does not declare any explicit tool scope or permission boundaries. In practice this weakens least-privilege controls and can let a seemingly narrow advertising skill exercise broader capabilities than users or hosts expect, increasing the chance of unauthorized file access, network actions, or secret handling mistakes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill is configured with allow_implicit_invocation: true, which permits the platform to invoke it without a tightly scoped user trigger. Because this skill can connect to an external MCP service for advertising, image, and video generation, implicit invocation increases the chance of unintended tool activation, unanticipated data sharing to a third-party endpoint, or the user being steered into a workflow they did not explicitly request.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains multiple user-facing error/help strings in Chinese, starting here, with no indication that the user can choose another language. That creates a natural-language policy concern because the skill imposes a specific language/locale by default rather than offering opt-in or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest metadata sets language: zh-CN, and the skill content is written entirely in Chinese without indicating that other languages are supported on request. This can violate language/locale policy when a skill implicitly forces a specific language without explicit user opt-in or documented region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The display name, description, and default prompt are all written in Chinese, with no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking context. This can violate language or locale policy when a skill implicitly forces a language without user opt-in.

Content

No source excerpt is available for this finding.