Back to skill

Security audit

拼多多 电商视频生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but it can send a stored AI Hive API key to an arbitrary configured API endpoint, which users should review carefully before installing.

Install only if you trust AI Hive and keep the default official base URL. Do not run commands or accept environment/config changes that set --base-url, AI_HIVE_BASE_URL, or config base_url to an unknown host, because that can expose your AI Hive API key. Consider pinning 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

Error
Location
scripts/videogen.py:75
Finding

API Credential Disclosure Through an Unrestricted Base URL

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:75-84, scripts/videogen.py:123-138, and scripts/videogen.py:859-860
Vulnerability Type: Credential disclosure through an attacker-controlled API endpoint
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
class AiHiveClient:
    """Encapsulates AI Hive OpenAPI HTTP calls."""

    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
            )
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="Detailed logs")

Technical Analysis

The API base URL can be supplied through the --base-url argument, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. The value is accepted without validating its scheme, hostname, port, embedded user information, or trust relationship with the API key.

AiHiveClient automatically places th ...[truncated 2060 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove custom base URL support if alternate API endpoints are not required.
  2. If custom endpoints are necessary, parse URLs with urllib.parse.urlsplit and require:
    • The https scheme.
    • An explicit allowlist of trusted hostnames.
    • No embedded username or password.
    • Approved ports only.
  3. Bind stored credentials to the origin for which they were created. Do not send the default AI Hive key to any other origin.
  4. Require explicit interactive confirmation before using a stored credential with a non-default endpoint.
  5. Require users to provide a separate credential explicitly when using a custom endpoint.
  6. Disable or carefully validate cross-origin redirects so authorization headers cannot reach an unintended host.
  7. Add automated tests that verify rejection of HTTP URLs, look-alike domains, URL user information, unapproved ports, and attacker-controlled hosts.
  8. Document the trust implications of endpoint overrides and recommend immediate key rotation if a key has been sent to an untrusted endpoint.

T08 · Insecure Dependencies

Note
Location
SKILL.md:66
Finding

Unpinned Runtime Dependency Installation

Content
View full analysis

Vulnerability Details

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

Vulnerable Code

bash
pip3 install requests

Technical Analysis

The installation instructions install requests without a fixed version, bounded version range, lock file, or integrity hash. The package version selected therefore depends on the package index and repository state at installation time.

No evidence indicates that requests itself is malicious or that the package name is typosquatted. The risk arises from non-reproducible dependency resolution and unconditional trust in future package releases and the user's configured package index. A compromised package index, malicious mirror, or compromised future release could introduce code that executes in the user's Python environment.

Attack Path

  1. A user follows the documented setup command.
  2. pip3 queries the user's configured Python package index or mirror.
  3. The resolver selects the latest dependency version available at that time rather than a reviewed version.
  4. If the selected distribution or package index has been compromised, pip installs the compromised artifact.
  5. Malicious package code can execute during installation or when videogen.py imports requests.

Exploitation depends on compromise or malicious control of the configured package supply chain; the repository does not itself provide a malicious dependency.

Impact Assessment

A compromised dependency would execute with the privileges of the user installing or running the Skill. Depending on those privileges, it could access local files, environment variables, API credentials, and network resources available to that user.

In the absence of supply-chain compromise, the more likely impact is inconsistent behavior or compatibility failures caused by unreviewed future versions.

Remediation
View remediation

Remediation Suggestions

  1. Define dependencies in a reviewed requirements or lock file.
  2. Pin requests and its transitive dependencies to tested versions.
  3. Use package hashes and install with pip install --require-hashes -r requirements.txt where feasible.
  4. Obtain packages only from an approved HTTPS package index.
  5. Establish a dependency-update process that reviews security advisories and tests new versions before changing the lock file.
  6. Consider generating the locked dependency set with a reproducible dependency-management tool such as pip-tools.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes shell commands, installs packages, accesses files, and appears to perform networked task submission, but it does not declare any explicit tool restrictions or permissions. That creates an overly broad execution surface where an agent may grant or assume capabilities beyond what is minimally necessary, increasing the risk of unintended command execution, data exposure, or outbound requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest description and all user-facing instructions are written entirely in Chinese, and the skill name/purpose specifically targets a Chinese e-commerce platform without stating that the locale is optional or user-selectable. Under the policy rule, forcing a specific language without opt-in is a natural-language policy concern unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring and large parts of the code expose a generic AI Hive client with text chat, image generation, model listing, and account inspection capabilities, not just Pinduoduo-focused video creation/editing. While some shared infrastructure is expected, these end-user commands materially broaden the behavior beyond the manifest’s stated ecommerce video scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file-level description is written entirely in Chinese and presents the tool as a general-purpose skill, but it does not indicate that Chinese is required or provide any language/locale opt-in. This creates a natural-language locale policy issue because the skill experience is effectively fixed to one language for all users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Throughout the code, user-visible errors, prompts, and progress messages are emitted only in Chinese, starting with the dependency error here and continuing across the CLI workflow. Because the skill does not offer a language selection or disclose a justified locale restriction, it enforces 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
93% confidence
Finding

This markdown file contains user-facing natural-language content exclusively in Chinese across the substantive entries. Under the language/locale policy rule, forcing a specific language without user opt-in or documented justification is a policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

Fetching user profile and wallet balance is an account-management feature, not an obvious requirement for creating Pinduoduo product videos. This capability is exposed as a user-facing command and falls outside the skill’s declared business purpose.

Content

No source excerpt is available for this finding.