T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:92- 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
This skill is mostly an AI-HIVE image workflow, but it handles API keys and network destinations in ways that need careful review before installation.
Review before installing. Use only the official AI-HIVE endpoint, avoid setting AI_HIVE_BASE_URL or --base-url unless you fully trust the host, keep the API key low-privilege if possible, and do not upload sensitive media. Prefer running it in an isolated environment and confirm all paid generation commands before execution.
scripts/imagegen.py:92API Key Disclosure Through an Unrestricted Custom Base URL
scripts/imagegen.py:278Unvalidated Server-Supplied Upload and Download URLs
scripts/imagegen.py:5Unpinned Runtime Dependency Installation Guidance
The supplied code only creates a local JSON file containing metadata such as project, audience, goal, platform, and format, plus some static lists. This is at most a preparatory brief generator for an image workflow, not the described image studio itself. The declared description promises substantial operational capabilities—commercial image generation/editing, API-based orchestration, asset handling, and delivery workflows—that are not implemented in this code chunk. While the blueprint may support the broader skill, the actual code’s primary purpose is materially narrower than the declared purpose, so this is a mismatch.
The skill includes executable code examples that use environment variables, local files, network access, and shell commands, but it does not declare any explicit tool scope or permission boundaries. In an agent setting, this can lead to over-broad capability exposure, making accidental or unauthorized execution of file, network, or shell operations more likely.
The default prompt hard-codes a production-ready Chinese workflow regardless of the user's stated language preference. This can override user intent, cause unintended data transformation, and create reliability and policy issues in multilingual contexts, especially for commercial image-generation tasks where exact wording matters.
Implicit invocation is enabled without narrowing conditions, which increases the chance that the skill auto-activates on loosely related requests. Because this skill can produce runnable AI-HIVE commands and operational workflows, overbroad activation could cause unintended tool use, unexpected external API interactions, or bypass of normal user confirmation expectations.
The script’s natural-language identifiers and defaults are presented only in Chinese, including the title, description, and search aliases, with no opt-in or documented locale constraint. This can violate language/locale policy when a skill implicitly requires one language rather than offering a user choice or stating that it is region-specific.
The file-level documentation and substantial portions of the code expose a general-purpose AI Hive CLI for text chat, model enumeration, user-info lookup, media upload, and video generation, while the manifest describes a GPT Image 2 image studio focused on image generation/editing workflows. Although the generated skill entrypoint later narrows the exposed commands, this file actually contains and documents materially broader operations than the skill claims.
The module docstring explicitly says this is a '通用 AI 能力调用工具' and lists text chat, image generation, video generation, model queries, media upload, and task polling. That directly conflicts with the skill’s declared intent as a dedicated GPT Image 2 image studio for image generation/editing rather than a general AI capability wrapper.
This code file contains natural-language descriptions and user-facing help text entirely in Chinese, starting from the module docstring. The skill does not offer any language or locale choice, which can violate organizational language/locale policy when users have not opted into Chinese output.