Back to skill

Security audit

用AI模拟李宏毅|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed AI-HIVE content workflow, but its helper scripts can send AI-HIVE credentials to environment-overridden network endpoints without validation.

Review before installing. Use only the documented AI-HIVE endpoints, do not set AI_HIVE_MCP_URL or AI_HIVE_BASE_URL unless you fully trust the destination, keep API keys in a secret store or controlled environment, revoke keys if exposed, and confirm model, price, quantity, and budget before any 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

Error
Location
scripts/ai_hive_mcp.py:19
Finding

Unchecked MCP endpoint override can disclose API keys and access tokens

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 ``` ### Technical Analysis The MCP endpoint is read from the `AI_HIVE_MCP_URL` environment variable without validating its scheme, hostname, port, path, or origin. The `post` function then unconditionally adds either an AI-HIVE API key or OAuth access token to requests se ...[truncated 2352 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ai_hive_creator.py:16
Finding

Unchecked model API base URL can redirect an API key to an attacker-controlled server

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

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

The script sends authentication material from environment variables (AI_HIVE_API_KEY or AI_HIVE_ACCESS_TOKEN) to a network endpoint whose base URL is also controlled by an environment variable (AI_HIVE_MCP_URL). If a user runs the script in an attacker-influenced environment or with a maliciously overridden MCP URL, the script can exfiltrate credentials to an arbitrary remote 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
99% confidence
Finding

The skill is presented primarily as a public-content analysis and originality workflow, but it also instructs the agent to authenticate to a remote MCP service, consume API keys or OAuth tokens, enumerate tools, and perform remote operations. This mismatch is dangerous because users may consent to a low-risk content skill while the agent is actually enabled for privileged external access and billable task creation, creating risks of credential misuse, unintended data transfer, and unauthorized charges.

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 的客户端

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes a domain-specific skill for researching public materials, extracting methodology, organizing user-authorized content into a knowledge base, and generating original content in a constrained 'simulate Li Hongyi' context. This file instead implements generic OAuth metadata inspection and arbitrary MCP tool listing/calling against a remote AI-HIVE endpoint, with no code enforcing the manifest's subject-matter limits or content-safety constraints.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script exposes generic remote tool invocation (tools/call) to whatever tools the remote MCP server offers, while the declared skill purpose is narrow and content-oriented. In the skill context, this materially broadens capability and can enable unexpected remote actions, costs, or data handling unrelated to Li Hongyi-style analysis, especially since the code does not enforce a tool allowlist beyond a billing prompt.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documents network access, local file reads/writes, and environment-variable credential usage, yet it declares no explicit tool scope or permission boundary. This can cause an agent or user to invoke broader capabilities than expected, increasing the risk of unintended network actions, local data access, or credential exposure under a content-oriented skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest sets language: zh-CN, and the document content is written entirely in Chinese, but the skill description does not offer users a language choice or indicate that the locale constraint is required for a region-specific compliance or operational reason. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill enables implicit invocation without any visible trigger constraints, so it may activate on broad or ambiguous user requests related to Li Hongyi, AI, content creation, or strategy topics. Because this skill can connect to an external MCP service and generate derivative-style content, unexpected invocation increases the chance of unintentional data sharing, user confusion, or use in sensitive impersonation-adjacent workflows.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The top-level docstring emphasizes diagnostics, public OAuth metadata inspection, and listing or calling tools with credentials, which frames the script as a helper client. However, the implementation includes a full generic tools/call path capable of invoking remote tools with attacker-controlled arguments, which is a materially broader operational role than a mere diagnostic helper.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Multiple user-facing error/help strings are written only in Chinese, including credential, parsing, argument, and confirmation messages. This imposes a specific language on users without opt-in or an offered language choice, matching the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The plan command writes a JSON file to a user-specified path via path.write_text(...). Although it prints the destination after writing, there is no warning before the write, no confirmation prompt, and no comment/docstring near the operation explaining that local files will be created or overwritten.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script reads a local file specified by --args-file, which is a file access operation in code. While the code validates the JSON shape, there is no print/log/comment/docstring near this behavior warning the user that the file contents will be read and sent as tool arguments.

Content

No source excerpt is available for this finding.