T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:95- Finding
API Credential 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 image-generation purpose, but it stores an API key locally and can send that key to any configured API endpoint.
Review this skill before installing. Only use the default AI Hive endpoint unless you fully trust a custom endpoint, because the API key is sent with requests. Expect reference images and generated outputs to pass through AI Hive, and remove or rotate the key in ~/.ai-hive/config.json if you no longer want it stored locally.
scripts/imagegen.py:95API Credential Disclosure Through an Unrestricted Custom Base URL
SKILL.md:66Unpinned Runtime Dependency Installation
The skill invokes a Python script, installs a package, and supports task execution, which implies shell, network, file, and environment access, yet it declares no explicit tool restrictions. This creates an overprivileged execution surface: an agent may grant broader capabilities than necessary, making misuse or prompt-injection-driven abuse more likely if the script or surrounding runtime is compromised.
The description includes Chinese text alongside English, but the file does not state that the skill is intended specifically for Chinese-speaking users or offer language/locale selection. This can create an implicit language policy issue because the skill surface is not consistently localized or opt-in by user preference.
The module docstring describes this file as a general-purpose AI Hive tool supporting text chat, image generation, video generation, model querying, media upload, and task polling, and the code implements those generic capabilities via chat/video/model/user-info commands. That is broader than the skill manifest, which claims an Amazon catalog image generation/editing skill focused on creating and editing e-commerce imagery.
The init flow persists the API key to ~/.ai-hive/config.json without an explicit warning that a long-lived credential will be stored on disk. Although the code sets file permissions to 0600, users may still unknowingly leave sensitive credentials resident on shared, backed-up, or synchronized systems, increasing the chance of credential exposure and unauthorized API use.
This markdown file contains substantive natural-language content exclusively in Chinese, but does not state that the skill is Chinese-only, region-specific, or user-selectable by locale. Under the policy rule for language/locale, forcing a specific language without opt-in can be a natural-language policy violation.
The example API key placeholder uses Chinese text ('请替换为你的APIKey'), which imposes a specific language in user-facing configuration content. There is no accompanying opt-in, alternative language, or justification for a locale-specific constraint.
The module docstring and user-facing CLI strings are written in Chinese, and the skill does not offer users a language/locale option. This can violate language/locale policy when a skill implicitly forces one language without opt-in or justification.
The init flow launches the user's browser to an external chat/login page using webbrowser.open, which is not an obvious requirement of an Amazon image-generation/editing skill itself. While useful for setup, it is an additional local-system capability outside the core stated purpose of creating and editing catalog images.
No suspicious patterns detected.