T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:91- Finding
Configurable API Endpoint Can Expose the AI-HIVE Bearer Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a coherent podcast-to-short-video workflow, but it needs Review because its AI-HIVE client can forward the user's API key to an arbitrary configured API endpoint.
Install only if you are comfortable storing and using an AI-HIVE API key locally and uploading selected media to AI-HIVE. Do not set --base-url, AI_HIVE_BASE_URL, or config base_url to anything other than the official AI-HIVE endpoint unless you intentionally trust that endpoint with your API key. Review generated commands before running them, especially commands that upload media, start generation jobs, or write output files.
scripts/videogen.py:91Configurable API Endpoint Can Expose the AI-HIVE Bearer Credential
The declared description promises a substantial content-processing and media-generation workflow centered on converting podcast/interview material into short videos, with optional AI-HIVE API integration for generated assets. The supplied code does none of that. It simply parses command-line arguments and writes a JSON draft brief to disk. While some fields and aliases align with the declared domain, the primary behavior is materially narrower and different from the described functionality. Therefore this is a clear description-behavior mismatch.
There is a clear mismatch. The declared description promises a higher-level content-repurposing skill for converting podcasts/interviews into short videos, including editorial outputs and optional AI-service-backed asset generation. The supplied code only exposes basic media-editing commands through ffmpeg: probing, trimming, aspect conversion, muting, loudness normalization, and concatenation. These are supporting editing primitives, but the code lacks the central declared behavior: no transcript handling, no clip identification, no content-preservation logic, no titles/timecodes/b-roll outputs, and no external AI-HIVE API calls. So the actual implementation is materially narrower and different in primary purpose from the declared description.
The declared description emphasizes a domain-specific capability: converting podcast/interview material into short-form videos with structured outputs like观点片段、短视频标题、时间码、补充画面和多平台成片方案, preserving complete arguments and necessary context. However, the supplied code does not analyze transcripts, identify clips, generate timestamps, or produce editorial plans. Instead, it is mostly a general-purpose AI-Hive API wrapper offering broad capabilities beyond the declaration, including text chat, image generation, model enumeration, user-info lookup, and generic upload/task management. The skill-specific wrapper at the end narrows invocation to video generation models, but even there it only forwards a prompt and optional media to generic video generation endpoints. So the actual implemented behavior materially differs from the declared primary purpose and includes undeclared capabilities.
The skill exposes or implies code execution capabilities such as environment access, file I/O, network, and shell use without declaring an explicit tool scope. This weakens least-privilege boundaries and can let an invoked skill access sensitive local files, secrets, or external endpoints beyond what users or orchestrators would reasonably expect.
Broad trigger phrases like generic content terms can cause the skill to activate in unrelated conversations, increasing the chance that users are routed into workflows involving file handling, shell commands, or networked generation they did not intend. In a skill with media-processing and API-oriented behavior, accidental invocation expands the attack surface and can lead to privacy, billing, or data-handling mistakes.
The default prompt hard-codes Chinese output regardless of the user’s language preference. While not a direct code-execution issue, it can mislead users, reduce transparency, and increase the risk that they approve or run generated workflows they do not fully understand, especially when the skill outputs runnable commands.
allow_implicit_invocation: true lets the platform activate this skill without an explicit user request or tightly scoped trigger. Because this skill can transform requests into executable AI-HIVE commands and production workflows, over-broad activation increases the chance of unintended tool use, surprise external API interactions, or application in contexts outside the user’s intent.
The natural-language strings for the skill name, description, aliases, and required facts are entirely in Chinese, and the CLI description presents only that locale. There is no indication that users may choose another language or that the locale restriction is intentional and documented as region-specific.
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 podcast-interview-to-shorts skill, but it actually embeds a broad AI-Hive client supporting unrelated capabilities such as generic chat, image generation, model enumeration, user-info access, and arbitrary media upload. This violates least-privilege and capability minimization: a caller or downstream agent expecting only video-short generation could invoke extra operations not justified by the skill’s declared purpose, increasing the attack surface and enabling unauthorized or unexpected account/API use.
The module docstring and user-facing instructions are written entirely in Chinese, and the script later continues this pattern in prompts and status messages. This effectively imposes a specific language on users without opt-in, which matches the language/locale policy violation criteria for natural-language content.
The skill exposes a fully general text-chat API that is unrelated to the advertised podcast-to-shorts function. This hidden general-purpose capability enables prompt forwarding and arbitrary model use under the skill’s API credentials, creating a privilege/scope mismatch and making misuse of the bound account more likely.
Standalone image generation is outside the core declared workflow and gives the skill a broader creative-generation surface than advertised. In context, this means the skill can be repurposed for unrelated content generation or policy-evasive use under the same API key, contrary to user expectations and least-functionality principles.
The skill is written entirely in Chinese and the description instructs usage through Chinese trigger phrases, but it does not state that language is optional or user-selectable. This can be a locale-policy issue if the skill is applied in multilingual environments without explicit opt-in or justification.
The script creates parent directories and writes a JSON file to a user-specified path, which modifies the filesystem. Although the behavior is straightforward, there is no docstring/comment or user-facing message warning that the target file may be created or overwritten before the write occurs.
Exposing a user-info and wallet-balance query in a media-generation skill leaks account metadata beyond the skill’s stated need. Even if not directly catastrophic, it unnecessarily broadens data exposure and can aid reconnaissance about account state, subscription, or available funds for subsequent abuse.