Back to skill

Security audit

字体动效广告|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its AI-HIVE advertising purpose, but needs review because its helper script can send API credentials to a configurable MCP URL and invoke broad remote tools.

Review before installing. Use OAuth or an API key only with the official AI-HIVE endpoint, avoid setting AI_HIVE_MCP_URL from projects or wrappers you do not control, and require explicit confirmation before any paid, batch, sending, upload, or publishing action.

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

Credential Exfiltration Through 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} ``` ```python 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 ``` ### Technical Analysis The MCP request destination is taken directly from the `AI_HIVE_MCP_URL` environment variable. The code then obtains an AI-HIVE API key or OAuth access token from the process environment and unconditionally attaches that credential to requests sent to the configured destination. There is no validation that the destination: - Uses HTTPS. - Has the expected `ai-hive.iclip.cn` hostname. - Uses the intended `/api/mcp` path. - Resolves to an approved public network address. - Has not been changed to a third-party endpoint. Consequently, the authentication credential and MCP request body can be transmitted to an arbitrary ...[truncated 2085 chars]
Remediation
View remediation
str: parsed = urlparse(url) if ( parsed.scheme != "https" or parsed.hostname != EXPECTED_HOST or parsed.port not in (None, 443) or parsed.path.rstrip("/") != EXPECTED_PATH or parsed.username is not None or parsed.password is not None ): raise SystemExit("Refusing to send AI-HIVE credentials to an unapproved endpoint.") return url ``` 3. Perform destination validation before calling `auth_headers()`. 4. Do not attach AI-HIVE credentials to custom or third-party endpoints. If custom MCP servers must be supported, require separate endpoint-specific credentials rather than reusing `AI_HIVE_API_KEY` or `AI_HIVE_ACCESS_TOKEN`. 5. Restrict authenticated redirects. Reject any redirect that changes the scheme, hostname, port, or approved path before resending a request. 6. Require explicit interactive confirmation when any non-default endpoint is selected, displaying the normalized destination without displaying credentials. 7. Add automated tests verifying that HTTP URLs, alternate hosts, embedded credentials, unexpected ports, deceptive subdomains, and cross-origin redirects are rejected. 8. Document that environment variables controlling authenticated destinations must not be accepted from untrusted project files, wrappers, or launch configurations. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (12)

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 allows the MCP endpoint URL to be overridden via AI_HIVE_MCP_URL and then sends authentication material to that URL using either an API key header or bearer token. If a user runs the tool with a malicious or mistaken environment override, credentials and tool-call contents could be exfiltrated to an attacker-controlled server.

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

The skill claims a narrowly scoped advertising workflow with confirmation gates, but the described implementation appears to be a generic MCP client that can invoke broader tools and does not actually enforce the domain restrictions or deliverables it promises. This mismatch is dangerous because users and host agents may trust the declared scope while the actual behavior can reach beyond advertising tasks, increasing the chance of unauthorized actions, data exposure, or execution of unintended tool calls.

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 advertises networked MCP usage, local scripts, environment-variable secrets, and file read/write behavior, but does not declare any explicit tool scope or allowed-tools boundary. That creates an avoidable capability-expansion risk: an agent or runtime may grant broader access than users expect, enabling unintended filesystem, network, or secret-handling operations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill enables implicit invocation without defining trigger constraints, exclusions, or tighter scope boundaries. Because this skill can connect to an external MCP service for ad-generation workflows, it may be invoked in situations the user did not clearly intend, increasing the chance of unintended third-party data disclosure, surprise tool use, or progression toward paid or publishing actions despite the descriptive warning text.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The entire skill file is written in Chinese and does not indicate that language choice is optional or user-selectable. Under the policy, forcing a specific language without opt-in can be a natural-language policy violation unless the locale constraint is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains multiple user-facing error/help strings in Chinese, beginning at L040, with no indication that the skill is intended only for Chinese-speaking users and no opt-in for language selection. That violates the language/locale policy criterion because the skill imposes a specific language on all users by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The credential error text is presented only in Chinese, and the file similarly uses Chinese for other CLI descriptions and warnings. Because the skill does not offer language/locale opt-in or document a justified locale restriction, these strings represent a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script exposes a generic MCP tool caller via tools/call and list-tools, which goes beyond the narrowly advertised font-animation advertising workflow in the manifest. This broad capability increases the chance of misuse because users may invoke unrelated remote tools with the skill's authority and trust expectations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest promises separate confirmation for paid generation, batch actions, sending, and public publishing, but the code only gates non-read-only tools behind a generic --confirm-paid flag. That means sensitive non-payment actions such as bulk operations, outbound sending, or public release could occur without the distinct confirmation policy users were told to expect.

Content

No source excerpt is available for this finding.