T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer API Key Can Be Sent to an Untrusted or Plaintext Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a disclosed AI image background tool, but it handles an API key and local uploads with loose endpoint and file scoping that users should review before installing.
Install only if you trust AI Hive with the images and prompts you provide. Keep the API key private, avoid custom AI_HIVE_BASE_URL or --base-url values unless you fully trust the endpoint, and do not use the upload command on unrelated local files.
scripts/imagegen.py:91Bearer API Key Can Be Sent to an Untrusted or Plaintext Endpoint
SKILL.md:69Runtime Dependency Is Installed Without Version or Integrity Pinning
The skill is presented as a narrowly scoped background-replacement tool, but the detected behavior includes much broader functions such as generic chat, video generation, user-info access, model enumeration, uploads/downloads, browser interaction, and API-key initialization. This mismatch is dangerous because users and reviewers may trust the skill with sensitive media or data under a limited-use assumption, while the implementation appears capable of performing unrelated and potentially privacy-impacting actions.
The file contains unrelated chat and video generation capabilities despite the skill claiming to be only for image background replacement. In an agent-skill ecosystem, hidden or unnecessary extra capabilities expand the attack surface and may let callers invoke higher-risk functions that bypass user expectations, review assumptions, or permission boundaries.
This markdown file contains user-facing natural-language content exclusively in Chinese, and there is no indication that the skill is region-specific or that users can opt into another language. Under the policy rule for language/locale constraints, forcing a single language without opt-in is a natural-language policy concern.
The skill exposes executable examples that rely on shell, file, environment, and network capabilities, but it does not declare any tool scope or allowed-tools boundary. This weakens least-privilege controls and can let the agent invoke broader capabilities than users or reviewers would expect, increasing the chance of unintended file access, network calls, or command execution.
The description says to use this skill for a wide range of generic tasks such as background replacement, scene swapping, ID-photo backgrounds, localization environments, and batch background versions. It does not define explicit trigger phrases, activation boundaries, or negative examples, so the skill could be invoked for ordinary editing requests more broadly than intended.
The skill metadata and instructions are written in Chinese, and one example explicitly reserves space for Japanese typography while stating not to generate translation. This indicates a locale-specific behavior without documenting user choice or an explicit opt-in, which can conflict with language/locale policy expectations.
The module docstring and nearly all user-facing prompts and help text in this file are written only in Chinese, which effectively imposes a specific language on users. The file does not offer any language selection, locale opt-in, or documented justification for being Chinese-only.
Account-info retrieval and model enumeration are not necessary for a dedicated background-replacement skill and expose additional metadata about the user's account and available services. This violates least privilege and can aid reconnaissance, billing discovery, or unauthorized capability discovery if the skill is invoked in broader agent workflows.
The skill is presented as a narrowly scoped GPT Image 2 background-replacement tool, but the exposed generate path forwards arbitrary prompts and parameters to a generic image generation endpoint. This scope mismatch can mislead users and higher-level agents into granting broader image editing/generation capability than intended, weakening least-privilege assumptions and policy enforcement.
The example API key placeholder uses Chinese text ('请替换为你的APIKey'), which imposes a specific language in user-facing configuration content. There is no indication that the skill is intended only for Chinese-speaking users or that alternative language/localization is supported.
The top-level docstring states this file is a '通用 AI 能力调用工具' wrapping text chat, image generation, video generation, model queries, media upload, and task polling. That directly conflicts with the skill manifest/name, which present the file as a specialized GPT Image 2 background-replacement skill.