Back to skill

Security audit

AI大模型专家|Seedream 5.0 Lite 图片生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its image-generation purpose, but it handles an API key in a way that could send it to an arbitrary configured server.

Install only if you trust AI-HIVE and are comfortable storing an API key locally and uploading prompts/reference media for remote processing. Do not set --base-url, AI_HIVE_BASE_URL, or config base_url to anything except the official AI-HIVE endpoint unless you use a separate disposable key. Prefer explicit invocation, confirm costs before batch jobs, and install dependencies in a pinned virtual environment.

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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/imagegen.py:105
Finding

Bearer Credential Disclosure Through an Unrestricted API Base URL

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:105-114, scripts/imagegen.py:128-130, and scripts/imagegen.py:557-559
Vulnerability Type: Unrestricted credential forwarding to a configurable network destination
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
self.headers = {
    "Authorization": f"Bearer {config.api_key}",
    "Content-Type": "application/json",
}
python
def add_common_args(parser):
    parser.add_argument("--api-key", help="AI Hive API Key (sk-api-*)")
    parser.add_argument("--base-url", help=f"API Base URL (default {DEFAULT_BASE_URL})")
    parser.add_argument("--verbose", action="store_true", help="Verbose logging")

Technical Analysis

The API base URL can be supplied through the --base-url command-line argument, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. The value is accepted without enforcing HTTPS or validating that its hostname belongs to the expected AI-HIVE service.

The HTTP client attaches the AI-HIVE bearer credential to every request made through this configurable base URL. Consequently, an attacker-controlled base URL receives the production API key in the Authorization header.

A custom endpoint can be useful for development, but automatically forwarding an existing production credential to any configured origin exceeds the minimum privilege required for the declared image-generation functionality. The weakness requires control over command arguments, environment variables, configuration, or instructions followed by the ...[truncated 1230 chars]

Remediation
View remediation

Remediation Suggestions

  1. Allowlist the production endpoint https://ai-hive.iclip.cn/api for normal Skill execution.
  2. Enforce HTTPS and reject plaintext HTTP endpoints.
  3. Parse URLs with a standard URL parser and compare normalized scheme, hostname, and port rather than using string-prefix checks.
  4. Do not forward a stored production credential when a custom endpoint is selected.
  5. If custom endpoints are necessary for development, require a separate credential and an explicit high-friction confirmation that identifies the destination hostname.
  6. Reject URLs containing embedded user information, unexpected ports, malformed hostnames, or redirect-based origin changes.
  7. Configure the HTTP client not to preserve the authorization header across cross-origin redirects.
  8. Document the trust boundary and warn users that changing the endpoint can expose prompts, uploaded media, task data, and credentials.
  9. Rotate any API key that may already have been used with an untrusted endpoint.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:258
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:258-262
Vulnerability Type: Mutable and unverifiable dependency installation
Risk Level: Medium

Vulnerable Code

markdown
### 1. Install dependencies

```bash
pip3 install requests
text

### Technical Analysis

The installation instructions retrieve the current release of `requests` and its transitive dependencies without pinning reviewed versions or verifying package hashes. The installed dependency graph can therefore change over time without any corresponding change to the audited Skill package.

The package name is legitimate and no dependency-confusion or typosquatting package was identified in the project. The risk arises from mutable resolution, lack of integrity verification, and possible future incompatibility or package-index compromise.

Because imported Python packages execute code in the context of the invoking user, a compromised dependency or transitive dependency could run arbitrary installation-time or import-time code.

### Attack Path

1. A user follows the documented `pip3 install requests` instruction.
2. `pip` resolves whatever package and transitive dependency versions are current on the configured package index.
3. A compromised index, compromised package release, malicious mirror, or future vulnerable release supplies unreviewed code.
4. The package executes installation or import logic with the privileges of the user running the command.
5. That code can access data and resources available to the user's Python process, including local files and environment variables.

### Impact Assessment

Exploitation through a compromised dependency can result in arbitrary code execution with the privileges of the user performing installation or running the Skill. Potentially exposed assets include the AI-HIVE key in the environment or configuration file, prompts, reference images, generated output, and other files accessible to that 
...[truncated 274 chars]
Remediation
View remediation

Remediation Suggestions

  1. Provide a reviewed dependency manifest with exact version pins.
  2. Include cryptographic hashes and install with pip install --require-hashes -r requirements.txt.
  3. Pin all transitive dependencies or generate a fully locked requirements file with a dependency-locking tool.
  4. Install dependencies in a dedicated virtual environment rather than the global Python environment.
  5. Use a trusted package index over HTTPS and avoid unverified mirrors.
  6. Add automated dependency scanning and a controlled process for reviewing and updating pinned versions.
  7. Document the supported Python version and periodically test the locked environment for compatibility and known vulnerabilities.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documentation describes operational behaviors that imply access to environment variables, local files, network calls, and shell execution, but it does not declare any explicit tool scope or permission boundaries. This creates an over-privileged integration surface where an agent may invoke sensitive capabilities without clear least-privilege constraints, increasing the risk of unintended file access, credential exposure, or arbitrary command execution if the surrounding platform auto-grants capabilities.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description is heavily keyword-stuffed and spans many adjacent domains, platforms, and use cases, making the invocation boundary ambiguous. Overbroad trigger criteria can cause the wrong skill to activate for unrelated user requests, potentially routing sensitive prompts, files, or API-backed actions to a tool the user did not intend to use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The search coverage section enumerates an excessively broad set of keywords, brands, channels, and model names without meaningful constraints. In agent ecosystems that use lexical matching for routing, this can hijack unrelated requests and lead to unapproved uploads, network actions, or paid task creation under the wrong skill 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 implicit invocation while exposing a very broad description and default prompt that authorize end-to-end image generation workflows through AI-HIVE, including upload, submission, polling, and download. Without explicit trigger constraints or tighter scoping, unrelated user requests may cause the agent to auto-select this skill and perform external actions or spend credits without sufficiently clear user intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring and the generic CLI implement broader AI Hive capabilities including text chat, video generation, model enumeration, user-info lookup, and media upload, not just Seedream 5.0 Lite image generation/editing. While the skill-specific entrypoint at the bottom narrows exposed commands, the file's documented purpose and substantial code behavior are materially broader than the manifest's image-focused scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file contains user-facing natural-language strings and help text that assume Chinese as the required language. The policy requires flagging language or locale constraints when the skill forces a specific language without user opt-in, and there is no indication that this skill is region-specific or offers language selection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The metadata sets 'language: zh-CN', which indicates a fixed locale preference. There is no accompanying note that this is optional, user-selected, or required for a region-specific compliance reason, so it may impose a language/locale constraint without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The example API key placeholder uses Chinese text ('请替换为你的APIKey'), which imposes a specific language in user-facing configuration content. There is no indication that the skill is region-specific or that users may choose another language, so this appears to violate the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The top-level docstring explicitly says this is a '通用 AI 能力调用工具' wrapping text chat, image generation, video generation, model query, media upload, and task polling. That directly conflicts with the manifest's representation of a Seedream 5.0 Lite image generation/editing skill, indicating documentation intent that is broader than the skill's declared purpose.

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 a Seedream 5.0 Lite image generation and editing skill, but the code supports querying user information via the user-info endpoint, and the CLI advertises wallet-balance retrieval. Inspecting account/profile/billing data is not necessary for generating or editing images and is not stated in the manifest.

Content

No source excerpt is available for this finding.