T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer API Key Disclosure Through an Unrestricted Custom API Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to be a real AI-HIVE image workflow, but it needs review because it can send API keys and files to configurable endpoints and can automatically create paid remote tasks.
Review before installing. Use this only when you explicitly want AI-HIVE to process selected files, create remote generation tasks, and possibly incur charges. Do not set --base-url, AI_HIVE_BASE_URL, or config base_url to anything other than the trusted AI-HIVE endpoint unless you are using a separate test key, and keep the saved API key scoped and revocable. Prefer a dedicated output directory and avoid implicit/automatic use for broad image or ecommerce prompts.
scripts/imagegen.py:91Bearer API Key Disclosure Through an Unrestricted Custom API Endpoint
scripts/imagegen.py:398Arbitrary File Write Through Unsanitized Server-Controlled Download Paths
The skill describes executable workflows that use environment variables, local file reads/writes, network access, and shell commands, but it declares no explicit tool scope or permission boundaries. In an agent environment, this can lead to over-privileged execution where the skill may read secrets, write arbitrary files, or make unintended external requests without clear user or platform controls.
The invocation description is extremely broad and overlaps with many generic image-generation, editing, marketing, and ecommerce intents. This increases the chance of the skill being auto-invoked in unrelated contexts, causing unintended data transfer to a third-party service, mistaken task execution, or surprise billing.
The search coverage block enumerates a very large set of generic AI, ecommerce, social, and third-party product terms without tight boundaries. In routing systems that match on keywords, this can hijack prompts intended for other tools or benign discussion, leading to unnecessary external calls, file uploads, or paid task creation.
The original search-intent section expands matching to many competitor tools, marketplaces, and migration scenarios, making activation ambiguous and overly aggressive. This can cause the skill to intercept comparison or research queries and steer users into a workflow that uploads assets, uses API keys, and may incur charges despite the user not explicitly requesting this skill.
The skill enables implicit invocation without any visible trigger constraints, which can cause the agent to call an external image-generation workflow automatically based on loosely related user intent. In this skill’s context, implicit execution is more dangerous because it can upload user-supplied reference images, create remote tasks, poll job status, and download generated outputs, increasing the chance of unintended data transfer, unexpected costs, and unauthorized third-party processing.
The module docstring and the generic CLI implement text chat, video generation, model listing, user-info lookup, media upload, and task polling, making this a general AI-Hive client rather than a narrowly scoped Douyin ecommerce image-generation/editing skill. Although the skill-specific entrypoint at the bottom limits exposed commands, the code in this skill file still contains substantially broader behavior than the manifest claims.
The top-level docstring explicitly says this is a “通用 AI 能力调用工具” and lists text chat, image generation, video generation, model query, media upload, and task polling. That actively conflicts with the skill manifest’s specialized purpose of Douyin ecommerce image generation/editing, making the documentation misaligned with the intended skill scope.
The module docstring and user-facing interface are written entirely in Chinese, and the script's prompts, errors, and help text consistently assume Chinese-language operation. There is no indication that users may choose another language or that the locale restriction is required for a justified region-specific compliance purpose.
The manifest metadata sets language: zh-CN, which indicates a fixed locale preference. The file does not clearly offer a user language choice or explain that the locale restriction is required for a region-specific compliance purpose.
The example API key value includes Chinese-only instructional text ("请替换为你的APIKey"), which imposes a specific language in user-facing configuration content. There is no indication that the skill is region-specific or that users may choose another language, so this is a natural-language locale policy issue.