Back to skill

Security audit

用AI模拟吴恩达|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it needs review because its helper scripts can expose AI-HIVE credentials to unvalidated endpoints and can invoke broad remote AI-HIVE tools.

Install only if you intend to connect an AI-HIVE account and are comfortable with remote MCP tool use. Prefer OAuth in a trusted client, avoid setting AI_HIVE_MCP_URL or AI_HIVE_BASE_URL, use a limited or revocable API key if needed, confirm costs before generation, and do not upload private, paid, or third-party materials without permission.

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

API Credential Exfiltration Through an Unvalidated 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} 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: ``` ### Technical Analysis The script reads an API key or OAuth access token from the process environment and attaches it to every MCP request. The destination of that request is independently configurable through `AI_HIVE_MCP_URL`. No validation ensures that the configured URL: - Uses HTTPS. - Belongs to `ai-hive.iclip.cn`. - Uses the expected MCP path. - Resolves to an approved service. - Does not redirect requests to another origin. Consequently, anyone ab ...[truncated 1796 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ai_hive_creator.py:11
Finding

API Key Exfiltration Through an Unvalidated Model API Base URL

Content
View full analysis
` to the malicious server. 7. The attacker records the key and reuses it against the ...[truncated 534 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (16)

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

The script allows AI_HIVE_MCP_URL to be overridden via an environment variable and then sends authentication headers to that URL, including either a bearer token or API key. If a user runs the helper in a compromised environment or with a maliciously set variable, credentials can be exfiltrated to an attacker-controlled endpoint and arbitrary remote MCP actions may be triggered.

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 is content/methodology analysis, but the skill also instructs the agent to perform authenticated remote MCP discovery and tool invocation against AI-HIVE. This mismatch can mislead users and higher-level orchestrators about the skill's true capability, enabling unexpected external actions, credential usage, and billable task creation under the guise of a benign analysis workflow.

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 embeds operational instructions for network access, local file interaction, environment-variable use, and authenticated MCP/API calls, yet it declares no explicit tool scope or permissions boundary. That creates an authorization and transparency gap: an agent may infer it is acceptable to access secrets, files, or remote services without the user having been clearly informed of the capability surface.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger terms are broad and numerous, covering many generic queries around Andrew Ng, AI content, strategy, and public-content analysis. Overbroad activation increases the chance the skill is invoked in contexts where the user did not intend external service usage or identity-simulation workflows, which can cascade into unnecessary data collection, remote calls, or confusing outputs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The default prompt is broad and keyword-oriented, encouraging invocation for a wide range of loosely related user queries without explicit consent boundaries. In combination with a content-generation skill and external MCP access, this can cause the agent to activate in contexts the user did not intend, leading to over-collection of inputs, unexpected tool use, or policy-sensitive impersonation-style outputs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Enabling implicit invocation without a tightly scoped activation description increases the chance that the platform will auto-select this skill for ambiguous requests. Because the skill can connect to an external AI-HIVE MCP endpoint for media generation, unintended activation may result in unanticipated data sharing, tool execution, or generation of potentially misleading persona-simulation content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module docstring is entirely in Chinese and serves as the CLI description via argparse, which makes the skill's user-facing interface language-specific by default. The file does not provide an opt-in choice of language 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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains multiple hard-coded Chinese messages, starting at L40, for errors and CLI help text. The file does not provide any user opt-in for language selection or indicate that the skill is intentionally limited to Chinese-speaking users, which violates the natural-language locale policy criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes a narrowly scoped skill for building an Andrew Ng methodology knowledge base and generating related analysis/content. In contrast, this script exposes a generic list-tools command and an arbitrary call path that can invoke any remote MCP tool name, only gating some calls behind a cost-confirmation flag rather than limiting them to the manifest's stated domain.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

L006 将 metadata.language 固定为 zh-CN,文件整体内容也默认以中文面向用户,但未在此处说明用户可选择其他语言。根据语言/区域政策,若技能强制特定语言而无用户选择或充分限定,可能构成自然语言层面的 locale policy 问题。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes building a public-source research corpus, extracting methodology, organizing user-provided materials, and generating original content plans within that domain. The models command instead queries the AI-HIVE account's available models API and filters model metadata, which is an account/platform introspection utility rather than a domain-specific Andrew Ng research or methodology function.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The top-level documentation presents the script as a diagnostics and API-key client that can inspect metadata and list or call tools with credentials, which understates that it implements a full generic remote invocation path for arbitrary tool names supplied on the command line. This is an intent/documentation mismatch because the operational impact is broader than a simple diagnostic helper.

Content

No source excerpt is available for this finding.