T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:96- Finding
Bearer API Key Disclosure Through a Caller-Controlled Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly aligned with AI-HIVE eyewear image generation, but it needs review because its API client can send a bearer key to a configurable server and downloads unchecked result files.
Review before installing. Use only the official AI-HIVE base URL, keep the config file under your control, avoid running it in environments where untrusted parties can set AI_HIVE_BASE_URL or edit ~/.ai-hive/config.json, and monitor generated downloads for size and source. Do not provide API keys or sensitive images unless you trust the AI-HIVE account and workflow.
scripts/imagegen.py:96Bearer API Key Disclosure Through a Caller-Controlled Base URL
scripts/imagegen.py:289Unbounded and Unvalidated Downloads From API-Supplied URLs
The declared behavior promises AI-HIVE OpenAPI interactions, image uploads, pricing checks, routing, polling, and downloadable try-on outputs, but the described runnable example appears to produce only a generic blueprint/init flow. This kind of description-behavior mismatch is dangerous because downstream systems or users may grant trust, permissions, budget, or data access based on capabilities the skill does not actually implement or validate, increasing the chance of unsafe misuse and deceptive operation.
The file is presented as an eyewear try-on preview skill, but the implementation exposes a broad AI Hive client with chat, video, model enumeration, account inspection, upload, and generic generation flows. This expands the skill far beyond its declared purpose, increasing attack surface and enabling misuse through capability confusion, unauthorized feature use, or policy bypass via the bundled generic interface.
The skill advertises runnable commands that use environment variables, local files, network access, and shell execution, but it does not declare any explicit tool scope or permissions boundary. In an agent environment, that mismatch can lead to over-broad capability exposure, making unintended file access, network requests, or command execution more likely if the skill is invoked or extended.
Natural-language policy violations apply to all file types, including markdown. The description is written as a Chinese-only invocation and workflow description, and the example inputs and outputs do not indicate that users may choose another language or locale.
For markdown files, vague activation triggers should be flagged when they are broad enough to match many ordinary requests. The phrase "眼镜广告" could refer to general ad strategy, copywriting, media buying, or design work beyond AI try-on preview generation, making invocation boundaries unclear.
The default prompt hard-codes 'production-ready Chinese workflow', which can override or conflict with a user's preferred language. This is a prompt-quality and trust issue because it may cause unexpected behavior, reduce usability, and make downstream review harder, but it does not by itself create direct code execution or data exfiltration risk.
This Python skill presents its top-level docstring, CLI help text, status messages, and initialization guidance entirely in Chinese, which imposes a language/locale requirement through natural-language strings. The file does not offer an opt-in language selection or document that the skill is intentionally restricted to a Chinese-speaking or China-specific context.
Querying user account information and wallet balance is unnecessary for generating eyewear try-on previews and exposes extra authenticated functionality. Even if not directly harmful by itself, it leaks sensitive operational/account metadata and broadens the blast radius if the skill is invoked in an untrusted or over-permissioned context.
The chat capability is unrelated to the stated image try-on use case and gives users a general-purpose text/multimodal channel through the same authenticated client. In a constrained skill environment, this can be abused to perform actions outside approved scope, route sensitive images/prompts to unintended models, or bypass governance tied to the advertised function.
Generic video-generation support materially exceeds the declared eyewear try-on image-preview function and allows creation of broader media outputs using uploaded images, audio, and video. That scope expansion increases misuse potential, including producing unauthorized synthetic media or bypassing controls that would otherwise limit the skill to static product-preview imagery.
This Python file contains user-facing natural-language strings in Chinese, including the module docstring, argparse description, and skill name, with no indication that other languages are supported. Under the policy rule for language/locale, forcing a specific language without user opt-in can be a policy violation when no choice or justification is provided.