Back to skill

Security audit

Seedream 5.0 Lite 图片编辑

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its image-editing purpose, but it needs review because it trusts service-provided upload and download URLs and can persist an API key locally.

Install only if you are comfortable giving this skill an AI Hive API key, uploading the exact images you pass on the command line, and allowing it to download generated files. Prefer a dedicated Python environment, avoid running with elevated privileges, and treat the unvalidated upload/download URL handling as something the publisher should tighten before use with sensitive images or restricted networks.

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

Note
Location
SKILL.md:74
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:74 and scripts/imagegen.py:7, 21
Vulnerability Type: Unpinned third-party dependency
Risk Level: Low

The project instructs users to install requests without constraining its version or verifying package integrity.

text
pip3 install requests

The same installation instruction appears in the script:

python
"""AI Hive image generation task utility.

Only exposes image generation for the fixed model, permitted reference-image
uploads, task queries, and API key initialization.
It queries model and routing prices during generation, then polls and downloads
the result.

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

Technical Analysis

The package name is legitimate and no dependency confusion or typosquatting is directly present in the repository. However, the installation command resolves a mutable package version from whichever Python package index is configured on the user's system. There is no lock file, exact version constraint, hash verification, or documented trusted index.

Consequently, the code that is eventually imported has not necessarily been reviewed with the skill. Exploitation requires compromise of the configured package index, a malicious package release, an unsafe mirror, or hostile pip configuration. This is a supply-chain hardening weakness rather than evidence that the current requests package is malicious.

Attack Path

  1. A user follows the documented pip3 install requests instruction.
  2. Pip connects to the user's configured index or mirror and resolves the latest acceptable release.
  3. An attacker who controls or has compromised that distribution channel supplies a malicious package artifact.
  4. The artifact is installed i ...[truncated 629 chars]
Remediation
View remediation

Remediation Suggestions

  • Add a reviewed dependency manifest with an exact version, such as requests==X.Y.Z.
  • Generate and verify cryptographic hashes, for example with a hash-locked requirements file and pip install --require-hashes.
  • Use a lock-file workflow and periodically update dependencies after security review.
  • Recommend python3 -m pip so installation targets the interpreter used to execute the script.
  • Document a trusted package index and discourage installation from untrusted mirrors.
  • Run the skill in a dedicated virtual environment without administrative privileges.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:231
Finding

Unvalidated Server-Provided Upload and Download URLs

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:231-242, 263-280, 352-359
Vulnerability Type: Server-directed request forgery and unbounded file download
Risk Level: Medium

The upload process accepts a URL, HTTP method, and headers from the API response and uses them without validating the scheme, hostname, resolved address, method, or redirect destination:

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

# Upload to object storage without the API key, using 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,
        )
    except requests.exceptions.RequestException as e:
        raise SystemExit(
            f"Object-storage upload network error: {e}\n"
            "Check the network connection or whether the file is too large"
        )

The result downloader likewise performs an unrestricted request to a server-provided URL and writes the response until the server closes the stream. No maximum response size or content-type check is applied:

python
def download_file(url, out_path, timeout=300):
    """Stream a file download while displaying progress."""
    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)
                    if total > 0:
           
...[truncated 4206 chars]
Remediation
View remediation

Remediation Suggestions

  • Require HTTPS for every upload and download URL.
  • Maintain an explicit allowlist of approved object-storage and result-delivery hostnames.
  • Resolve destination hostnames and reject loopback, link-local, private, multicast, reserved, and unspecified IP ranges.
  • Repeat destination validation after every DNS resolution and redirect to reduce DNS-rebinding and redirect-based bypasses.
  • Disable redirects by default or follow only a small number of redirects whose destinations pass the same validation.
  • Restrict upload methods to the explicitly expected methods, preferably only PUT or POST.
  • Allowlist returned upload headers rather than forwarding arbitrary server-provided headers.
  • Enforce a configurable maximum upload and download size.
  • Reject a download before writing when a valid Content-Length exceeds the limit, while also enforcing the limit against bytes actually streamed.
  • Validate the response Content-Type and, where practical, verify image signatures before accepting the file.
  • Download into a securely created temporary file and atomically move it into place only after successful size and type validation.
  • Delete partial files when a request fails or violates a limit.
  • Apply connect and read timeouts separately and consider a total transfer-duration limit.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared behavior promises a constrained, ordered image-editing workflow, but the documented commands indicate broader capabilities such as standalone task querying, upload/init flows, browser opening, and local API key persistence. This mismatch is dangerous because users and orchestrators may trust the skill as narrowly scoped image editing while it can perform additional side effects and does not actually enforce the claimed sequencing controls.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill exposes shell, file, environment, and network-capable behavior without any declared tool scope or permission boundary in the manifest. That makes the effective capabilities broader than a caller may expect, increasing the chance of unintended file access, key persistence, network egress, or command execution if the skill is invoked in a permissive runtime.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description lists many generic invocation phrases such as '图片编辑', '局部修改', '照片调整', and '商品图编辑' without clear scope boundaries or exclusion conditions. These broad terms could match everyday requests and cause unintended activation beyond the narrowly defined Seedream 5 Lite workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file is written as a Chinese-only operational specification and does not indicate that users may choose their preferred language or locale. Because the skill appears generally applicable rather than region-specific, this creates a natural-language policy concern around implicit language forcing without opt-in.

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 natural-language strings and help text that are consistently Chinese-only, starting from the module docstring and continuing throughout the CLI UX. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest positions this skill as a Seedream 5 Lite image-editing tool for authorized reference images and localized modifications. However, the CLI exposes a generic generate command described as "生成或编辑图片", supports arbitrary prompts, and also separately exposes task querying and standalone upload, which makes the skill function as a broader image-generation/task client rather than a narrowly scoped edit skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example value for api_key includes a Chinese-only placeholder string (请替换为你的APIKey), which imposes a specific language in user-facing natural language. The file does not offer an alternative locale or explain why Chinese is required, so it 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
91% confidence
Finding

The top-level docstring describes the tool as exposing fixed-model image generation, limited reference-image upload, task query, and API key initialization, but frames the purpose as an image generation task tool. In this specific skill build, the declared skill intent is Seedream 5 Lite image editing, while the code-level help and commands still present a more generic generation tool, creating a documentation-to-implementation intent mismatch.

Content

No source excerpt is available for this finding.