T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:107- Finding
AI-HIVE API Credential 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 an AI-HIVE apparel image workflow, but it needs review because the API client can forward credentials and user-selected media through unvalidated endpoints and persists an API key locally.
Install only if you intend to use AI-HIVE for this workflow, keep the base URL on the official AI-HIVE endpoint, review every command before running it, provide only media files you are authorized to upload, and avoid storing a valuable production API key unless you trust the local environment and this package.
scripts/imagegen.py:107AI-HIVE API Credential Disclosure Through an Unrestricted Base URL
scripts/imagegen.py:280Unvalidated Server-Supplied URLs Can Redirect Media Uploads and Trigger Arbitrary Downloads
scripts/imagegen.py:399Server-Controlled Task Metadata Enables Output Path Traversal
The declared description promises an operational image-production skill centered on AI服装换模特, including handling image inputs and optionally executing a full external API workflow to generate outputs. The supplied code only creates a JSON brief template from command-line inputs. While the blueprint content is thematically related to the declared domain, the actual primary purpose is planning/document generation, not clothing-model replacement or AI image production. This is a material description-behavior mismatch.
The description presents a domain-specific apparel model-swap skill whose core purpose is preserving garment shape/texture while replacing person and scene for e-commerce imagery. The supplied code does include AI-Hive integration details consistent with the description (model lookup, upload, pricing snapshot, routing modes, async polling, and download). However, the actual implementation is much broader and materially different: it is a generic AI-Hive command-line client for text, image, and video tasks, plus account/model inspection. The skill-specific layer merely fixes a model ID and forwards a prompt/images to a generic image-generation endpoint. There is no code that enforces or checks 'only replace person and scene', no garment-anchor preservation logic, no multi-pose workflow beyond generic batch generation, no product consistency analysis, and no dedicated processing of background/proportion/platform requirements except whatever a free-form prompt may express. Because the code exposes substantial undeclared capabilities and lacks much of the specialized behavior claimed in the description, this is a description/behavior mismatch.
The implementation includes generic text chat and video generation paths that materially exceed the stated capability of apparel model-swap image generation. In an agent environment, this hidden expansion of capability can be abused to route prompts and uploaded media into other model classes, bypassing policy expectations, billing boundaries, or review assumptions tied to the advertised skill.
The skill advertises and includes runnable command examples that imply use of environment variables, filesystem access, network calls, and shell execution, but it declares no explicit tool scope or permission boundaries. In an agent environment, this can lead to overbroad ambient authority: the skill may be invoked with more capabilities than users or reviewers expect, increasing the risk of unintended network exfiltration, local file access, or execution of costly operations.
The default prompt auto-invokes the skill based on a very broad phrase ('turn my request') without narrowing to explicit apparel model-swap intents. Combined with allow_implicit_invocation: true, this can cause the skill to activate for generic image-generation or workflow requests, increasing the chance of unintended execution paths, policy bypass attempts, or use in contexts the skill explicitly warns against.
The top-level docstring explicitly describes the program as a general AI capability invocation tool, while later branding presents it as a specialized apparel model-swap skill. That contradiction is dangerous because it obscures the true operational scope during review, making reviewers and users more likely to grant trust, permissions, or secrets under false assumptions.
This code file contains user-facing natural-language descriptions and prompts that assume Chinese, including the module docstring and later CLI help/output strings. Because the skill does not offer an opt-in language selection or clearly justify a Chinese-only locale, it violates the language/locale policy criteria.
The file advertises a narrowly scoped apparel model-swap skill, but it exposes broader operations such as user-info lookup, model enumeration, generic media upload, and task inspection. This scope mismatch weakens least-privilege expectations and can let a caller use the skill as a general API client, increasing the chance of unauthorized account inspection or unintended data handling beyond the declared purpose.