Back to skill

Security audit

Seedance 视频生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its video-generation purpose, but users should review it because it handles API keys, uploads media, can spend service credits, and allows the API endpoint to be overridden without validation.

Install only if you are comfortable giving this skill an AI Hive API key and allowing it to upload selected media and submit potentially billable video-generation tasks. Use the default AI Hive endpoint, avoid copying commands that set a custom base URL, prefer the 0600 config file over `--api-key`, and confirm costs before batch generation.

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

Warning
Location
scripts/videogen.py:89
Finding

Bearer API Key Can Be Transmitted to an Arbitrary Configured Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:89-101, 127-143
Vulnerability Type: Unrestricted credential destination and missing transport validation
Risk Level: Medium

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
class AiHiveClient:
    """封装 AI Hive OpenAPI HTTP 调用。"""

    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 base URL can be supplied through the --base-url argument, the AI_HIVE_BASE_URL environment variable, or the configuration file. The value is accepted without validating its scheme or hostname.

The HTTP client subsequently adds the AI Hive bearer API key to every API request made through that base URL. Consequently, an arbitrary endpoint—including a plaintext HTTP endpoint or an attacker-controlled HTTPS host—can receive the credential.

This is particularly dangerous when commands or configuration files are copied from untrusted sources, or when environment variables are controlled by a wrapper script, CI configuration, or compromised parent process. Although chang ...[truncated 1382 chars]

Remediation
View remediation

Remediation Suggestions

  1. Allowlist the official API scheme and hostname by default:
    • Require https.
    • Require the hostname to equal ai-hive.iclip.cn.
    • Reject embedded credentials, unexpected ports, fragments, and malformed URLs.
  2. If custom endpoints are required for development, place them behind an explicit option such as --allow-custom-base-url.
  3. Display the normalized destination hostname and require interactive confirmation before sending credentials to a nonofficial host.
  4. Refuse plaintext HTTP whenever an authorization header is present.
  5. Consider separating official API operation from custom endpoint operation so that production credentials are never automatically reused with development servers.
  6. Document that base URL settings must not be copied from untrusted commands or configuration files.
  7. Add automated tests confirming that HTTP URLs, lookalike domains, hostname suffix tricks, and credential-bearing URLs are rejected.

T08 · Insecure Dependencies

Note
Location
SKILL.md:173
Finding

Third-Party Dependency Is Installed Without Version or Integrity Pinning

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:173-177
Vulnerability Type: Unpinned third-party dependency
Risk Level: Low

Vulnerable Code

bash
pip3 install requests

The script repeats the same installation guidance:

python
try:
    import requests
except ImportError:
    print("缺少依赖:requests。请运行 pip3 install requests", file=sys.stderr)
    sys.exit(1)

Technical Analysis

The installation instruction requests the latest version of requests available from the user's active Python package index. It does not constrain the dependency to a reviewed version, verify package hashes, or specify a trusted package source.

This makes installations mutable: two users following the same documentation at different times may receive different code. The effective source may also be changed through pip configuration, environment variables, mirrors, or a compromised package repository.

The package name itself is correctly spelled, so this is not evidence that the project intentionally introduces a malicious dependency. The issue is the absence of reproducible version and integrity controls around executable third-party code.

Attack Path

  1. The user follows the documented installation command.
  2. pip resolves requests through the currently configured package index or mirror.
  3. The selected package version is not constrained or hash-verified by this project.
  4. If the configured source or resolved release is compromised, pip installs attacker-controlled code.
  5. Malicious package code may execute during installation or when videogen.py imports and uses the package.

Impact Assessment

A compromised dependency can execute with the privileges of the user installing or running the Skill. Depending on those privileges, it could access local files, environment variables, the AI Hive API key, uploaded media, generated outputs, and network resources available to the process.

...[truncated 154 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add a reviewed dependency manifest or lock file with an exact requests version.
  2. Pin package hashes using a requirements file compatible with pip install --require-hashes.
  3. Include and pin relevant transitive dependencies when reproducible installation is required.
  4. Recommend installation using the active interpreter:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  5. Document the expected trusted package index and warn users that custom mirrors affect package provenance.
  6. Use automated dependency scanning and a controlled update process to review security advisories before changing pinned versions.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/videogen.py:585
Finding

API Key Can Be Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:585-588
Vulnerability Type: Sensitive credential accepted through process arguments
Risk Level: Low

Vulnerable Code

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_BASE_URL})")
    parser.add_argument("--verbose", action="store_true", help="详细日志")

The documentation explicitly presents command-line key usage:

text
--api-key sk-api-你的密钥

Technical Analysis

Passing a secret using --api-key places the complete credential in the process argument vector. Depending on the operating system and execution environment, command-line arguments may be exposed through process inspection tools, shell history, terminal recording, job metadata, CI logs, debugging output, or orchestration telemetry.

The application does support safer configuration mechanisms, but command-line credential handling remains available and is documented as a normal configuration option. The parser does not warn users about the disclosure risk.

Attack Path

  1. A user invokes the Skill with --api-key sk-api-....
  2. The shell may save the complete command in its history.
  3. While the command is running, the API key may be visible in the process argument list.
  4. CI systems, wrappers, audit tools, or terminal recorders may also retain the command.
  5. A local user or party with access to those records retrieves the credential.
  6. The exposed key can be reused against the AI Hive service until revoked or expired.

Impact Assessment

The attacker may obtain the same remote-service permissions as the exposed API key, including access to permitted API operations and potentially billable generation functionality.

This issue does not independently provide local privilege escalation. Exploitation generally requires acce ...[truncated 92 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove --api-key from recommended usage and prefer a permission-restricted configuration file or secret manager.
  2. For interactive use, accept the key through hidden input with getpass.getpass() rather than through the argument vector.
  3. For automation, inject the credential through a dedicated secret-management integration or a protected file descriptor.
  4. If environment variables remain supported, document that they may still be visible to privileged local processes and must be protected by the execution environment.
  5. If command-line support must remain for compatibility, print a prominent warning and mark the option as deprecated.
  6. Add guidance for removing accidentally stored secrets from shell history and rotating any exposed API key.
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)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises and documents capabilities that include reading environment variables, reading/writing local files, making network requests, and invoking shell commands, but it declares no explicit tool scope or permission boundaries. In an agent environment, this can lead to overbroad authority being granted by default, increasing the chance that normal user prompts trigger sensitive operations such as opening a browser, writing config files, or downloading remote content without clear policy gating.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The description contains an extremely broad set of trigger terms spanning generic video generation, editing, competing products, pricing, APIs, migration, and many commerce contexts. This makes accidental invocation likely, so users seeking general advice or comparison information could unintentionally activate a skill that uploads media, uses API keys, submits paid jobs, and writes local files.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown repeatedly states that broad search, comparison, migration, and platform-related intent is sufficient for the skill to act, without clear exclusion conditions or consent checkpoints. In context, this is risky because the skill is not just informational: it can initialize credentials, upload user media, poll tasks, and download artifacts, so broad matching can convert exploratory queries into side-effecting actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains natural-language user-facing descriptions and help text that are exclusively in Chinese, starting with the module docstring and continuing through CLI descriptions. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly justified, which is not stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file contains substantive user-facing natural language only in Chinese across the release notes. Under the policy rule for language/locale, forcing a specific language without opt-in can be a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
69% confidence
Finding

The file states the skill is for '中文或英文用户', which is a natural-language locale constraint. The documentation does not clearly present this as an optional language choice or explain why only those languages are supported.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring and the generic CLI builder describe a broad tool supporting text chat, image generation, video generation, model queries, media upload, and task polling. However, the actual script entrypoint at L940-L941 invokes skill_main(), whose parser only exposes Seedance-oriented generate/task/upload/init flows and does not expose the general chat/image/models/user-info commands described at the top of the file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The upload command prints that the returned mediaId can be passed to the chat/image/video commands, but the skill-specific parser built in this file only exposes generate/task/upload/init and accepts file paths rather than mediaId arguments for media inputs. This is an active contradiction in user guidance, not just missing detail.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.