Back to skill

Security audit

用AI模拟王木头学科学|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed AI-HIVE content workflow, but its helper scripts can send API credentials to environment-configured endpoints without validating the destination.

Review before installing if you plan to use API keys. Prefer OAuth through the client connector, avoid setting AI_HIVE_MCP_URL or AI_HIVE_BASE_URL in normal use, and use separate low-scope test credentials if custom endpoints are needed. Confirm budget and model choices before any image, video, ecommerce, or advertising generation task.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ai_hive_mcp.py:15
Finding

Credential Disclosure Through an Unrestricted MCP Endpoint Override

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", ) ``` ### Technical Analysis The MCP destination is taken directly from the `AI_HIVE_MCP_URL` environment variable without validating its scheme, hostname, port, or path. The script subsequently attaches either the complete AI-HIVE API key or OAuth access token to every request made to that destination. Authenticated network communication is necessary for the declared MCP functionality. However, allowing an unrestricted endpoint override while automatically attaching production credentials exceeds the minimum privileges required to communicate with the declared AI-HIVE service. Environment variables are not inherently trusted. They may be influenced by wrapper scripts, development environments, CI configuration, shell profiles, launchers, containers, or compromised parent processes. Consequently, an attacker capable of setting `AI_HIVE_MCP_URL` can redirect authenticat ...[truncated 1841 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ai_hive_creator.py:13
Finding

API Key Disclosure Through an Unrestricted REST API Base URL

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (13)

Tainted flow: 'req' from os.environ.get (line 24, 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_creator.py (reported line 26)May include surrounding context.

python
url += "?" + urllib.parse.urlencode({"modelType": args.type})
    req = urllib.request.Request(url, headers={"Authorization": f"Bearer {key}", "Accept": "application/json"})
    try:
        with urllib.request.urlopen(req, timeout=30) as resp:
            data = json.load(resp)
    except Exception as exc:
        raise SystemExit(f"模型查询失败:{exc}") from exc

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 allows AI_HIVE_MCP_URL from the environment to control the POST destination while automatically attaching API credentials from environment variables. An attacker who can influence the runtime environment can redirect requests to an arbitrary host and capture the x-ai-hive-api-key or bearer token, causing credential exfiltration and unauthorized remote tool invocation.

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

The declared purpose centers on public-content analysis and compliant content generation, but the file also instructs the agent to perform live OAuth/MCP binding, API-key handling, remote tool discovery, and arbitrary remote MCP tool invocation. This mismatch is dangerous because users may authorize credentials and remote actions they did not reasonably expect from the skill description, expanding risk to secret exposure, unintended external calls, and potentially 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 的客户端

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The helper exposes generic remote MCP tool listing and invocation using API credentials, which materially exceeds the manifest's stated purpose of analyzing a public creator's methodology/content style. This broad capability increases the attack surface: if incorporated into the skill workflow or misused by operators, it can trigger unrelated remote actions, including potentially billable or sensitive operations, with only a minimal local safeguard.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill documents executable workflows that read environment variables, access local files, and make network calls, but it does not declare an explicit tool scope or permission boundary. In an agent environment, this can cause overbroad tool access and make users or orchestrators unaware that the skill may touch secrets, local data, and remote endpoints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file explicitly sets language: zh-CN, and the user-facing description and prompt templates are written as mandatory Chinese instructions throughout the skill. There is no indication that users may choose another language, nor a clear justification that the skill is region-locked for compliance or other necessity, which creates a locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The display name, description, and default prompt are all written only in Chinese, which implies a fixed language/locale experience. The file does not offer a language choice or explain that the skill is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The combination of a prescriptive default prompt and allow_implicit_invocation=true allows the skill to activate from broad, loosely matched user requests without an explicit opt-in. Because this skill can invoke an external MCP endpoint for content generation, over-broad activation increases the chance of unintended tool use, privacy leakage in forwarded prompts, or the assistant steering users into this skill when they did not clearly request it.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script emits user-facing error and status text in Chinese, beginning with the runtime error at L40 and continuing throughout CLI help and exit messages. 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 language/locale policy violation category.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This Python code performs a file write via Path.write_text, creating or overwriting the output plan file. Although the CLI argument names imply file output, there is no confirmation prompt, warning comment/docstring, or explicit user-facing disclosure before the write beyond the post-write success message.

Content

No source excerpt is available for this finding.