T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:91- Finding
Bearer API Key Can Be Sent to an Arbitrary Configured Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent for Chinese ad-analysis and AI-HIVE media generation, but its API client can send a stored bearer key to an unrestricted endpoint and can write downloaded results using unsafe server-controlled path data.
Review before installing. Use only the default AI-HIVE endpoint unless you fully trust a custom endpoint, avoid setting AI_HIVE_BASE_URL from untrusted instructions, keep the API key scoped and revocable, and run downloads in a low-risk output directory. Confirm before billable generation and avoid using this skill for unauthorized ad copying or unsupported product claims.
scripts/videogen.py:91Bearer API Key Can Be Sent to an Arbitrary Configured Endpoint
scripts/videogen.py:397Server-Controlled Task Type Can Escape the Download Directory
scripts/videogen.py:7Runtime Dependency Installation Is Unpinned and Non-Reproducible
There is a strong description-behavior mismatch. The description presents a marketing/ad-tech skill focused on analyzing authorized reference ads and producing structured creative-variable breakdowns, with optional API-based asset generation workflows. The actual code contains none of that logic. It is a standalone Python script that shells out to ffmpeg/ffprobe to inspect and edit video files locally. Its commands are limited to probe, trim, aspect conversion, mute, loudness normalization, and concatenation. While video editing could conceivably support ad workflows in a broad sense, this code’s primary function is generic media processing, not the declared ad-analysis or AI-HIVE orchestration capability. Therefore the description does not accurately represent the supplied code chunk.
The declared description emphasizes a marketing-analysis skill that learns transferable variables from authorized ads and outputs structured ad breakdown artifacts. However, the supplied code does not analyze ads or transform business inputs into variable frameworks. Instead, it is an API client/CLI for AI Hive OpenAPI with commands for init, upload, task polling, chat, image generation, and especially video generation through fixed model IDs. The only ad-related elements are SKILL_CONFIG metadata strings such as the title, keywords, and example prompt; these do not correspond to actual analytical behavior. The code’s real function is to submit media-generation jobs and download outputs, not to perform the claimed decomposition workflow. Therefore the description materially misrepresents the code’s primary purpose and capabilities.
The skill advertises and demonstrates capabilities that imply access to environment variables, local files, networking, and shell execution, but it does not declare an explicit tool scope or permission boundary. That makes the operational trust model unclear and increases the risk of unintended secret exposure, filesystem access, or command execution if the runtime grants broad defaults.
The activation description and 'when to use' section are entirely defined through Chinese phrases such as '爆款广告拆解', '广告变量', and related Chinese-language workflow descriptions. This creates a language-specific invocation and operating policy without stating that other languages are supported or that the Chinese-only scope is intentional and justified.
The prompt explicitly instructs the skill to produce a production-ready Chinese workflow, which imposes a language choice regardless of user preference. This is a natural-language policy issue because the file does not offer language selection or explain why Chinese is required.
The skill enables implicit invocation with no visible trigger constraints, exclusions, or narrowing conditions. Because this skill can produce runnable AI-HIVE commands and workflow outputs for ad generation and creative replication, broad automatic activation increases the chance it is invoked in unrelated or insufficiently authorized contexts, leading to unintended content generation or policy-bypassing assistance.
This code embeds Chinese-only natural-language identifiers and descriptions in the docstring, argument parser description, skill name, aliases, and artifact labels. Under the policy, forcing a specific language without offering a language/locale choice can be a natural-language policy violation.
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 packaged as a specialized ad-variable-decomposition/video skill, but the codebase is a general-purpose AI Hive client exposing broader capabilities than the manifest suggests. This creates a scope mismatch that can enable unintended use paths, weaken least-privilege expectations, and make policy enforcement or review based on the manifest unreliable.
The module documentation explicitly describes the tool as a general AI capability wrapper, which contradicts the narrow manifest description. This discrepancy is dangerous because it signals that the reviewed artifact may offer materially broader behavior than users, operators, or automated governance expect.
The top-level docstring is entirely in Chinese and presents the tool as a general-purpose AI skill, but it does not state that the skill is Chinese-only or offer an opt-in language/locale choice. For a general-purpose skill, this creates a natural-language policy concern because the user-facing instructions implicitly force a specific language without documented justification.
The unrestricted chat interface allows arbitrary text and multimodal interaction unrelated to the declared specialized skill. In a skill expected to perform bounded ad-analysis/video tasks, this broadens functionality into a generic AI access channel, increasing the chance of policy bypass, unintended data handling, or misuse beyond the reviewed purpose.
The manifest centers this skill on analyzing authorized reference ads and producing variable tables and test hypotheses, with AI-HIVE used for material generation when needed. This script emits a blueprint that explicitly lists deliverables such as '差异化复刻方案', '逐镜脚本', and '生成提示词和验收清单', which extend from analysis into concrete production-planning/generation outputs not described as this script's purpose in its docstring.
The user-info endpoint exposes account details and wallet/balance information that are not necessary for ad-variable decomposition or video generation. While not a direct exploit by itself, unnecessary access to account metadata expands the available data surface and can leak operational or billing information if invoked inappropriately.