Back to skill

Security audit

AI大模型专家|GEO 生成式引擎优化

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Chinese-language AI-HIVE workflow for GEO planning plus image/video generation, with normal integration risks around API keys, uploads, downloads, and dependency installation.

Install only if you are comfortable sending selected prompts and media files to AI-HIVE and storing an AI-HIVE API key locally if you use init. Prefer a virtual environment with a pinned requests dependency, use a scoped/revocable API key, avoid uploading unlicensed or sensitive media, and review generation costs before running tasks.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:124
Finding

Unpinned Runtime Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 124
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Medium

Vulnerable Code:

bash
pip3 install requests

Technical Analysis

The documented setup procedure installs requests without a version constraint, lockfile, integrity hash, or explicitly trusted package index. Consequently, the package and its transitive dependencies are resolved from mutable repository state at installation time.

This does not prove that the current requests package is malicious. However, it creates a supply-chain exposure because the code ultimately installed can differ from the code reviewed during this audit. Compromise of a future package release, a transitive dependency, the configured Python package index, or local package-resolution settings could introduce attacker-controlled code.

Because both generation scripts import requests at startup, malicious package code could execute in the context of the user running the Skill.

Attack Path

  1. An attacker compromises a package release, transitive dependency, configured package index, or package-resolution environment.
  2. A user follows the documented pip3 install requests instruction.
  3. pip resolves and installs the attacker-controlled package content because no audited version or hash is enforced.
  4. The user invokes scripts/imagegen.py or scripts/videogen.py.
  5. Python imports the installed package, allowing malicious initialization code to execute with the invoking user's privileges.

Impact Assessment

Successful exploitation could execute arbitrary Python code with the privileges of the user performing installation or running the Skill. Depending on those privileges, the malicious dependency could read or alter user-accessible files, access environment variables and API credentials, make network requests, modify Python environments, or interfere with generated ...[truncated 219 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace the unconstrained installation command with an audited, version-pinned dependency file.
  • Pin all direct and transitive dependencies and include cryptographic hashes.
  • Install with hash enforcement, for example:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  • Generate and review a lockfile using a dependency-management tool appropriate for the project.
  • Document the trusted Python package index and avoid untrusted extra indexes.
  • Recommend installation inside a dedicated virtual environment with minimum necessary permissions.
  • Add automated dependency vulnerability and integrity scanning to the release process.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/imagegen.py:647
Finding

API Key Persisted in Plaintext Configuration

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 647-653; duplicated in scripts/videogen.py, lines 647-653
Vulnerability Type: Plaintext storage of sensitive authentication data
Risk Level: Low

Vulnerable Code:

python
config_dir = os.path.dirname(CONFIG_FILE_PATH)
os.makedirs(config_dir, exist_ok=True)
with open(CONFIG_FILE_PATH, "w", encoding="utf-8") as f:
    json.dump({"api_key": api_key, "base_url": DEFAULT_BASE_URL}, f, indent=2)
os.chmod(CONFIG_FILE_PATH, 0o600)

print(f"\n[ok] 已写入 {CONFIG_FILE_PATH}(权限 0600)")

Technical Analysis

The initialization routine writes the AI-HIVE bearer credential directly to ~/.ai-hive/config.json as plaintext. Setting file mode 0600 is a useful mitigation against access by other operating-system users, but it does not encrypt the credential or protect it from processes running as the same user, compromised user sessions, accidental backups, filesystem disclosure, or malware with access to the user's home directory.

The file is also opened before the explicit chmod call. The process umask generally restricts initial permissions, but the implementation does not itself guarantee restrictive permissions at the moment of file creation. A safer file-based fallback would create the file atomically with mode 0600.

The same implementation is present in both generation scripts.

Attack Path

  1. The user runs the init command and pastes a valid AI-HIVE API key.
  2. The script serializes the complete key as plaintext in ~/.ai-hive/config.json.
  3. A same-user process, compromised account, exposed backup, or filesystem disclosure obtains the configuration file.
  4. The attacker extracts the bearer credential.
  5. The attacker submits authenticated requests to the AI-HIVE API until the key expires, is disabled, or is revoked.

Impact Assessment

Successful exploitation exposes the affected AI-HIVE API credential. An attacker ...[truncated 490 chars]

Remediation
View remediation

Remediation Suggestions

  • Store the API key in the operating system credential store, such as Keychain, Credential Manager, Secret Service, or a dedicated secrets manager.
  • Prefer short-lived, narrowly scoped credentials over long-lived bearer keys.
  • If file storage must remain available, clearly warn users that the key is stored in plaintext.
  • Create the configuration file atomically with restrictive permissions from creation time rather than applying permissions only after writing.
  • Ensure the configuration directory is also restricted to the current user.
  • Exclude the configuration path from backups, diagnostics, logs, and support bundles where practical.
  • Never print the complete key; retain only masked confirmation output.
  • Provide documented key rotation and immediate revocation procedures.
  • Apply the same remediation to the duplicate implementation in scripts/videogen.py.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The English finding describes the same underlying issue: the skill is presented as a GEO strategy expert, while its practical capabilities resemble a general AI-HIVE client with broad API operations and short-drama generation workflows. When a skill's real behavior is broader than its declared role, users may provide sensitive assets or credentials under a false mental model, which materially increases abuse and accidental misuse risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The English finding describes the same underlying issue: the skill is presented as a GEO strategy expert, while its practical capabilities resemble a general AI-HIVE client with broad API operations and short-drama generation workflows. When a skill's real behavior is broader than its declared role, users may provide sensitive assets or credentials under a false mental model, which materially increases abuse and accidental misuse risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file implements a broad AI-Hive client with chat, image/video generation, upload, polling, and download capabilities, while the skill metadata presents it as a GEO/planning optimization skill. This capability mismatch is dangerous because users, reviewers, or policy gates may authorize the skill based on a much narrower stated purpose, yet it can exfiltrate local media to remote services and invoke powerful generation features outside that scope.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill advertises and demonstrates code paths that use environment variables, local files, network access, and shell commands, but it does not declare any explicit tool scope or permissions. This weakens reviewability and least-privilege controls, making it easier for a host agent or user to invoke capabilities such as local config writes, API-key handling, and downloads without clear prior disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest sets language: zh-CN, and the skill title, summary, and instructions are presented only in Chinese. Under the policy rules, forcing a specific language is a natural-language policy concern unless the skill offers a language choice or clearly justifies that it is limited to a Chinese-only regional/compliance context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill enables allow_implicit_invocation without any visible activation guardrails, narrow trigger conditions, or user-confirmation requirements. This can cause the agent to invoke the skill in broader contexts than intended, which is risky because the skill appears capable of steering planning and generation workflows and may influence downstream content/model operations without an explicit user request.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file’s natural-language description and generated content are fixed to Chinese terms such as 'GEO 生成式引擎优化', 'AI搜索', and other Chinese-only field values. There is no user choice, opt-in, or documented justification that this skill is region-specific, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language descriptions and CLI prompts entirely in Chinese, including the module docstring and later user-facing messages, but does not provide any opt-in or alternative locale selection. That can violate a language/locale policy when users are not explicitly given a choice.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes a domain-specific assistant for GEO planning, content structuring, evidence fields, and generation-task decomposition for brands, stories, and search optimization. In contrast, this skill file is a narrowly branded wrapper around a specific image model that submits image-generation jobs, uploads reference media, polls remote tasks, and downloads generated assets, without implementing GEO analysis or planning logic.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring and user-facing CLI text are written exclusively in Chinese, while the skill is described as a general-purpose tool rather than a region-specific or Chinese-only skill. This creates a natural-language locale constraint without user opt-in or justification, which matches the policy-violation criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The embedded configuration hard-codes the skill into a short-drama video generator, which materially diverges from the manifest's GEO/brand/search-optimization framing. This creates deceptive functionality scoping: a user may invoke what appears to be a planning/optimization tool but actually triggers remote video-generation workflows and media handling behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The string value for api_key includes a Chinese-only instruction (请替换为你的APIKey) embedded directly in the config example. Because this file provides user-facing guidance and does not offer an alternative language or explain a locale-specific requirement, it creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest frames the skill as helping teams break goals into executable GEO content tasks, but this code also opens a browser for API-key onboarding, stores credentials locally, and exposes account information retrieval. Those are platform-management capabilities for AI Hive usage rather than domain-specific GEO functionality.

Content

No source excerpt is available for this finding.