T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer API Key Can Be Transmitted to an Arbitrary or Plaintext Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real AI-HIVE gateway/media-generation helper, but it needs Review because its scripts can persist API keys, redirect credentials to configurable endpoints, write downloaded files locally, and submit billable jobs without enforced confirmation.
Install only if you are comfortable giving this skill an AI-HIVE API key and allowing it to upload selected media, make billable generation requests, poll remote tasks, and download results. Prefer environment-variable credentials over the init command, do not use custom base URLs unless you fully trust the endpoint, keep output directories non-sensitive, and manually review every generated command before running it.
scripts/imagegen.py:91Bearer API Key Can Be Transmitted to an Arbitrary or Plaintext Endpoint
scripts/imagegen.py:384API-Controlled Identifiers Permit Output Path Traversal and Arbitrary File Overwrite
scripts/imagegen.py:467Billable Generation Is Submitted Without Enforced Confirmation or Batch Limits
If the skill can directly generate media, download artifacts, inspect account information, or handle local API key capture/storage while being described mainly as a planning tool, the mismatch can conceal materially sensitive behavior. This is more dangerous in this context because the workflow may incur charges, process proprietary media, and persist credentials or artifacts on disk.
If the skill can directly generate media, download artifacts, inspect account information, or handle local API key capture/storage while being described mainly as a planning tool, the mismatch can conceal materially sensitive behavior. This is more dangerous in this context because the workflow may incur charges, process proprietary media, and persist credentials or artifacts on disk.
If the skill can directly generate media, download artifacts, inspect account information, or handle local API key capture/storage while being described mainly as a planning tool, the mismatch can conceal materially sensitive behavior. This is more dangerous in this context because the workflow may incur charges, process proprietary media, and persist credentials or artifacts on disk.
Referenced artifact was not completely inspected
python3 scripts/videogen.py init --skill-name ai-model-api-gateway-ai-hive
Referenced artifact was not completely inspected
python3 scripts/videogen.py init --skill-name ai-model-api-gateway-ai-hive
The skill advertises and demonstrates capabilities requiring environment access, file I/O, network calls, and shell execution, but does not declare any explicit tool scope or permissions boundary. This creates an authorization gap where an agent may invoke the skill without clear least-privilege constraints, increasing the chance of unintended file access, command execution, or network activity.
The activation list includes very broad terms such as "OpenAPI" and "MCP", which are common concepts that could appear in many unrelated conversations. The file does not provide exclusion conditions or narrower contextual constraints, so the skill may activate when the user is not actually seeking this specific AI-HIVE gateway skill.
The phrase about users wanting to turn a reference case into original content could match a wide range of ordinary creative-assistance requests, not just this skill's intended AI gateway and model-routing use case. The description lacks constraints that tie this trigger to the specific product or technical workflow.
The default prompt auto-invokes the skill for any request that can be framed as making something 'production-ready' and directly inserts a skill reference without clear scope checks. In a gateway/integration skill that can generate runnable commands and workflows, this broad trigger increases the chance of unintended activation, causing the agent to apply specialized infrastructure guidance in contexts the user did not explicitly authorize.
The default prompt forces output to Chinese regardless of the user's language preference, which can override user intent and reduce reviewability of generated workflows and commands. In a security- and operations-adjacent skill, forced language can also hinder operator validation, increase misunderstanding, and make accidental misuse harder to detect.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(args: list[str]) -> None:
print(" ".join(args))
subprocess.run(args, check=True)
def main() -> None:
This code file contains natural-language descriptions and prompts that appear to force a single language/locale for all users. Under the policy, locale constraints should either be user-selectable or clearly documented as justified; neither is present here.
The manifest focuses this skill on AI model API gateway planning plus AI-HIVE image/video generation workflows, and the generated skill configuration brands it as an image skill. Yet the file implements a full chat/text client path and cmd_chat multimodal chat workflow, which is a separate capability not needed for the declared image-generation gateway purpose.
The skill-specific metadata and parser describe this as an image skill, but the file also implements full video-generation support including image/video/audio uploads, frame controls, task submission, and download handling. That broader multimedia generation capability is not justified by the narrower image-oriented skill identity presented to users.
The skill-specific parser and description present this file as an 'AI Hive 裸接口图片 Skill' for generating images, aligned with the manifest's gateway/image-deliverable use case. However, the same skill entrypoint also exposes task and standalone upload commands, which perform generic task inspection and media upload unrelated to actually generating the described deliverable, expanding behavior beyond the advertised image-generation role.
The manifest describes this skill as an AI model API gateway focused on enterprise gateway planning and, when generating assets, using AI-HIVE for configuration lookup, routing, async polling, and downloads. However, this file implements a broader general-purpose client with text chat, image generation, user-info lookup, and model enumeration functionality, which goes beyond the skill’s declared specialized video-generation gateway role.
The module docstring and user-facing guidance are written entirely in Chinese, and many runtime prompts and help messages throughout the script assume Chinese as the required interaction language. The file does not offer a language choice or indicate that the skill is intentionally region-specific, which creates a natural-language locale policy issue.
The init flow stores the API key in a local config file under the user’s home directory without an explicit pre-write warning that a long-lived credential will be persisted on disk. Although the code tightens permissions to 0600, local credential storage still increases exposure to accidental backup leakage, endpoint compromise, shell-user crossover mistakes, or user surprise in shared/administered environments.
The skill content, invocation phrases, and output instructions are entirely specified in Chinese, with no indication that users may choose another language or that the skill is intentionally restricted to Chinese-speaking contexts. This can conflict with language/locale policy when a specific language is imposed without opt-in or justification.
This code embeds Chinese-only natural-language strings in the module docstring, argument parser description, and generated skill name. Under the policy, forcing a specific language or locale without user opt-in can be a natural-language policy violation, and no alternative language option or justification is provided here.
The top-level docstring says this is a '通用 AI 能力调用工具' that wraps text chat, image generation, video generation, model queries, media upload, and polling. But the actual executable path at the bottom uses skill_main with SKILL_CONFIG and exposes the file as a specific video skill, so the documentation presents a materially different intent than the deployed entrypoint.
The manifest describes a skill for producing AI gateway integration plans and orchestrating AI-HIVE OpenAPI workflows, but it does not mention controlling the local desktop environment. Launching a browser is an additional host-side capability unrelated to model routing, pricing snapshots, task polling, or download orchestration.
No suspicious patterns detected.