T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:91- Finding
API Key Can Be Forwarded to an Arbitrary Server Through a Configurable Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a mostly disclosed video workflow helper, but it needs review because it handles API keys and can send them to a user-configurable API server.
Review before installing. Use only the official AI-HIVE endpoint unless you fully trust a custom server, avoid putting API keys in shared logs or commands, confirm any billable generation before running it, and use an isolated Python environment with reviewed dependencies.
scripts/videogen.py:91API Key Can Be Forwarded to an Arbitrary Server Through a Configurable Base URL
scripts/videogen.py:7Unpinned Third-Party Dependency Installation
There is a material description-behavior mismatch. The declared purpose presents a substantive video-analysis/editing workflow tool, potentially with external AI generation support. The supplied code only builds a static JSON brief from command-line arguments. Its primary purpose is metadata templating, not media analysis or editing assistance. While some field names and aliases align with the theme, the implemented behavior is far narrower and different from the advertised capability.
The declared description presents an analysis-and-planning skill for viral-style video restructuring, focused on editorial reasoning about timeline rhythm and possibly AI-assisted asset generation. The supplied code instead implements a small ffmpeg wrapper for straightforward media editing utilities. While both relate broadly to video, the primary purpose is materially different: the code edits files directly but does not analyze shots, infer pacing, explain transitions, create B-roll recommendations, or orchestrate any AI-HIVE generation workflow. There are no suspicious extra capabilities beyond the basic ffmpeg operations, but the implemented behavior substantially underdelivers and differs from the declared functionality, so this is a clear mismatch.
The description promises a domain-specific analysis tool for breaking down editing rhythm and reconstructing video pacing from supplied authorized footage. However, the code does not analyze video structure, detect shots, compute rhythm peaks/valleys, infer transition logic, produce B-roll recommendations, or generate a recut plan. Instead, it is an API wrapper around AI Hive with generic capabilities: chat, image generation, video generation, uploads, polling, downloading, model lookup, and user-info retrieval. The skill-configured layer maps prompts and optional reference media into text-to-video / image-to-video / reference-to-video generation calls, which is materially different from analytical video-editing assistance. There are also undeclared capabilities such as text chat, image generation, and account info access present in the codebase. Therefore the declared purpose does not accurately represent the actual behavior.
The file implements a broad AI-Hive client for chat, image generation, video generation, model enumeration, uploads, and account queries, while the declared skill is narrowly about shot-rhythm analysis and re-edit planning. This scope mismatch materially increases the accessible attack surface and enables unrelated capabilities to be invoked under the guise of a specialized skill, which violates least privilege and can be abused for unauthorized content generation or data access.
The module explicitly presents itself as a 'general AI capability invocation tool,' directly contradicting the manifest's specialized shot-rhythm-analysis purpose. This kind of misleading packaging is dangerous because it obscures actual capabilities from reviewers and users, making overbroad permissions and hidden functionality easier to slip into production.
The primary skill path routes directly into video generation rather than analysis of an authorized source video's pacing, cuts, transitions, and timeline structure. In context, this is more dangerous because the manifest positions the skill as an analysis tool, but the code enables media synthesis, creating a misleading permission boundary that could be used for unapproved content creation or repurposing user-supplied assets beyond expected analysis.
The skill advertises executable workflows involving shell commands, environment variables, file access, and network/API usage, but it declares no explicit tool scope or permission boundaries. In an agent setting, this can lead to over-broad capability exposure, making it easier for downstream prompts or users to trigger filesystem, network, or shell actions that were never formally constrained or reviewed.
The manifest description and title are entirely in Chinese and present the skill as operating in that language, with no indication that users may choose another language. Under the policy rule, a skill should not implicitly force a specific language or locale unless it offers opt-in or clearly documents a justified regional constraint.
The default prompt hard-codes Chinese output regardless of the user's language preference, which can override user intent and reduce transparency about what the agent is doing. While this is not a direct code-execution issue, forced language can impair review, consent, and safe use, especially when the skill may emit operational commands or workflow instructions the user cannot easily validate.
The skill enables implicit invocation without any trigger constraints, so the agent may auto-select this skill in contexts the user did not clearly intend. Because this skill is designed to produce production-ready workflows and runnable AI-HIVE commands, unintended activation could cause the model to steer users into external API usage, file handling, or cost-incurring generation flows without clear consent or relevance checks.
The natural-language description and skill name are hardcoded in Chinese, with no option for the user to choose another language or locale. This can violate language/locale policy when a skill imposes a specific language without opt-in or justification.
The blueprint declares artifacts such as '差异化复刻方案', '逐镜脚本', and '生成提示词', which go beyond a passive analysis brief and enable downstream replication or remake workflows. In this skill context, that broadens the tool from analysis into content reproduction planning, increasing misuse risk for unauthorized imitation or policy-evasive ad/video generation.
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 manifest describes a skill for analyzing authorized videos and producing outputs like shot-duration tables, rhythm peaks/valleys, transition logic, B-roll lists, and recut plans. This helper instead implements concrete ffmpeg edit actions such as trimming, aspect-ratio transforms, muting, loudness normalization, and concatenation, which are execution-oriented editing behaviors rather than the described analytical deliverables.
The code exposes a user-info endpoint that returns account and wallet-related data unrelated to shot-rhythm analysis. Even if authenticated access is required, surfacing billing/account information in a content-analysis skill broadens data exposure and may leak sensitive operational details to users or downstream agents that should never need them.
The generic text chat function allows arbitrary model prompting that is not necessary for a dedicated shot-rhythm analyzer. This creates an unsanctioned general-purpose LLM interface inside a narrowly scoped skill, allowing policy bypass, prompt abuse, or unintended processing of user/media-derived data outside the promised workflow.
Standalone image generation is outside the declared analysis workflow and adds content-creation capability unrelated to timeline decomposition. In this skill context, that mismatch makes the issue more suspicious because users may authorize media analysis while the implementation can instead synthesize unrelated assets through the same trusted integration.
The docstring says the script will create a deterministic production brief for shot-rhythm analysis, suggesting a bounded planning document. However, the actual payload includes '差异化复刻方案', '逐镜脚本', and '生成提示词和验收清单', which goes beyond a narrow analysis brief into prescriptive generation and replication-oriented work.
This code creates parent directories and writes a JSON file to a user-specified path, which is a filesystem-modifying operation. There is no confirmation prompt, warning message, or explanatory comment/docstring near the write path that clearly discloses this side effect to the user.
This Python file contains user-facing natural-language text entirely in Chinese, including the module description and many CLI messages, while presenting itself as a general-purpose AI skill. Because the skill does not offer locale selection or document that it is intentionally Chinese-only, it may violate language/locale policy requiring user choice or explicit justification.