T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:96- Finding
Bearer API Key Can Be Transmitted to an Arbitrary Configured Server
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is broadly aligned with product video generation, but it should be reviewed because it handles API keys and media uploads with weak endpoint scoping.
Install only if you are comfortable giving this skill an AI-HIVE API key and uploading selected media to AI-HIVE. Do not use custom --base-url or AI_HIVE_BASE_URL with a production key unless you fully trust the endpoint, and review generated commands before running anything billable.
scripts/videogen.py:96Bearer API Key Can Be Transmitted to an Arbitrary Configured Server
scripts/videogen.py:277Unvalidated Server-Provided URLs Can Redirect Media Transfers to Untrusted Destinations
scripts/videogen.py:8Unpinned Runtime Dependency Prevents Reproducible and Integrity-Verified Installation
There is a clear description-behavior mismatch. The declared purpose describes an operational media-generation workflow for automatic product B-roll补镜, including asset intake, shot-gap analysis, prompt generation, video generation, and multiple API-driven actions through AI-HIVE. The supplied code does none of that. It only parses a few command-line arguments and saves them into a JSON 'blueprint' with fixed metadata. While '制作蓝图' is mentioned among declared outputs, this code implements only that narrow planning stub and not the primary advertised capabilities. Therefore the actual behavior materially under-delivers relative to the declared purpose.
There is a clear description-behavior mismatch. The declared purpose centers on an AI workflow for generating missing B-roll/product demonstration footage and related planning artifacts, with explicit mention of external API operations. The supplied code instead implements a narrow, auditable ffmpeg command-line utility for basic video post-processing tasks: probe, trim, reframe, mute, loudness normalize, and concat. These editing operations could be supporting tools in a video pipeline, but they do not realize the core declared behavior, and the code lacks the stated AI generation, asset upload, pricing, routing, asynchronous job handling, or product-specific logic. Therefore the code’s actual primary purpose is materially different from the declared description.
The skill advertises executable workflows involving shell commands, file access, environment variables, and network/API usage, but it does not declare any explicit tool scope or permissions boundary. In an agent environment, missing scope declarations can cause overbroad tool access, making accidental secret exposure, unintended file modification, or unreviewed outbound requests more likely if the skill is invoked.
In the "什么时候使用" section, the skill activates when a user merely mentions "产品演示", which can refer to many ordinary product-demo tasks unrelated to AI-generated B-roll补镜. Because the trigger list does not constrain this phrase with stronger context or negative examples, it risks unintended invocation.
"视频素材生成" describes a wide class of video-generation requests and is not specific to product-demo B-roll gap filling. Without additional scope limits, the skill could be invoked for unrelated video asset generation tasks.
Forcing Chinese output in the default prompt without user choice can override user intent and reduce transparency about how the agent will behave. While not a direct code-execution risk, it can mislead users, impair review of generated commands or policy-relevant content, and increase the chance of unsafe or misunderstood actions in multilingual contexts.
Implicit invocation allows the skill to activate without an explicit user request, increasing the chance it will be triggered in contexts the user did not intend. Because this skill can generate runnable AI-HIVE commands and production workflows for media generation, accidental activation could cause unauthorized content-generation actions, unexpected external API use, or policy-sensitive outputs.
This code presents the skill name and description only in Chinese in the module docstring and argparse description. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale violation because users are not given any alternative language or documented justification.
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 product-demo B-roll skill, but the implementation exposes a broad generic AI client for chat, image, video, model listing, uploads, and task polling. This scope mismatch weakens least-privilege guarantees: any agent or workflow invoking the skill can access capabilities unrelated to the declared purpose, increasing the chance of policy bypass, unintended data handling, or unauthorized use of account-backed AI functions.
This code file contains user-facing natural-language strings and documentation entirely in Chinese, including setup instructions and runtime messages. Because the skill does not offer a language/locale option or explain that it is intentionally region-specific, it creates a language policy issue under the rule for forced locale without user opt-in.
A generic text-chat capability is included even though the skill is declared for product-demo B-roll generation. This creates an unnecessary general-purpose LLM channel under the skill's API credentials, which could be abused for off-scope content generation, prompt injection propagation, or exfiltration of uploaded context beyond the intended workflow.
Standalone image generation is outside the manifest's stated role of filling B-roll gaps in product-demo videos. Keeping this capability available allows users or downstream agents to invoke off-scope media creation with the same credentials and trust boundary, undermining the security expectation that the skill is limited to a specific workflow.
The top-level documentation explicitly describes the tool as a generic AI capability caller, contradicting the narrower skill manifest. While this is partly a documentation issue, in security terms it signals that the implementation and declared trust contract are misaligned, making misuse and unsafe invocation more likely in agentic environments.
The skill exposes a user-info endpoint that retrieves account information and wallet balance, which is unrelated to generating product-demo B-roll. In an agent setting, this broadens access to sensitive account metadata and can enable unnecessary information disclosure or account reconnaissance if the skill is misused.