T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:92- Finding
API Credential Disclosure Through an Unrestricted Custom Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches an AI-HIVE vertical-video workflow, but it handles a real API key and can forward it to an arbitrary configured API endpoint.
Review before installing if you will use a real AI-HIVE key. Use a dedicated low-privilege key if possible, avoid custom --base-url, AI_HIVE_BASE_URL, or edited config endpoints unless you fully trust them, and confirm all uploads and billable generation tasks before running commands.
scripts/videogen.py:92API Credential Disclosure Through an Unrestricted Custom Base URL
The declared description promises a substantive video transformation pipeline and AI-HIVE integration for generating/reconstructing vertical ad content from horizontal source material. The supplied code only builds a metadata blueprint JSON from command-line arguments. While the JSON includes search aliases and some planning fields relevant to the described use case, the primary behavior is merely project brief generation, which is materially narrower and different from the advertised operational capabilities. This is therefore a description-behavior mismatch.
The description promises a specialized vertical-video reconstruction skill for marketing/ad assets, emphasizing intelligent reframing rather than simple center-cropping, plus AI-HIVE API-based generation and orchestration. The supplied code does not implement those functions. Instead, it is a straightforward local wrapper around ffmpeg/ffprobe with subcommands for probe, trim, aspect conversion using basic crop/pad filters, mute, loudnorm, and concat. While aspect conversion is loosely related to horizontal-to-vertical adaptation, the implemented behavior is much narrower and materially different from the declared purpose. The code also exposes additional generic media-editing capabilities not mentioned in the description. Therefore this is a clear description-behavior mismatch.
The skill advertises and demonstrates operations that imply access to environment variables, local files, network calls, and shell execution, but it declares no explicit tool scope or permission boundaries. In an agent environment, that ambiguity can lead to over-privileged execution, unsafe invocation of local/system resources, and difficulty enforcing least privilege or auditing what the skill is allowed to do.
In the '什么时候使用' section, the listed trigger '视频重构' is generic and does not clearly limit invocation to ad-to-vertical conversion or AI-HIVE workflows. Users asking for unrelated video restructuring could unintentionally activate this skill.
The prompt explicitly requires a "production-ready Chinese workflow," which imposes a language choice by default. This is a natural-language policy concern because the file does not offer the user a language option or justify why Chinese is mandatory.
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 presented as a narrowly scoped vertical-video reconstruction skill, but the implementation is a broad AI Hive client supporting chat, image generation, model discovery, uploads, and task polling. This scope mismatch increases attack surface and enables capability abuse outside the user-approved purpose, undermining least-privilege expectations for skills.
The module docstring explicitly markets the file as a general-purpose AI capability tool, contradicting the skill's specialized metadata. This inconsistency is a strong indicator of capability laundering: a generic tool is being packaged under a narrower identity, which can mislead reviewers, users, and policy enforcement systems.
The module docstring and user-facing CLI text are written exclusively in Chinese, with no indication that users may choose another language or locale. Under the policy rule, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.
The skill includes a text chat command unrelated to the advertised video-conversion function, allowing the skill to be repurposed as a general LLM client. In a skill ecosystem, hidden extra capabilities are dangerous because users and orchestrators may grant trust or credentials assuming a much narrower operational scope.
The image generation pathway is not required for a skill whose stated purpose is converting landscape ads to vertical videos from provided assets. Exposing unrelated generation expands misuse potential, including creating synthetic assets beyond approved reconstruction workflows and bypassing policy expectations tied to the specialized skill.
The natural-language strings used for the module description and argument parser description are fixed in Chinese, with no indication that users may choose another language or locale. Under the stated policy, forcing a specific language without user opt-in is a language/locale policy violation.
This code creates parent directories and writes a JSON file to a user-controlled path, which is a filesystem-modifying operation. Although the resulting path is printed afterward, there is no prior warning, confirmation, or explanatory comment/docstring disclosing that the script will create directories and overwrite/write output.
The manifest focuses on accepting ad assets and producing reconstructed 9:16 videos. Separate user-info and model-listing functions are generic platform administration/discovery capabilities that are not necessary to present as part of this end-user skill.