T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:95- Finding
Bearer API Key Disclosure Through a Caller-Controlled API Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This looks like a real AI-HIVE image-generation skill, but it needs review because it handles a persistent API key, supports broad invocation, and can send that key to a configurable API endpoint.
Install only if you trust AI-HIVE and are comfortable with product images and prompts being uploaded for generation. Use the default AI-HIVE HTTPS endpoint, avoid custom --base-url or AI_HIVE_BASE_URL values unless you fully trust them, and prefer a dedicated limited API key that can be rotated. Confirm parameters before billable generation and review the stored ~/.ai-hive/config.json credential handling.
scripts/imagegen.py:95Bearer API Key Disclosure Through a Caller-Controlled API Base URL
The skill is presented as a specialized e-commerce image studio, but analysis indicates broader capabilities such as generic chat, video generation, account or wallet access, and model discovery that are not declared. Hidden or under-declared functionality expands the attack surface and can expose sensitive account metadata, trigger unintended billable actions, or let the skill be invoked in contexts far outside its stated review boundaries.
The skill is presented as a specialized e-commerce image studio, but analysis indicates broader capabilities such as generic chat, video generation, account or wallet access, and model discovery that are not declared. Hidden or under-declared functionality expands the attack surface and can expose sensitive account metadata, trigger unintended billable actions, or let the skill be invoked in contexts far outside its stated review boundaries.
The skill advertises executable workflows involving environment variables, local file access, network calls, and shell commands, but it does not declare any explicit tool scope or permissions boundaries. This creates an over-privileged and opaque execution model where a host agent may grant broader capabilities than users expect, increasing the chance of unintended file access, command execution, or outbound requests.
The trigger terms are broad enough that the skill may activate for loosely related Amazon, image, or e-commerce requests. Overbroad invocation can route unrelated user content into a skill with networked and potentially billable generation workflows, increasing the risk of data oversharing, accidental tool use, and user confusion about why this skill was selected.
The invocation criteria extend into general marketing, social media, short drama, and promotional content, which is much broader than the skill’s Amazon-listing branding suggests. In context, this makes the skill more dangerous because it can be selected in many unrelated content-generation scenarios, potentially bypassing more appropriate policy checks and enabling broader use of external generation services than users intended.
The default prompt hardwires invocation of this skill using a broad phrase ('Use $amazon-listing-image-studio-ai-hive to turn my request...') without any visible gating tied to user intent, authorization, or scope. In a system with implicit invocation enabled, this can cause over-triggering on loosely related requests, leading the agent to apply specialized workflows, external API steps, or marketing-content generation when the user did not explicitly ask for that behavior.
The default prompt requires a 'production-ready Chinese workflow' regardless of the user's language preference. This can override user intent, reduce transparency, and create safety/compliance issues if instructions, warnings, or generated operational steps are delivered in a language the user does not understand.
The top-level docstring says this file is a '通用 AI 能力调用工具' that wraps text chat, image generation, video generation, model querying, media upload, and task polling. That directly conflicts with the claimed specialized intent of an Amazon Listing image studio skill focused on listing/A+ imagery workflows.
The file’s natural-language description and all user-facing prompts are written exclusively in Chinese, and the embedded skill metadata targets Chinese-language usage. There is no indication that users may choose another language or locale, which can violate a language/locale policy requiring opt-in rather than a forced default.
The manifest describes a focused skill for producing Amazon Listing images via AI-HIVE, but the skill-specific CLI exposes task, upload, and especially generic initialization/API-access plumbing rather than only Amazon-listing-oriented generation. More importantly, the underlying module documentation and structure show it is a repackaged general AI-Hive client, not a narrowly scoped Amazon Listing image workflow.
The docstring, CLI description, and emitted skill name hard-code Chinese text ('图片工作室') as part of the skill's presented identity. Under the stated policy, forcing a specific language or locale without user opt-in is a natural-language policy concern, and this file does not offer any language selection or justification for the locale constraint.
The skill purpose is generating Amazon Listing images, but cmd_init opens a browser, guides interactive account setup, reads existing credentials, and writes persistent API configuration under the user's home directory. That credential-management workflow is ancillary platform tooling rather than an obvious part of an Amazon-listing image-production skill.