Back to skill

Security audit

品牌数字代言人内容日历|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its AI-HIVE media workflow purpose, but its scripts handle API keys, configurable endpoints, and downloads in ways that could expose credentials or write files outside the intended folder.

Review before installing. Use only the official AI-HIVE endpoint, do not set AI_HIVE_BASE_URL or --base-url to an untrusted server, and avoid storing production API keys unless needed. Treat uploads and downloads as sensitive because prompts, media, account metadata, and generated results may leave your machine or be written locally. Prefer a limited-scope API key and verify output directories before running generation tasks.

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

Error
Location
scripts/imagegen.py:91
Finding

API credentials can be transmitted to an arbitrary or plaintext endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:91-99, 129-145; duplicated in scripts/videogen.py:91-99, 129-145
Vulnerability Type: Improper validation of a credential-bearing 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
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

Both generation clients accept an unrestricted API base URL from a command-line argument, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. They then attach the AI-HIVE bearer credential to every request sent to that endpoint.

There is no validation that:

  • The scheme is HTTPS.
  • The destination host is the documented ai-hive.iclip.cn service.
  • Redirects remain on an approved host.
  • User information, model queries, task queries, and generation requests are sent only to a trusted service.

Consequently, a malicious or accidentally configured URL can receive the complete API key in the Authorization header. An http:// endpoint can additionally expose the credential and submitted data to network interception. Becau ...[truncated 1885 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove arbitrary base-URL overrides from production-facing commands unless they are strictly required for development.
  2. Parse the URL with urllib.parse.urlsplit and require:
    • scheme == "https"
    • An exact approved hostname such as ai-hive.iclip.cn
    • An expected port and path prefix
    • No embedded username or password
  3. Maintain an explicit endpoint allowlist rather than using suffix-based hostname checks.
  4. Reject plaintext HTTP whenever an authorization header is present.
  5. Disable automatic redirects for credential-bearing requests or validate every redirect target before resending authorization.
  6. Never forward an authorization header across origins.
  7. If custom endpoints are needed for testing, require a separate explicit development mode and a separate non-production credential.
  8. Validate a stored base_url before reading or using the stored API key.
  9. Apply the same remediation to both scripts/imagegen.py and scripts/videogen.py.
  10. Revoke and rotate keys used with an untrusted base URL.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:391
Finding

Server-controlled task fields permit output path traversal and arbitrary downloads

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:391-413; duplicated in scripts/videogen.py:391-413
Vulnerability Type: Path traversal and insufficient validation of remote download metadata
Risk Level: Medium

Vulnerable Code

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)

The destination is subsequently opened in overwrite mode:

python
with open(str(out_path), "wb") as f:
    for chunk in resp.iter_content(chunk_size=8192):
        if chunk:
            f.write(chunk)

Technical Analysis

The output filename is constructed from taskType and task_id without sanitizing path separators, absolute paths, or parent-directory components. taskType is obtained from the remote task response, while a task ID is initially obtained from a remote generation response.

Joining an untrusted value such as ../../target/name to out_dir does not constrain the resulting path to that directory. The subsequent open(..., "wb") call creates or truncates the resolved destination and follows symbolic links.

The corresponding resultUrl and lastFrameUrl values are also used without host, scheme, redirect, content-type, or download-size restrictions. A malicious or compromised API endpoint can therefore make the client:

  • Download content from an arbitrary HTTP ...[truncated 2408 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not use remote task fields directly in filenames. Map task types to fixed local labels, such as image and video.

  2. Restrict task IDs to a conservative character set, for example ^[A-Za-z0-9_-]{1,128}$.

  3. Generate local filenames independently with UUIDs where possible.

  4. Resolve and verify every destination before opening it:

    python
    root = Path(output_dir).expanduser().resolve()
    destination = (root / safe_filename).resolve()
    if destination.parent != root:
        raise SystemExit("Invalid output path")
    
  5. Reject absolute paths, .., path separators, null bytes, and platform-specific separator variants.

  6. Open new files with exclusive creation where overwriting is unnecessary, and explicitly address symbolic-link handling.

  7. Allow downloads only from approved HTTPS object-storage hosts.

  8. Disable redirects or validate each redirect destination.

  9. Set a maximum permitted response size and stop streaming once that limit is exceeded; do not rely solely on Content-Length.

  10. Validate the response content type and media signature before assigning an extension.

  11. Delete partial files when a download fails.

  12. Apply identical changes to both generation clients.

T08 · Insecure Dependencies

Note
Location
SKILL.md:65
Finding

Third-party dependency is installed without a pinned version or integrity verification

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:65-67; dependency use is also documented in scripts/imagegen.py:7-21 and scripts/videogen.py:7-21
Vulnerability Type: Unpinned third-party dependency
Risk Level: Low

Vulnerable Code and Instructions

markdown
The scripts default to `https://ai-hive.iclip.cn/api`; `requests` is required,
and local video processing requires `ffmpeg`.
python
try:
    import requests
except ImportError:
    print("Missing dependency: requests. Run pip3 install requests", file=sys.stderr)
    sys.exit(1)

The supplied installation direction is effectively:

bash
pip3 install requests

Technical Analysis

The project has no reviewed dependency lock file or hash-pinned requirements manifest. Users are instructed to install the latest package resolved under the name requests from their configured Python package index.

requests is a legitimate and widely used package; the audit found no evidence that this project intentionally references a typosquatted or malicious package. The security weakness is the lack of version and integrity controls. The installed artifact may vary over time or across package-index configurations, and a compromised index, mirror, resolver configuration, or future malicious release could execute code during installation or import.

System ffmpeg and ffprobe binaries are likewise discovered through PATH, but the reviewed helper invokes them without a shell and does not modify or spoof those tools.

Attack Path

  1. A user follows the documented instruction to run pip3 install requests.
  2. The user's package index or mirror has been compromised, misconfigured, or replaced by an attacker-controlled source.
  3. Pip resolves an attacker-controlled artifact under the expected package name or an unsafe future version.
  4. Installation hooks or imported package code execute with the privileges of the user p ...[truncated 849 chars]
Remediation
View remediation

Remediation Suggestions

  1. Add a reviewed dependency manifest with an explicitly tested requests version.
  2. For reproducible deployments, use hash pinning, such as a generated requirements file containing --hash entries.
  3. Install from the official Python Package Index or an authenticated internal mirror with provenance controls.
  4. Use a virtual environment and avoid privileged package installation.
  5. Add automated dependency vulnerability scanning and a controlled update process.
  6. Document a minimum supported Python version and tested ffmpeg version.
  7. Where available, verify packaged artifacts and system binaries through trusted package-manager signatures.
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims a domain-specific content-calendar purpose, but detected behavior includes generic image/video generation wrappers, model listing, account access, and interactive API-key/browser setup not described in the skill purpose. Such scope drift is risky because users may invoke the skill assuming a bounded planner, while it can instead trigger broader execution paths with billing, privacy, or operational consequences.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims a domain-specific content-calendar purpose, but detected behavior includes generic image/video generation wrappers, model listing, account access, and interactive API-key/browser setup not described in the skill purpose. Such scope drift is risky because users may invoke the skill assuming a bounded planner, while it can instead trigger broader execution paths with billing, privacy, or operational consequences.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims a domain-specific content-calendar purpose, but detected behavior includes generic image/video generation wrappers, model listing, account access, and interactive API-key/browser setup not described in the skill purpose. Such scope drift is risky because users may invoke the skill assuming a bounded planner, while it can instead trigger broader execution paths with billing, privacy, or operational consequences.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims a domain-specific content-calendar purpose, but detected behavior includes generic image/video generation wrappers, model listing, account access, and interactive API-key/browser setup not described in the skill purpose. Such scope drift is risky because users may invoke the skill assuming a bounded planner, while it can instead trigger broader execution paths with billing, privacy, or operational consequences.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a skill for generating brand digital-avatar content calendars and, when needed, interacting with AI-HIVE OpenAPI for asset-generation workflows such as config queries, uploads, routing, polling, and downloads. This file instead implements a generic local CLI wrapper around ffmpeg/ffprobe for probing, trimming, resizing, muting, normalizing, and concatenating videos, with no calendar logic, avatar/persona handling, or AI-HIVE integration.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises and includes executable command examples that rely on environment variables, local file access, network access, and shell execution, but it declares no explicit tool scope or permissions boundary. In an agent environment, this can lead to over-broad capability exposure and unsafe invocation of networked or filesystem-affecting operations without clear authorization controls.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation list includes the standalone phrase '内容日历', which can describe many ordinary content-planning requests not specific to brand avatars, digital spokespersons, or AI-HIVE workflows. Without added scope constraints or negative examples tied to this trigger, the skill may activate unintentionally for generic editorial-calendar requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This condition covers a wide range of common marketing and social-media needs and does not clearly distinguish when this specific skill should activate versus more general content-production skills. The lack of tighter constraints or exclusions creates ambiguity around the intended invocation boundary.

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 default prompt specifies a "production-ready Chinese workflow," which imposes a language choice by default rather than offering the user a language or locale option. This matches the policy-violation category for forcing a specific language without explicit user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script description, skill name, search aliases, and one default value are all hard-coded in Chinese, indicating the skill is designed to produce Chinese-language output regardless of user preference. This creates a language/locale policy concern because the file does not offer any explicit language choice or opt-in mechanism.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The code executes external binaries via subprocess to perform arbitrary local video transformations. For a skill described primarily as planning and producing a 30-day brand-avatar content calendar with AI-HIVE-backed asset generation, direct shell-level invocation of ffmpeg is an extra capability not clearly justified by the manifest text.

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:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language descriptions and CLI guidance entirely in Chinese, and the same pattern continues in user-facing output throughout the script. Because the skill does not offer a locale selection or indicate that Chinese is optional, it imposes a specific language on users, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The presence of a generic text chat endpoint in an image-only skill creates an unnecessary capability expansion beyond the declared function. Even if not exposed by the final skill CLI, retaining it in the shipped module increases the risk of repurposing, prompt exfiltration workflows, or unauthorized use through import-time reuse or future wiring changes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Including full video-generation support in a file advertised as an image-generation skill violates least privilege and broadens the operational scope of the artifact. In this context, hidden or unused extra generation paths are risky because they can be activated later, abused by integrators, or bypass policy assumptions tied to the skill's declared image-only role.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file is packaged and presented as a narrowly scoped brand-avatar image skill, but it embeds a broader generic client with account inspection, model enumeration, and other cross-purpose capabilities. In a skill ecosystem, this scope mismatch is dangerous because callers or orchestrators may trust the advertised purpose while the code exposes additional operations that expand accessible attack surface and enable unintended data access or platform reconnaissance.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file is presented as a specialized brand-avatar/content-calendar skill, but the implementation is a generic AI Hive client for chat, image, video, upload, and task polling. This mismatch weakens trust boundaries: users or calling agents may grant the skill broader authority or supply sensitive media under the assumption it enforces brand/persona/calendar constraints when it does not.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring and all user-facing guidance are written in Chinese, presenting the tool as a general-purpose skill but without any indication that Chinese is required or that other languages are supported. For a broadly scoped skill, this creates a locale/language constraint that is not documented as optional or region-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill exposes generic chat, image generation, model enumeration, user-info, and raw upload operations that exceed the manifest's stated brand-content-calendar purpose. Excess capability increases attack surface and enables misuse such as arbitrary content generation, account metadata access, and unscoped media exfiltration/upload workflows under the cover of a narrower business skill.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The embedded skill configuration claims a specialized branded-content generator, but the generate path merely selects a model and forwards an arbitrary free-form prompt plus optional media to video generation. That creates a confused-deputy risk where policy or UX implies narrow, compliant use, while the actual code permits broad ungoverned content generation unrelated to the declared skill purpose.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The top-level docstring says this is a '通用 AI 能力调用工具' wrapping text chat, image generation, video generation, model queries, uploads, and polling. Later, the file defines a fixed branded skill configuration and entrypoint for a specific brand-avatar content-calendar image skill, so the documentation actively characterizes the file as a generic utility rather than the specialized skill it actually exposes when run.

Content

No source excerpt is available for this finding.