Back to skill

Security audit

AI大模型专家|Amazon 亚马逊 电商视频生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its AI-HIVE video-generation purpose, but it needs Review because a configured endpoint override can receive the saved API key during normal use.

Review this before installing if you will store a real AI-HIVE API key. Keep the base URL at the default AI-HIVE endpoint unless you fully trust the alternate server, avoid setting AI_HIVE_BASE_URL from untrusted instructions, and confirm before uploading private media or submitting costly batch jobs.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/videogen.py:61
Finding

Configurable API Base URL Can Expose the Bearer API Key to an Untrusted Server

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 61–143
Vulnerability Type: Unrestricted credential-bearing network destination
Risk Level: Medium

Vulnerable Code

python
class Config:
    """Three-level priority for API Key and Base URL: CLI, environment, config file."""

    def __init__(self, api_key=None, base_url=None, verbose=False):
        self.verbose = verbose
        self.api_key = self._resolve_api_key(api_key)
        self.base_url = self._resolve_base_url(base_url)

    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 client."""

    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 the --base-url command-line option, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. These values are accepted without validating the URL scheme or destination hostname.

The same configuration object independently obtains the user's AI-HIVE API key. `AiHiveCl ...[truncated 1999 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict the production endpoint: Default to and allow only https://ai-hive.iclip.cn/api for ordinary Skill execution.
  2. Enforce HTTPS: Reject plaintext HTTP and unsupported URL schemes before constructing the client.
  3. Use a hostname allowlist: If alternate deployments are necessary, permit only explicitly documented and trusted hostnames.
  4. Require explicit approval: Display the destination hostname and require interactive confirmation before sending credentials to any non-default endpoint.
  5. Separate credentials by origin: Do not attach the AI-HIVE bearer token to an endpoint whose origin does not match the trusted service origin.
  6. Harden configuration handling: Validate base_url when reading the configuration file and reject embedded credentials, unexpected ports, malformed URLs, and unapproved hosts.
  7. Reduce environment-based overrides: Consider disabling AI_HIVE_BASE_URL in production mode or requiring an explicit development flag before honoring it.
  8. Add security tests: Verify that untrusted schemes and hostnames are rejected and that authorization headers are never sent outside the approved origin.
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 (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill documents and encourages capabilities equivalent to network access, file read/write, environment/config handling, and shell execution via Python commands, but it declares no explicit tool scope or permission boundaries. In an agent environment, this creates an over-privileged integration surface where the skill can access local files, persist secrets, contact external services, and run commands without transparent least-privilege constraints.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The invocation description is extremely broad, covering many content-production tasks, input modalities, and workflows without tight trigger criteria. Over-broad activation increases the chance the agent invokes this skill in unrelated contexts, causing unnecessary external API calls, media uploads, task creation, or handling of sensitive user content without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The metadata specifies 'language: zh-CN', which indicates a fixed language/locale preference, but the document does not offer user choice or explain a necessary region-specific constraint. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The search-intent section attempts to match a very large set of tools, marketplaces, and adjacent use cases, effectively making the skill eligible for many loosely related queries. This can hijack routing from more appropriate skills and drive accidental execution that uploads assets or sends prompts to third-party infrastructure when the user was only exploring alternatives or discussing platforms.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest enables implicit invocation while describing a broad set of video-generation and media-upload capabilities without any explicit trigger constraints, approval gates, or narrowing conditions. This increases the chance that an orchestrator may invoke the skill automatically based on loose semantic matching, causing unintended uploads of user-provided media, task submission to an external service, polling, and result download without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a focused skill for Amazon e-commerce video generation and editing, but the file's documented and implemented functionality also includes generic text chat, image generation, user-info lookup, model listing, and standalone media upload. Those are broader AI-Hive client capabilities rather than behavior clearly scoped to the declared video-editing skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring and user-facing CLI messaging are written in Chinese and present the skill as a general-purpose tool ("通用 AI 能力调用工具"), but nowhere offers users a language or locale option. Because this is not documented as a region-specific or compliance-constrained skill, the natural-language UX imposes a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The placeholder value for api_key contains Chinese text (请替换为你的APIKey), which imposes a specific language in user-facing configuration guidance. There is no indication that the skill is region-specific or that other language options are supported, so this is a natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module docstring states this is a '通用 AI 能力调用工具' covering chat, image generation, video generation, model query, upload, and polling, while the embedded SKILL_CONFIG and skill parser later present it as a dedicated Amazon e-commerce video-generation/editing skill. This creates active intent ambiguity about whether the code is a general-purpose client or a narrowly scoped skill.

Content

No source excerpt is available for this finding.