T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer API Key Can Be Sent to an Arbitrary User-Controlled Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its stated product-image purpose, but its API client handles keys and downloads in ways that could expose credentials or overwrite local files if misdirected.
Review before installing. Use only the default AI-HIVE endpoint, avoid --base-url or AI_HIVE_BASE_URL overrides unless you fully trust the destination, keep the API key low-privilege and revocable, and download outputs only into a disposable directory until URL and filename validation are fixed.
scripts/imagegen.py:91Bearer API Key Can Be Sent to an Arbitrary User-Controlled Endpoint
scripts/imagegen.py:312Untrusted Task Results Permit Server-Side Request Forgery and Output-Path Traversal
The skill claims image-generation, API routing, pricing snapshot retrieval, asynchronous polling, uploads, and downloads, but the described runnable behavior does not substantiate those capabilities. This mismatch can mislead operators into trusting the skill with external calls, costs, or content-production workflows it may not safely or correctly perform, increasing the risk of unintended execution paths, unsafe substitutions, or billing surprises.
The skill exposes examples that invoke shell commands, environment variables, local file paths, and outbound network access, but it does not declare any corresponding tool scope or allowed-tools policy. This creates an implicit privilege boundary failure: a host may grant broader capabilities than reviewers or users expect, enabling file access, secret use, or billable API calls without explicit permission constraints.
The manifest description and title present the skill entirely in Chinese and repeatedly frame the skill around Chinese-language invocation terms such as “AI商品图” and “产品摄影,” without offering a language choice or stating that the skill is region-specific. Under the policy, a skill should not force a specific language or locale unless the constraint is explicitly documented and justified or the user can opt in.
The default prompt is broad enough to activate the skill for generic product-photo requests without requiring explicit user confirmation that AI-HIVE tooling, code generation, or external API workflows are desired. In a commerce-focused image generation skill, this can cause unintended invocation, overcollection of product/brand inputs, or accidental guidance into regulated or policy-sensitive image generation tasks.
Forcing Chinese output without user opt-in can misalign the assistant response with the user's language, reducing transparency and increasing the chance the user misunderstands generated workflow steps, code, pricing, or compliance constraints. In a skill that may produce runnable commands and operational instructions, language coercion can contribute to user error and weaken informed review of sensitive actions.
The file is presented as a product-photo studio skill, but its implementation advertises and includes generic AI capabilities beyond that scope. Scope expansion matters because a caller expecting only product-image operations may unknowingly gain access to unrelated text and video APIs, increasing the attack surface and creating opportunities for policy bypass or unauthorized use of broader account capabilities.
This code file contains natural-language descriptions and operational prompts entirely in Chinese, including the module docstring and later CLI help/output text. Under the language/locale policy, forcing a specific language without user opt-in is a policy violation because users are not offered any alternative locale or language selection.
Retrieving user account information and wallet balance is not necessary for generating product images, so exposing this endpoint violates least privilege and increases unnecessary data exposure. If invoked by an agent or user who only intended image generation, it could disclose sensitive account metadata or billing information without a business need.
The generic text-chat capability is outside the stated product-photo studio purpose and allows arbitrary prompt submission to a text model. In an agent setting, that creates a hidden alternate execution path that can be used to bypass intended workflow restrictions, send unrelated sensitive content to the provider, or expand the skill into a general-purpose LLM tool without review.
Video-generation support exceeds the declared functionality of a product-photo image studio and materially broadens what the skill can do. Hidden or undocumented media-generation paths increase abuse potential, including unauthorized content creation, policy evasion, and higher-cost operations triggered through an ostensibly image-only integration.