T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:90- Finding
Bearer API Key Can Be Transmitted to a Configurable Untrusted Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches an AI-HIVE image-generation workflow, but it handles API credentials in a way that can send the bearer key to an arbitrary configured endpoint.
Review before installing. Use only the official AI-HIVE endpoint, avoid setting AI_HIVE_BASE_URL or --base-url unless you fully trust the destination, store the API key in a dedicated low-privilege account if possible, and install dependencies in an isolated virtual environment. Rotate the AI-HIVE key if it may have been used with a custom or untrusted endpoint.
scripts/imagegen.py:90Bearer API Key Can Be Transmitted to a Configurable Untrusted Endpoint
SKILL.md:57Runtime Dependency Is Installed Without Version or Integrity Pinning
The skill describes and demonstrates capabilities that read environment variables, write local configuration files, invoke shell commands, and access the network, yet it declares no explicit permission or allowed-tools scope. This creates an authority-transparency gap: a user or host system cannot easily tell what privileged actions the skill may perform, increasing the risk of unintended secret access, local file modification, or external data exfiltration if the skill is executed in an over-permissive environment.
The manifest sets language: zh-CN, and the document consistently frames the skill for Chinese usage, including explicit output requirements like '保持简体中文'. There is no indication that users can choose another language or locale, which can violate language/locale policy requirements when not documented as a justified regional-only tool.
The display name, description, and default prompt are all written in Chinese, which indicates a fixed language presentation. There is no indication that users can opt into another language or that the skill is intentionally restricted to a Chinese-speaking context.
The skill enables implicit invocation globally without any trigger constraints, exclusions, or user-confirmation guardrails. In a skill that can submit image-generation/editing jobs, upload reference assets, and save task IDs/results, this increases the chance of unintended activation and action execution from loosely related user prompts or prompt-injected context.
The file presents itself as a GPT Image 2 image-generation/editing skill, but the module-level design and documentation expose a broader general-purpose AI-Hive client surface. Excess capability in a narrowly scoped skill increases attack surface, makes review harder, and can enable unintended use paths that bypass product or policy expectations.
The module docstring and user-facing instructions are written exclusively in Chinese, and the CLI help and prompts throughout the file continue that requirement. This creates a language policy concern because the skill effectively mandates a specific language/locale without documenting opt-in or offering an alternative.
Including text-chat and video-generation endpoints in a skill advertised only for GPT Image 2 image workflows violates least privilege and creates hidden functionality beyond the declared scope. In agent environments, such latent capabilities can be invoked accidentally or intentionally to exfiltrate data, consume credits, or perform unreviewed operations under the user's API key.
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 surrounding skill identity and manifest, which present a specialized GPT Image 2 image-generation/editing skill rather than a general AI-Hive multipurpose client.