T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:384- Finding
Remote API Response Can Escape the Intended Download Directory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill broadly matches its poster-to-video purpose, but it needs review because downloaded AI results can be written outside the intended folder if the API response is unsafe.
Review before installing. Use only the official AI-HIVE base URL, provide only media you intend to upload to AI-HIVE, avoid running it with elevated privileges, and inspect downloaded files. The path handling bug should be fixed before broad use because a malicious API response could overwrite writable local files.
scripts/videogen.py:384Remote API Response Can Escape the Intended Download Directory
scripts/videogen.py:1Unpinned Third-Party Dependency Installation
The declared description presents a full production skill for animating static posters and optionally orchestrating AI-HIVE API operations to create assets and outputs. The supplied code only parses command-line arguments and saves a JSON file containing project fields, aliases, required facts, and artifact labels with status=draft. That makes the actual implementation a lightweight planning/brief generation utility, not the described animation/video-generation workflow. While a blueprint can be a supporting component of such a skill, this code chunk’s primary purpose is materially narrower and lacks the core promised capabilities.
The declared description centers on turning static posters into animated marketing videos and, when needed, using an external AI API pipeline. The supplied code does none of that. It only wraps ffmpeg/ffprobe for basic media operations: probing, trimming, reframing, muting, loudness normalization, and concatenation. While aspect conversion and trimming could be incidental parts of a video workflow, they do not implement the advertised core purpose. Therefore the description does not accurately represent the code’s actual behavior.
The skill advertises and demonstrates code paths that can use environment variables, local files, shell commands, and network access, but it does not declare any tool scope or allowed-tools boundary. In an agent environment, that omission weakens least-privilege controls and can let the skill invoke broader capabilities than reviewers or orchestrators expect, increasing the risk of secret exposure, unintended file access, or unreviewed outbound requests.
The natural-language instruction in the default prompt requires a "production-ready Chinese workflow," which imposes a specific language choice by default. This is a locale/language policy concern because the file does not indicate any user opt-in or alternative language selection.
The manifest describes a skill focused on static-poster animation and image-to-video generation using AI-HIVE OpenAPI, including configuration lookup, upload, routing, polling, and download. This script instead implements a standalone ffmpeg-based CLI for probing, trimming, reframing, muting, loudness normalization, and concatenating arbitrary video files, which is a materially different local editing capability rather than the described poster-dynamicization pipeline.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(args: list[str]) -> None:
print(" ".join(args))
subprocess.run(args, check=True)
def main() -> None:
Commands such as probe, trim, mute, loudnorm, and concat provide broad short-video editing functionality for arbitrary media inputs. The manifest centers on animating authorized posters and generating motion deliverables through AI-HIVE, so these general-purpose media-manipulation features are not clearly justified by the stated skill purpose.
The file is a broad AI-Hive CLI exposing chat, image generation, model discovery, uploads, account inspection, and task handling, while the advertised skill is a narrowly scoped poster-to-motion-video tool. This scope mismatch violates least privilege and increases the attack surface: any caller granted access to this skill can invoke unrelated remote capabilities and transfer arbitrary local media, which is more dangerous in an agent-skill context than in a standalone developer utility.
This Python file contains user-facing natural-language strings and documentation entirely in Chinese, including setup guidance and runtime messages. Under the policy rule, forcing a specific language or locale without user opt-in is a natural-language policy violation when no alternative language choice is offered.
The general-purpose text chat endpoint is outside the stated function of poster/video generation and allows arbitrary prompts, optional system prompts, and image inputs to be sent to remote models. That turns a specialized media skill into a generic LLM access path, expanding opportunities for policy bypass, sensitive-data exfiltration, and unreviewed capability use.
Standalone image generation is not required for converting a poster into motion video and materially broadens the skill's capabilities. In practice this gives users or upstream agents an unrelated content-generation channel, undermining the principle that the skill should only do the reviewed, declared task.
The upload flow sends arbitrary local files to remote object storage and then to the AI-Hive service, but the skill does not present an explicit privacy/data-transfer warning at the point of use. In an agent context, users may not realize that local media, including potentially sensitive images, audio, or videos, are being transmitted off-device to third-party infrastructure.
The module docstring and CLI description use Chinese-only natural-language strings ('静态海报动态化|AI-HIVE') with no indication that users may select another language or locale. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy concern.
Exposing user-info and wallet balance is unnecessary for generating animated poster videos and leaks account metadata beyond the skill's declared purpose. In an agent setting, this can enable unintended reconnaissance about the user's subscription state or account resources, even if it does not directly modify data.
Full model enumeration across text, image, and video exposes unnecessary information about backend capabilities and available routing options for a specialized poster-animation skill. This reconnaissance can help misuse broader platform features that were not intended to be reachable through this skill.
The polling flow automatically creates an output directory and writes downloaded image/video results to the user's Downloads path. While the code shows download progress, the skill description/docstring does not clearly warn that files will be created locally under the default output directory.