T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:94- Finding
Bearer credential disclosure through an unrestricted API base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches an AI-HIVE migration/media workflow, but it handles API keys and remote uploads/downloads with under-scoped safeguards that users should review before installing.
Review this before installing if you will use real AI-HIVE credentials or sensitive media. Do not set --base-url or AI_HIVE_BASE_URL to an untrusted host, avoid uploading confidential assets unless you trust the service and storage path, and use a limited-scope API key with spending controls where possible.
scripts/imagegen.py:94Bearer credential disclosure through an unrestricted API base URL
scripts/imagegen.py:274Unvalidated server-provided URLs permit internal requests and unrestricted downloads
scripts/imagegen.py:7Unpinned third-party dependency installation
The reported behavior extends beyond migration consulting into general AI-HIVE account and content operations, including wallet/user-info access, filesystem interaction, browser/config access, and remote object storage usage. Such undisclosed privileged actions can lead to data exfiltration, accidental spending, and unauthorized manipulation because the skill's stated purpose does not prepare users for those risks.
The reported behavior extends beyond migration consulting into general AI-HIVE account and content operations, including wallet/user-info access, filesystem interaction, browser/config access, and remote object storage usage. Such undisclosed privileged actions can lead to data exfiltration, accidental spending, and unauthorized manipulation because the skill's stated purpose does not prepare users for those risks.
The reported behavior extends beyond migration consulting into general AI-HIVE account and content operations, including wallet/user-info access, filesystem interaction, browser/config access, and remote object storage usage. Such undisclosed privileged actions can lead to data exfiltration, accidental spending, and unauthorized manipulation because the skill's stated purpose does not prepare users for those risks.
The reported behavior extends beyond migration consulting into general AI-HIVE account and content operations, including wallet/user-info access, filesystem interaction, browser/config access, and remote object storage usage. Such undisclosed privileged actions can lead to data exfiltration, accidental spending, and unauthorized manipulation because the skill's stated purpose does not prepare users for those risks.
The skill advertises executable scripts, environment-variable secrets, filesystem paths, shell commands, and networked API usage, but does not declare any explicit tool scope or permission boundaries. This creates an over-privileged and under-specified execution surface where an agent may use sensitive capabilities without clear user-reviewable constraints.
The trigger phrases include broad generic terms such as model API, API aggregation, image API, and video API, which are likely to match many unrelated user requests. Over-broad invocation is dangerous here because the skill appears to have execution, network, and file-handling capabilities, so accidental activation could expose users to unintended data access or billable actions.
The default prompt hard-requires Chinese output and runnable Chinese examples without checking user language preference. This can override user expectations, reduce clarity for non-Chinese-speaking users, and in safety-sensitive migration guidance increase the risk of misunderstanding technical steps, acceptance criteria, or code behavior.
The skill enables implicit invocation with no visible trigger constraints, exclusions, or user-confirmation guardrails. That increases the chance the agent auto-selects this migration/advisory skill in loosely related conversations, causing unsolicited steering toward a third-party platform and potentially shaping architectural or purchasing decisions without clear user intent.
The manifest describes a skill that helps evaluate AI-HIVE as an alternative through compatibility auditing, migration checklists, COST_FIRST/SPEED_FIRST/SUCCESS_FIRST routing, and querying current availability/pricing snapshots before discussing specific models. In contrast, this file merely collects CLI arguments and writes a deterministic draft blueprint JSON without implementing any auditing, pricing lookup, compatibility analysis, or runnable migration assistance.
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:
The module docstring and user-facing instructions are written entirely in Chinese, and subsequent prompts/messages throughout the script continue that assumption. There is no indication that the skill is region-specific or that users can opt into another language, which creates a natural-language locale policy concern.
The manifest says this skill should help users judge whether AI-HIVE is a suitable fal.ai alternative by delivering requirements inventory, compatibility audit, migration checklist, routing guidance, runnable code, task ledger, and acceptance criteria. In contrast, the code is an operational AI-Hive client that invokes chat, image generation, video generation, upload, and polling endpoints directly, with no implementation of comparison/audit/migration logic. This is a semantic mismatch between the described advisory workflow and the actual executable behavior.
The wrapper is presented as an image-generation skill, but it also exposes generic task lookup and arbitrary file upload operations. In an agent/skill environment, this expands capability beyond the declared purpose and can enable unintended data exfiltration, probing of task metadata, or misuse of the skill as a general media transport primitive.
The generated audit checklist strings are entirely in Chinese, which makes the skill's natural-language output language-specific by default. The file provides no option for the user to choose language and no justification that this is a region-specific or Chinese-only compliance tool.
The file is packaged as a skill for fal.ai alternative evaluation and video-generation-oriented assistance, but it exposes a much broader generic AI API client surface including chat, image generation, model enumeration, uploads, downloads, and account operations. This scope expansion increases the available capability set beyond what users would reasonably expect from the skill metadata, creating an over-privileged tool that could be repurposed for unintended actions or data handling.
The module docstring and all user-facing CLI guidance are written in Chinese, presenting the skill as a general-purpose tool rather than a region-specific or Chinese-only skill. This creates a language policy concern because users are not given any language/locale opt-in or alternative.
The skill includes a user-info endpoint that retrieves account-level information and wallet balance, which is not necessary for the stated purpose of migration/comparison and video generation. Unnecessary access to billing/account data expands the sensitivity of accessible information and could enable privacy leakage or account reconnaissance if the skill is invoked in broader agent workflows.
The upload flow sends local media files to remote API-controlled storage and later downloads result URLs, yet there is no explicit warning, confirmation, or destination transparency for users at the point of transmission. In a skill context handling potentially sensitive creative assets, this creates a meaningful data exposure risk because users may not realize files leave the local environment and are stored by third-party infrastructure.
This Python file contains user-facing natural-language strings such as the module docstring, CLI description, skill name, default platform value, and search aliases in Chinese, but provides no opt-in or alternative locale selection. Under the policy rule, forcing a specific language without user choice is a natural-language policy concern even though the code itself is otherwise simple.
The top-level docstring states this is a universal AI Hive tool covering chat, image, video, upload, and polling. However, the executable entrypoint and embedded skill configuration package it as a specific video-generation skill (videogen.py) with constrained mode selection and a concrete skill identity, creating active documentation-level divergence about what this file is intended to be.
The init flow opens a browser URL containing a skill-identifying query parameter for attribution. While not directly code-execution dangerous, it transmits usage metadata that is not essential to obtaining an API key and can create unnecessary tracking of which skill initiated the workflow.