T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:90- Finding
Bearer API Key Can Be Redirected to an Arbitrary Server
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a coherent AI image-generation wrapper, but it handles an API key in a way that can send it to a user- or environment-configured server.
Review before installing. Use it only if you trust the AI Hive endpoint and keep AI_HIVE_BASE_URL and ~/.ai-hive/config.json under your control. Avoid custom base URLs unless you are certain they are trusted, and consider using a dedicated API key with limited balance or permissions. Install dependencies in a virtual environment rather than a shared Python environment.
scripts/imagegen.py:90Bearer API Key Can Be Redirected to an Arbitrary Server
SKILL.md:71Unpinned Runtime Dependency Installation
The skill invokes Python scripts that can use shell, filesystem, environment, and network capabilities, but the manifest does not declare any tool scope or permission boundaries. This creates a least-privilege violation: an agent or reviewer cannot easily determine or constrain what the skill is allowed to access, increasing the risk of unintended file access, command execution, or outbound requests if the backing script is modified or abused.
The module is fundamentally a general-purpose AI Hive client supporting chat, image, video, model enumeration, uploads, and polling, while being packaged as a single-purpose character-consistency skill. This mismatch is dangerous because agents or reviewers may trust the declared scope and grant permissions accordingly, even though the code can perform substantially broader actions than advertised.
This code presents the skill's primary description entirely in Chinese, and the rest of the CLI help and prompts are also Chinese-only. That forces a specific language/locale on all users without opt-in, which matches the natural-language policy violation criteria.
Including user account information retrieval in a character-consistency image skill violates least functionality and may expose wallet balance or account metadata unrelated to the task. In an agent setting, unnecessary account introspection increases privacy and reconnaissance risk if the skill is invoked or repurposed by untrusted workflows.
Text chat and video generation capabilities are unrelated to the stated image-only character-consistency purpose, yet they remain fully implemented in the same file. This unnecessary breadth makes the skill easier to misuse as a generic multimodal API proxy, increasing the chance of unauthorized actions, cost abuse, or policy bypass in environments that intended to allow only image generation.
The skill is advertised as a narrowly scoped Nano Banana 2 character-consistency image generator, but it also exposes generic task querying and standalone upload operations. This expands the tool's operational surface beyond user expectations, enabling use as a generic API helper for arbitrary media handling and task inspection, which can bypass least-privilege assumptions in agent environments.
This markdown file contains user-facing natural language exclusively in Chinese across the substantive changelog entries. Under the policy rule, forcing a specific language without user opt-in or justification is a natural-language policy concern.
Line L76 states '固定使用 Nano Banana 2' ('always use Nano Banana 2'), which is a natural-language instruction that forces a specific option rather than offering user choice. While this is not a language locale issue, it is the only plausible policy-like constraint present; however, it is weakly concerning and not clearly justified in the document.
The example API key placeholder uses Chinese text ("请替换为你的APIKey"), which imposes a specific language in user-facing configuration content. There is no indication that the skill is region-specific or that users may choose another language, so this conflicts with the language/locale policy guidance.
No suspicious patterns detected.