T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:91- Finding
Unrestricted API Endpoint Override Can Disclose Credentials and Media
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its video-editing purpose, but it needs review because a custom API endpoint can receive the user's API key and selected media.
Review before installing. Use this only if you are comfortable providing an AI-HIVE API key and uploading explicitly selected media for generation. Keep the default API endpoint unless you fully trust the alternative, avoid setting AI_HIVE_BASE_URL or --base-url from copied commands, and install Python dependencies in an isolated environment.
scripts/videogen.py:91Unrestricted API Endpoint Override Can Disclose Credentials and Media
scripts/videogen.py:17Unpinned Runtime Dependency Installation
There is a strong mismatch between the declared purpose and the supplied code. The description promises an operational video-editing and AI-generation toolbox with both local media processing and remote API orchestration. The code instead only generates a draft JSON brief from command-line parameters. While some field names and aliases align conceptually with the declared domain, the implemented behavior is limited to planning metadata output and does not carry out the core advertised capabilities. This is a materially different primary purpose rather than a minor implementation subset.
The implemented code does cover a subset of the declared deterministic editing functions: probing, trimming/cutting, aspect-ratio conversion, muting, loudness normalization, and concatenation. However, the declared description emphasizes a broader hybrid system whose distinguishing feature is combining local deterministic editing with AI model support for creative补镜 and material generation through AI-HIVE OpenAPI, including config queries, reference uploads, price snapshots, route selection, asynchronous polling, and downloads. None of those AI/networked capabilities appear in the supplied code. Therefore the description materially overstates the skill’s actual behavior and primary capabilities.
The description emphasizes a hybrid video-editing toolbox whose main value is deterministic local editing combined with AI shot-completion suggestions. However, the supplied code contains no local editing engine or calls to tools like ffmpeg/moviepy for cutting, concatenation, ratio changes, muting, normalization, or media analysis. Instead, it implements an AI-HIVE OpenAPI client with commands for user info, model listing, text chat, image generation, video generation, uploads, polling, downloads, and API-key setup. The final skill-specific wrapper mainly maps inputs to different AI video generation models (t2v/i2v/r2v) and submits generation jobs. This is a material purpose mismatch: the code behaves as an AI generation client, not a full AI video editing toolkit as described.
The skill advertises and demonstrates capabilities that imply access to shell, filesystem, environment variables, and networked APIs, but it does not declare any explicit tool scope or permission boundaries. That creates an overbroad and opaque trust boundary: a caller or runtime may grant more access than users expect, increasing the chance of unintended file access, secret exposure, or arbitrary command execution through supporting scripts.
The natural-language instruction in the default prompt explicitly requires a "production-ready Chinese workflow," which imposes a specific language on users. The file does not offer a language choice or indicate that the locale restriction is optional or justified as region-specific.
The file hard-codes Chinese-language skill naming and search aliases in the docstring, argument parser description, and generated metadata. This creates a locale-specific behavior without any user opt-in or explanation that the tool is intended only for a Chinese-language or region-specific context, which matches the language/locale policy violation category.
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:
The file is marketed as a narrowly scoped video-editing toolkit, but the implementation includes a broader generic AI client for chat, image generation, model enumeration, uploads, and task polling. This scope mismatch is dangerous because downstream agents or users may invoke capabilities they did not authorize or expect, weakening least-privilege and enabling misuse outside the declared skill purpose.
The presence of a generic text-chat operation is outside the stated video-editing use case and creates an undocumented general-purpose model access path. In an agent setting, that can be abused to bypass intended policy boundaries, send arbitrary prompts and attachments to external models, or turn a media-processing skill into an unrestricted remote AI conduit.
Standalone image generation is not necessary for the declared video-editing toolkit and expands the skill into a more general content-generation interface than users may expect. That broader capability increases misuse risk, including policy evasion, unreviewed content generation, and unintended billing or data transfer to external services under the cover of a video tool.
The top-level natural-language description is written entirely in Chinese and presents the skill as-is, without indicating that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.