T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
API Credential and Request Data Disclosure Through an Unrestricted Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill broadly fits its image-generation purpose, but it handles API keys and media through configurable and server-provided URLs without enough destination safeguards.
Install only if you trust AI-HIVE and will keep API keys scoped and revocable. Avoid using custom --base-url or AI_HIVE_BASE_URL values unless you control the endpoint, and review any generated command before running it, especially commands that upload files, download results, or may incur charges.
scripts/imagegen.py:91API Credential and Request Data Disclosure Through an Unrestricted Base URL
scripts/imagegen.py:280Unvalidated Server-Provided URLs Permit Arbitrary Upload and Download Requests
The declared description promises an operational image-production skill centered on AI-HIVE orchestration for image generation/editing workflows. The supplied code only parses command-line arguments and writes a JSON brief containing metadata such as project, audience, goal, platform, format, aliases, required facts, and expected artifacts. While this output loosely supports the planning phase of the described workflow, it does not implement the core advertised capabilities. Therefore the description materially overstates what the code actually does.
The skill advertises executable workflows that use environment variables, filesystem access, shell commands, and network calls, but it does not declare any explicit tool scope or permissions boundaries. This creates a confused-deputy risk where an agent may invoke the skill with broader capabilities than intended, enabling unauthorized network access, local file handling, or secret exposure if the surrounding platform permits those tools.
Overly broad trigger phrases like generic image generation, editing, and advertising terms can cause the skill to activate in many unrelated conversations. In an agentic environment, unintended invocation may expose user data or route requests into a workflow with networked or billable actions that the user did not actually intend to use.
Ambiguous usage conditions spanning broad business scenarios increase the chance that the skill will be selected for loosely related e-commerce, marketing, or social-media tasks outside its safest operating envelope. That raises the risk of accidental handling of sensitive assets, copyrighted media, or paid generation flows without clear user authorization or fit-for-purpose checks.
The default prompt hard-codes Chinese output ('production-ready Chinese workflow') regardless of the user's language preference. This can cause unintended behavior, reduce transparency, and increase the chance that users approve or execute generated workflow steps they do not fully understand, especially when the skill also produces runnable commands.
Implicit invocation is enabled without clear trigger constraints, so the skill may auto-activate for broad image-generation or marketing-related requests and begin steering users into executable AI-HIVE workflows. In a skill that can generate runnable commands and handle uploads, pricing, polling, and downloads, over-broad auto-invocation raises the risk of unintended tool use, user confusion, and accidental execution of costly or sensitive operations.
The file presents itself as a specialized Seedream 5 image-studio skill, but it actually bundles generic AI-Hive text, image, video, upload, and task APIs. This expands the skill’s effective capability surface beyond what users and platform reviewers would reasonably expect, increasing the risk of policy bypass, unintended data handling, and misuse through commands that are unrelated to the declared purpose.
The module docstring and subsequent user-facing strings are entirely in Chinese, and the CLI provides no option to choose language or locale. This creates a natural-language policy issue because the skill effectively requires a specific language for operation and user guidance without explicit opt-in or documented regional scope.
The text-chat endpoint enables a materially different capability from the advertised image-studio purpose, allowing arbitrary prompt exchange with AI-Hive models. In a skill ecosystem, that mismatch can be exploited to gain undeclared general-purpose model access, route sensitive user content to unintended services, or bypass controls that would apply to a narrowly scoped image skill.
Video generation is outside the stated Seedream 5 image-studio function, yet the code includes full support for uploading media and submitting video jobs. That capability broadening can let operators use the skill as a covert multi-modal generation tool, undermining least-privilege expectations and increasing abuse potential beyond what the skill description authorizes.
The skill description and several user-facing default/content strings are presented only in Chinese, with no indication that language is selectable or that the skill is region-specific. This can constitute a language/locale policy issue because the skill appears to impose one locale rather than offering user choice or documenting the constraint.
This code writes structured output to a user-specified path, potentially creating directories and overwriting or creating files, but it provides no prior warning, confirmation, or inline comment/docstring describing that filesystem modification. While printing the resolved path afterward helps visibility, it occurs only after the write has already happened.
The top-level docstring and parser description explicitly present the file as a '通用 AI 能力调用工具' covering chat, image, video, upload, and polling, while the embedded skill configuration identifies it as a Seedream 5 image-studio skill. This is an active documentation-level contradiction about the intended scope of the file.