Back to skill

Security audit

Seedream 5.0 Lite 种草图片

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its image-generation purpose, but a download-path bug could let a compromised service overwrite files outside the chosen output folder.

Review before installing. Use this only with images you are allowed to upload to AI Hive, prefer an isolated output directory, and avoid running it in a highly privileged account until the download filename handling is fixed. Pin dependencies before production use.

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

Warning
Location
scripts/imagegen.py:340
Finding

Server-Controlled Path Traversal in Result Downloads

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 340-361
Vulnerability Type: Path traversal leading to arbitrary file overwrite
Risk Level: Medium

python
# Download results
out_dir = Path(output_dir)
out_dir.mkdir(parents=True, exist_ok=True)
task_type = task.get("taskType", "task")
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)

# Last frame
for item in succeeded:
    last_frame = item.get("lastFrameUrl")
    if last_frame:
        out_path = out_dir / f"{task_type}_{task_id}_lastframe.png"
        download_file(last_frame, out_path)

Technical Analysis

The application constructs output paths using taskType, which is taken directly from the remote task response. The value is not restricted to a safe filename character set, reduced to a basename, or checked for path separators and traversal sequences.

When a value containing components such as ../ is joined with out_dir, Python's Path object preserves those components. The resulting path can therefore resolve outside the user-selected output directory. The subsequent download_file() operation opens that path in wb mode, allowing an existing accessible file to be overwritten with downloaded content.

The fixed API endpoint reduces exposure under normal operation, but the client still treats remotely supplied task metadata as trusted filesystem input. Exploitation would require a malicious or compromised API service, manipulation of the API response in a trusted network path, or another condition that lets an attacker control task metadata.

Attack Path

  1. The user submits or queries an image-generation task.
  2. A malicious or compromised API ...[truncated 1504 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not use remotely supplied task metadata as a filesystem path component.
  • Generate filenames from locally controlled identifiers and fixed prefixes.
  • If taskType must be retained, normalize it to a strict allowlist such as [A-Za-z0-9_-] and reject all path separators, . components, control characters, and empty values.
  • Resolve both the output directory and destination path, then verify containment before opening the file:
python
import re

safe_task_type = re.sub(r"[^A-Za-z0-9_-]", "_", task_type)
safe_task_id = re.sub(r"[^A-Za-z0-9_-]", "_", str(task_id))

base_dir = Path(output_dir).expanduser().resolve()
base_dir.mkdir(parents=True, exist_ok=True)

filename = f"{safe_task_type}_{safe_task_id}_{i + 1}{ext}"
destination = (base_dir / filename).resolve()

if destination.parent != base_dir:
    raise SystemExit("Unsafe output path returned by task service")
  • Apply the same validation to regular result files and last-frame files.
  • Consider exclusive file creation or explicit overwrite confirmation to prevent unintended replacement of existing files.
  • Add automated tests covering absolute paths, ../, nested traversal, platform-specific separators, control characters, and malicious task identifiers.

T08 · Insecure Dependencies

Note
Location
SKILL.md:74
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 74
Vulnerability Type: Unpinned dependency and non-reproducible installation
Risk Level: Low

bash
pip3 install requests

Technical Analysis

The installation instructions retrieve the latest package version that satisfies the package name at installation time. No reviewed version, lock file, or cryptographic hash is specified.

The referenced requests package is legitimate, and the instructions do not use a suspicious package name or untrusted package index. Nevertheless, accepting whichever release and transitive dependency set is current makes installations non-reproducible and expands supply-chain exposure. A future compromised or vulnerable release could be installed without a corresponding review of this Skill.

Attack Path

  1. A user follows the documented setup command.
  2. pip contacts its configured package index and resolves the current requests release and applicable transitive dependencies.
  3. If a resolved package or distribution artifact has been compromised, or if the user's configured index is malicious, the unsafe artifact is downloaded.
  4. Package installation processes the artifact under the privileges of the user running pip.
  5. Malicious installation behavior or vulnerable runtime code can then affect the environment in which the Skill executes.

This finding represents supply-chain risk rather than evidence that the currently named dependency is malicious.

Impact Assessment

The potential scope is the Python environment and operating-system account used for installation. A compromised dependency could execute code during installation or when imported by the Skill, access data available to that user, tamper with the environment, or intercept API keys and uploaded content.

Actual impact depends on compromise of the selected package source or release. No such compromise was identified during this audit, so the ...[truncated 22 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin requests and all transitive dependencies to reviewed versions.
  • Maintain dependencies in a lock file generated through a controlled dependency-management process.
  • Record cryptographic hashes and install with hash enforcement, for example through pip install --require-hashes -r requirements.txt.
  • Use an explicitly trusted package index and prevent fallback to unapproved indexes.
  • Run dependency vulnerability and integrity checks as part of release preparation.
  • Periodically update pinned versions through a reviewed process rather than resolving unrestricted versions during end-user installation.
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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (6)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill exposes shell, file, environment, network, and write capabilities through documented commands, but it does not declare any explicit tool scope or permission boundaries. That makes it easier for an agent runtime to invoke broader capabilities than necessary, increasing the blast radius if the skill is misused, modified, or prompt-injected through surrounding context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This is a markdown file, so vague-trigger review applies. The description says to use the skill for broad categories such as 'Instagram UGC', '生活方式内容', and similar social-content scenarios without clear trigger boundaries or exclusions, which could overlap with many ordinary content-generation requests and make invocation criteria ambiguous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language guidance is predominantly in Chinese and targets Chinese social-media formats such as 小红书 and 抖音, but it does not explicitly offer a language or locale choice. Under the policy, forcing a specific language or locale without user opt-in can be a violation unless clearly documented as region-specific.

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 in Chinese, and the skill does not provide any user option to select another language. This creates a natural-language locale constraint that is not presented as optional or justified as a region-specific requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The sample value 请替换为你的APIKey is a natural-language instruction embedded directly in the config example and assumes Chinese as the user-facing language. For a general-purpose skill artifact, this can violate language/locale policy because no opt-in or justification for the locale-specific wording is provided.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest describes a content-generation skill for producing layered recommendation visuals with authorized media via AI Hive. While calling the image API is expected, the separate interactive account/login bootstrap capability goes beyond the visual-generation purpose and introduces a user-account management/onboarding function not mentioned in the manifest.

Content

No source excerpt is available for this finding.