T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:92- Finding
API Credential Can Be Transmitted to an Arbitrary Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real AI-HIVE image-generation skill, but it needs review because its API client can send the user's AI-HIVE key to a configurable remote host.
Use this only if you intend to connect to AI-HIVE and run image-generation workflows. Do not set --base-url, AI_HIVE_BASE_URL, or a custom base_url in ~/.ai-hive/config.json unless you fully trust that endpoint; use a dedicated limited API key, confirm prompts and routing before paid jobs, and upload only media you are authorized to share.
scripts/imagegen.py:92API Credential Can Be Transmitted to an Arbitrary Endpoint
scripts/imagegen.py:14Unpinned Runtime Dependency Installation
The declared description promises a broad image-studio capability centered on actual media generation/editing and AI-HIVE service orchestration. The supplied code only creates a local JSON blueprint containing metadata such as project, audience, goal, platform, and format. This is not just an implementation subset; it reflects a materially different primary purpose: brief/spec generation rather than image production or editing. While the produced artifacts mention prompts and delivery checks, the code does not actually create those beyond listing them as static strings. Therefore the description significantly overstates what the code chunk does.
The skill includes runnable code and operational guidance that imply access to environment variables, local files, shell commands, and network endpoints, but it does not declare any explicit tool scope or permission boundaries. This is dangerous because an agent may invoke broader capabilities than users expect, including reading local reference assets, using API keys from the environment, and making external calls to a third-party service without clear least-privilege constraints.
The trigger phrases are broad enough to capture many ordinary image-related requests, increasing the chance that the skill is invoked when the user did not intend to authorize external generation, asset upload, or potentially billable API usage. In this context, overbroad activation is risky because the skill handles third-party uploads, routing decisions, and asynchronous task execution, which can expose user data or incur cost if engaged unnecessarily.
The default prompt auto-frames the skill as a general entry point for turning requests into a workflow, runnable AI-HIVE commands, and deliverables, but it does not constrain when that behavior is appropriate. Because the skill handles external-image generation/editing operations and production-ready outputs, broad activation increases the chance of unintended invocation on ambiguous requests, causing overreach, unwanted tool use, or unsafe content transformation without explicit user intent.
The default prompt explicitly instructs the skill to produce a "production-ready Chinese workflow," which imposes a specific language choice without offering the user an opt-in or alternative. This is a natural-language locale policy concern because the skill enforces Chinese regardless of user preference.
Enabling implicit invocation without tight activation constraints allows the skill to be selected automatically based on loose semantic similarity rather than explicit user consent. In a skill that can generate runnable commands, interact with external APIs, and process marketing/e-commerce imagery, this raises the risk of accidental activation, unexpected external actions, and policy-sensitive image manipulation workflows being initiated in the wrong context.
The file exposes broader capabilities than the declared image-studio skill, including generic chat and video generation. In a skill-based environment, this scope mismatch can bypass least-privilege expectations and allow callers to invoke unintended paid or sensitive operations through a skill that appears narrowly scoped.
The module presents itself as a general-purpose AI tool rather than a specialized image-studio skill, which creates a documentation-to-behavior mismatch. That mismatch increases the chance that reviewers, orchestrators, or users grant trust or access under false assumptions, enabling misuse of hidden broader functionality.
This code file contains natural-language descriptions, help text, and runtime prompts entirely in Chinese, which effectively forces a specific language/locale on users. The file does not offer any user opt-in, fallback, or locale selection mechanism, so it conflicts with the policy against imposing a language without choice.
The skill can call a user-info endpoint that returns account and wallet details unrelated to image generation. This expands data access beyond business need and can expose sensitive billing or account metadata if the skill is invoked in contexts where only media operations were expected.
This code embeds Chinese-language naming in the module docstring, argument parser description, and generated JSON skill field, with no option for the user to select a language or locale. The stated policy for this review flags language or locale constraints when they are imposed without user choice or clear justification.