Back to skill

Security audit

广告首帧动态化|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches an AI-HIVE video-ad workflow, but it handles API credentials with an overrideable endpoint that could expose the key if misconfigured or influenced.

Review before installing. Use this skill only with an AI-HIVE API key you can revoke, do not set AI_HIVE_BASE_URL or base_url to anything except the official HTTPS endpoint, and confirm every upload or paid generation step. Treat the bundled generic AI-HIVE code as broader than the advertised ad-first-frame workflow.

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/videogen.py:91
Finding

Bearer Credential Can Be Sent to an Unrestricted Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:91-99, 130-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
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 a command-line argument, the AI_HIVE_BASE_URL environment variable, or the local configuration file. The value is accepted without validating its scheme, hostname, port, or relationship to the expected AI-HIVE service.

The HTTP client subsequently adds the AI-HIVE bearer credential to every request made through that base URL. Consequently, an attacker who can influence the process environment, command invocation, or configuration file can redirect authenticated requests to an attacker-controlled server. The implementation also permits an http:// endpoint, which can expose the credential to network interception.

Custom endpoint support is not necessary for the Skill's declared single-service integration and therefore exceeds the minimum privileges requir ...[truncated 1176 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict authenticated requests to the expected HTTPS origin, such as https://ai-hive.iclip.cn/api.
  2. Parse the configured URL with urllib.parse.urlparse and reject unsupported schemes, embedded credentials, unexpected hostnames, and unexpected ports.
  3. Reject plaintext HTTP for any request carrying an API credential.
  4. Construct the Authorization header only after the destination has passed validation.
  5. If custom endpoints are needed for testing, require an explicit development-only switch and separate credentials that cannot access production resources.
  6. Warn or terminate when the environment variable and configuration file attempt to override the production origin.
  7. Add automated tests verifying that malicious hosts, redirects, plaintext URLs, user-information components, and malformed URLs cannot receive the bearer token.
  8. Consider disabling automatic redirects or validating every redirect destination before forwarding authorization headers.

T08 · Insecure Dependencies

Note
Location
scripts/videogen.py:8
Finding

Unpinned Runtime Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:8-12 and SKILL.md:76-78
Vulnerability Type: Unpinned third-party dependency
Risk Level: Low

Vulnerable Code

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

The Skill documentation likewise states that requests is required but does not provide a version constraint, lockfile, package hash, isolated installation procedure, or verified package source.

Technical Analysis

The project relies on the third-party requests package and directs users to install it by name without pinning a reviewed version or its transitive dependencies. Package resolution can therefore produce different dependency sets over time.

The package name is legitimate and no malicious dependency was identified in the audited files. Nevertheless, the installation process lacks reproducibility and supply-chain controls. A future compromised release, compromised package index, malicious index configuration, or incompatible dependency update could introduce code that executes with the privileges of the user running the Skill.

Attack Path

  1. The requests dependency is absent from the user's Python environment.
  2. The user follows the runtime installation instruction.
  3. pip resolves the package and transitive dependencies from its configured package indexes without project-provided version or hash restrictions.
  4. A compromised index, package release, or transitive dependency is selected.
  5. Malicious package installation or import-time code executes under the user's account.
  6. The malicious dependency may access files, environment variables, API credentials, and network resources available to that account.

Impact Assessment

Exploitation would run dependency code with the privileges of the user or environment installing and executing the Skill. Dependi ...[truncated 367 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add a reviewed dependency manifest with an explicit compatible version range or exact version.
  2. Generate a lockfile that also fixes transitive dependency versions.
  3. Where supported, require package hashes using a hash-locked requirements file.
  4. Document installation through python -m pip inside a dedicated virtual environment.
  5. Specify the trusted package index and avoid untrusted supplemental indexes.
  6. Add automated dependency vulnerability and integrity scanning to the release process.
  7. Periodically review and deliberately update the locked dependency set rather than accepting automatic changes at installation time.
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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared scope is a specialized ad-first-frame assistant, but the finding indicates undeclared generic text chat, image generation, model discovery, and account/info retrieval behavior. Undeclared broad capabilities expand the attack surface and can expose user data or trigger actions outside the user’s reasonable expectations for this narrowly branded skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared scope is a specialized ad-first-frame assistant, but the finding indicates undeclared generic text chat, image generation, model discovery, and account/info retrieval behavior. Undeclared broad capabilities expand the attack surface and can expose user data or trigger actions outside the user’s reasonable expectations for this narrowly branded skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared scope is a specialized ad-first-frame assistant, but the finding indicates undeclared generic text chat, image generation, model discovery, and account/info retrieval behavior. Undeclared broad capabilities expand the attack surface and can expose user data or trigger actions outside the user’s reasonable expectations for this narrowly branded skill.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill includes executable code examples that use environment variables, local files, network access, and shell commands, but it does not declare any tool scope or permission boundaries. In an agent environment, this creates an overbroad execution surface where the agent may invoke sensitive capabilities without explicit restriction or user awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The description defines activation using Chinese-only phrases such as “首帧动态化” and “广告开场” without indicating that equivalent phrases in other languages are supported. This imposes a language-specific interaction model without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger conditions are broad and ambiguous across common marketing phrases, which increases the chance that the skill is invoked in contexts where the user did not intend media generation, file handling, or external API use. Overbroad activation is risky when the skill can lead to network calls, local processing, or potentially billable actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The natural-language instruction in the manifest says to turn requests into a "production-ready Chinese workflow," which imposes a specific language on users. The policy allows locale or language constraints only when users are given a choice or the restriction is clearly justified, neither of which is present here.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/edit_video.py (reported line 20)May include surrounding context.

python
def run(args: list[str]) -> None:
    print(" ".join(args))
    subprocess.run(args, check=True)


def main() -> None:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file presents itself as an ad first-frame animation skill, but the implementation is a broad, generic AI-Hive client supporting chat, image generation, model enumeration, uploads, and task management. This capability mismatch increases the attack surface and enables uses outside the declared purpose, undermining least-privilege and making policy bypass or unauthorized repurposing easier.

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 is entirely in Chinese and presents the skill as a general-purpose tool, but it does not indicate that Chinese is optional or that other languages are supported. For a broadly scoped skill, hard-coding a single language in user-facing instructions can violate language/locale policy when no user opt-in or justification is provided.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Exposing a user-info command gives this skill access to account metadata and wallet/balance information unrelated to first-frame ad animation. While not directly leading to code execution, it unnecessarily expands sensitive-data exposure and enables account reconnaissance if the skill is invoked in broader agent workflows.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The unrestricted text-chat endpoint allows arbitrary prompting against external models, which is unrelated to a narrowly scoped first-frame video skill. In an agent setting, this creates a covert general-purpose model access path that can be abused for unintended data handling, policy evasion, or unreviewed external interactions using the configured API key.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Standalone image generation is outside the declared scope of an ad first-frame animation video skill and introduces additional capability that can be misused independently of the intended workflow. This broadening of functionality increases attack surface, cost exposure, and the chance that the skill is used to generate unrelated or policy-violating content under the same trusted interface.

Content

No source excerpt is available for this finding.