T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:64- Finding
API Key Disclosure Through an Unrestricted Custom Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its AI-HIVE image workflow purpose, but it needs Review because its API key can be sent to an unvalidated custom server.
Install only if you are comfortable with an AI-HIVE CLI that stores an API key locally, uploads selected media, downloads generated results, and may submit billable generation tasks. Do not use a custom AI_HIVE_BASE_URL or --base-url unless you fully trust that endpoint, and prefer a dedicated low-privilege API key that you can revoke.
scripts/imagegen.py:64API Key Disclosure Through an Unrestricted Custom Base URL
scripts/imagegen.py:13Unpinned Third-Party Dependency Installation
The declared description presents a full-featured AI image prompt generation and AI-HIVE integration skill. The supplied code chunk only creates a local JSON file from command-line arguments. While some field names loosely align with the declared domain (image prompts, reference strategy, required facts), the implemented behavior is materially narrower and different from the promised functionality. This is a description-behavior mismatch because the primary declared capabilities are absent in the code shown.
The skill advertises executable workflows and code examples that use environment variables, local files, shell commands, and outbound network access, but it does not declare any explicit tool scope or permissions boundaries. This creates a least-privilege and review gap: a host may allow broader capabilities than users expect, increasing the chance of unintended file access, command execution, or exfiltration if the skill is invoked or extended.
Using the generic trigger term "Prompt" makes the skill eligible for many unrelated conversations, increasing the likelihood of accidental invocation. In a skill that references code execution, external APIs, and potentially billable generation actions, overbroad activation can cause unintended tool exposure, user confusion, or accidental task initiation in contexts that did not request this capability.
The activation condition for broad commercial/content scenarios is loosely defined, which can cause the skill to activate outside its intended scope. Because the skill discusses reference materials, brand assets, networked API operations, and charged generation workflows, ambiguous invocation increases the risk of mishandling sensitive assets, policy-bypassing use cases, or unintended external actions.
The manifest presents the skill as an image-prompt assistant, but the default prompt expands behavior into production-ready workflows and runnable AI-HIVE commands. This creates a capability mismatch: users or upstream orchestrators may invoke the skill expecting text-only prompt help, while it steers toward operational code and execution-oriented actions, increasing the chance of unintended API use, asset uploads, or downstream automation without clear user awareness.
The default prompt says to use the skill to turn 'my request' into a production-ready workflow, which is broad enough to trigger on loosely related user inputs. With implicit invocation enabled, this can cause the skill to activate unexpectedly and produce operational guidance or commands in contexts where the user did not clearly request this capability.
Forcing a 'production-ready Chinese workflow' without checking user preference can override user intent and create confusion, misinterpretation, or unsafe reliance on outputs the user cannot easily review. In a skill that may also emit runnable commands, language coercion reduces transparency and can make review of generated operational steps harder for non-Chinese-speaking users.
The script presents the skill name, description, and generated metadata primarily in Chinese, including default values and aliases, without offering any language choice or stating that the skill is intentionally region-specific. This can violate language/locale policy when users are not given an explicit opt-in or alternative locale.
The file advertises and implements a generic AI client supporting chat, image, video, model enumeration, upload, and task polling, while the skill metadata describes a narrowly scoped image-prompt master. This capability mismatch increases attack surface and can enable unintended use of the skill as a general-purpose AI gateway, weakening policy boundaries and review assumptions.
This code file contains natural-language descriptions and CLI messages that are consistently Chinese-only, starting from the module docstring and continuing through the command help and runtime prompts. Because the skill does not provide user opt-in for language selection or explain that it is intentionally region-specific, it violates the language/locale policy criterion.
The dedicated video-generation pipeline is outside the stated purpose of an image-prompt/image-generation skill and gives callers access to a broader media synthesis surface than expected. In practice this can be used to bypass product scoping, create unreviewed content types, and increase abuse potential without clear user or reviewer awareness.
This code creates parent directories and writes a JSON file to a user-supplied or default path, which is a data-modifying operation. There is no confirmation prompt, warning-oriented message, or explanatory comment/docstring stating that the script will create directories and overwrite/write an output file.
The generic text chat endpoint is broader than necessary for an image prompt master and allows the skill to act as a general multimodal chat wrapper rather than a focused prompt-construction tool. While lower risk than video generation, it still expands functionality beyond declared scope and may undermine least-privilege design and trust in the manifest.