Back to skill

Security audit

GEO 多平台内容生成器|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed Chinese GEO content and AI-HIVE media workflow, but it needs review because its client stores an API key and can send credentials, uploads, and downloads through insufficiently scoped URLs.

Install only if you trust AI-HIVE and are comfortable storing an AI-HIVE API key locally. Avoid setting custom base URLs unless you control them, review every command before paid generation, upload only media you are authorized to share, and consider running the tool in an isolated environment with limited output storage.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/imagegen.py:91
Finding

API Credential Disclosure Through an Unrestricted Base URL

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 91–99 and 130–145
Vulnerability Type: User-controlled API destination with automatic bearer-token forwarding
Risk Level: High

Vulnerable Code

python
def _resolve_base_url(self, cli_url):
    if cli_url:
        return cli_url.rstrip("/")
    env_url = os.environ.get("AI_HIVE_BASE_URL")
    if env_url:
        return env_url.rstrip("/")
    file_config = self._read_config_file()
    if file_config.get("base_url"):
        return file_config["base_url"].rstrip("/")
    return DEFAULT_BASE_URL
python
def __init__(self, config):
    self.config = config
    self.base = config.base_url
    self.headers = {
        "Authorization": f"Bearer {config.api_key}",
        "Content-Type": "application/json",
    }

def _url(self, path):
    return f"{self.base}/openapi/v1/{path}"

def _request(self, method, url, **kwargs):
    self.config.log(f"{method} {url}")
    try:
        resp = requests.request(
            method, url, headers=self.headers, timeout=DEFAULT_TIMEOUT, **kwargs
        )

Technical Analysis

The API destination can be supplied through --base-url, the AI_HIVE_BASE_URL environment variable, or the local configuration file. The value is accepted without validating its scheme, hostname, port, or relationship to the legitimate AI-HIVE service.

AiHiveClient subsequently attaches the AI-HIVE API key as an Authorization: Bearer header to every request sent to that destination. Consequently, configuring an attacker-controlled URL causes the production credential to be transmitted directly to the attacker. Plain HTTP destinations are also accepted, allowing interception by a network-positioned attacker.

Attack Path

  1. An attacker persuades the user or an automation environment to set AI_HIVE_BASE_URL, pass --base-url, or modify ~/.ai-hive/config.json.
  2. The val ...[truncated 1005 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require HTTPS for all authenticated API destinations.
  2. Allowlist the expected API hostname, ai-hive.iclip.cn, by default.
  3. Reject URLs containing embedded credentials, fragments, unexpected ports, or non-HTTP schemes.
  4. If custom endpoints are necessary for development, require an explicit opt-in and prominent confirmation before sending credentials.
  5. Use separate development credentials for custom endpoints rather than forwarding production AI-HIVE credentials.
  6. Revalidate the destination after redirects, or disable redirects for authenticated requests.
  7. Consider certificate pinning or equivalent transport controls in environments with elevated credential-protection requirements.
  8. Add automated tests verifying that HTTP URLs and unapproved hosts are rejected.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:278
Finding

Unvalidated Server-Controlled Upload and Download URLs

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 278–290, 316–327, and 401–408
Vulnerability Type: Unrestricted outbound requests and unbounded file download
Risk Level: Medium

Vulnerable Code

python
media_id = token["mediaId"]
upload_url = token["upload"]["url"]
upload_method = token["upload"].get("method", "PUT")
upload_headers = token["upload"].get("headers", {})

# PUT to object storage without the API key, using the returned headers
print(f"[2/3] Uploading file to object storage...")
with open(str(path), "rb") as f:
    try:
        oss_resp = requests.request(
            upload_method, upload_url, headers=upload_headers,
            data=f, timeout=300,
        )
python
def download_file(url, out_path, timeout=300):
    """Stream a file download with progress reporting."""
    print(f"[download] {out_path.name}")
    try:
        resp = requests.get(url, stream=True, timeout=timeout)
        resp.raise_for_status()
        total = int(resp.headers.get("content-length", 0))
        downloaded = 0
        with open(str(out_path), "wb") as f:
            for chunk in resp.iter_content(chunk_size=8192):
                if chunk:
                    f.write(chunk)
                    downloaded += len(chunk)
python
for i, item in enumerate(succeeded):
    result_url = item.get("resultUrl")
    if not result_url:
        continue
    ext = ".mp4" if "video" in task_type.lower() else ".png"
    filename = f"{task_type}_{task_id}_{i+1}{ext}"
    out_path = out_dir / filename
    download_file(result_url, out_path)

Technical Analysis

The upload-token response controls the upload URL, HTTP method, and request headers. The task response similarly controls result download URLs. These values are used without validating the URL scheme, destination hostname, resolved IP address, port, redirect target, or permitted H ...[truncated 2109 chars]

Remediation
View remediation

Remediation Suggestions

  1. Allow only HTTPS upload and download URLs.
  2. Maintain explicit allowlists for approved object-storage and result-delivery hostnames.
  3. Resolve destination hostnames and reject loopback, link-local, private, reserved, multicast, and cloud metadata address ranges.
  4. Repeat destination validation after DNS resolution and for every redirect target to mitigate DNS rebinding and redirect-based bypasses.
  5. Disable redirects by default or handle them manually with validation at each hop.
  6. Restrict upload methods to the methods required by the documented protocol, such as PUT.
  7. Filter server-provided upload headers and reject sensitive or unexpected headers.
  8. Enforce configurable maximum upload and download sizes.
  9. Abort a download once the received byte count exceeds the permitted limit, regardless of the declared Content-Length.
  10. Validate response media types and, where practical, inspect file signatures before assigning trusted extensions.
  11. Write downloads to a temporary file and atomically move them into place only after all validation succeeds.

T08 · Insecure Dependencies

Note
Location
scripts/imagegen.py:14
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 14–19; installation guidance in SKILL.md, line 81
Vulnerability Type: Unpinned dependency and non-reproducible installation
Risk Level: Low

Vulnerable Code

python
try:
    import requests
except ImportError:
    print("Missing dependency: requests. Run pip3 install requests", file=sys.stderr)
    sys.exit(1)

The documented installation command is:

bash
pip3 install requests

Technical Analysis

The project depends on the third-party requests package but does not provide a pinned dependency version, lockfile, or package hash. Users are instructed to install whichever release the package resolver selects at installation time.

This makes installations non-reproducible and prevents reviewers from establishing that every deployment uses the same audited dependency artifact. If a future dependency release or its distribution channel is compromised, users following the documented command could install code that differs from the version originally assessed.

The audited project names the legitimate requests package rather than an apparent typosquatted package, and no malicious dependency is embedded in the repository. The risk is therefore a supply-chain hardening deficiency rather than evidence of an active dependency attack.

Attack Path

  1. A user runs the documented pip3 install requests command.
  2. The package resolver selects the latest version permitted by the environment at that time.
  3. If that package release, a transitive dependency, the configured package index, or the delivery channel has been compromised, the user retrieves an unreviewed artifact.
  4. Package installation or later import executes code from that artifact with the privileges of the user running the Skill.

Impact Assessment

A compromised dependency executes under the account that installs or runs the Skill. It could ac ...[truncated 319 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add a dependency manifest with an explicitly reviewed requests version.
  2. Generate and commit a lockfile that includes all transitive dependencies.
  3. Record and enforce cryptographic hashes for downloaded distributions, such as with pip's --require-hashes mode.
  4. Document installation from the official Python Package Index or an authenticated internal mirror.
  5. Run dependency vulnerability scanning in continuous integration.
  6. Establish a controlled dependency-update process that reviews release notes and security advisories before changing pinned versions.
  7. Prefer installation in an isolated virtual environment with only the permissions required to run the Skill.
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 (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose is GEO content writing, but the documented behavior extends into generic account queries, model enumeration, chat, image/video generation, polling, and downloads. This mismatch undermines least surprise and least privilege: a user invoking a writing skill could unintentionally authorize broad API operations, including billable actions and access to account metadata unrelated to the stated task.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises executable workflows involving environment variables, local file access, shell commands, and network calls, but it does not declare any explicit tool scope or permissions boundary. That creates a confused-deputy risk where an agent may invoke broader capabilities than reviewers or users expect, increasing the chance of secret exposure, unintended file access, or outbound requests to external services.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The trigger phrases include broad common terms such as FAQ, 品牌内容, and 知乎回答, which can cause the skill to activate in contexts far outside its intended use. Over-broad invocation increases the chance that users are routed into a skill with networked and billable side effects they did not intend to use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language instruction explicitly requires a "production-ready Chinese workflow," which imposes a specific language choice regardless of user preference. The policy requires either user choice or a clearly justified locale constraint, neither of which is present here.

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 presents its primary user-facing description entirely in Chinese, and the same pattern continues through prompts and help strings elsewhere in the file. Because the skill does not offer a user language option or explain that it is intentionally limited to Chinese-speaking users, it creates a language/locale policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The implementation materially diverges from the declared skill purpose: instead of a constrained GEO content-writing workflow, it exposes a general-purpose AI Hive image generation/upload/task client. This expands capability beyond user and platform expectations, increasing the risk of unauthorized media generation or misuse under the cover of a narrower content-writing skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill exposes standalone upload and image generation commands that can be invoked independently of any GEO-content workflow. That makes the skill a broader media-generation utility than advertised, which can bypass governance, auditing, or policy controls that would apply if the tool were limited to the stated business purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The manifest description and title are written as if the skill is intended to operate in Chinese, and the listed platforms and examples are all China-specific, but the file does not clearly state whether users may choose another language. Under the language/locale policy, a fixed locale should be opt-in or explicitly justified.

Content

No source excerpt is available for this finding.