T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer API Key Can Be Transmitted to an Arbitrary Configurable Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill can run paid AI-HIVE generation workflows, upload media, and persist API keys locally, with credential handling that is not clearly aligned with its own safety claims.
Review this skill before installing. Use an environment variable for the AI-HIVE API key instead of the init command, do not use a custom base URL unless you fully trust it, expect selected local media to be uploaded to AI-HIVE/object storage and generated files to be downloaded locally, and run only small authorized test jobs because the scripts can consume paid account credits.
scripts/imagegen.py:91Bearer API Key Can Be Transmitted to an Arbitrary Configurable Endpoint
scripts/imagegen.py:593API Key Is Persisted Through a Non-Atomic, Symlink-Following Plaintext Write
This finding describes interactive API-key setup, browser opening, local configuration writes, media uploads/downloads, and direct AI generation despite the skill being presented primarily as an evaluation and migration advisor. Such undisclosed credential-handling and execution behavior is dangerous because it can lead users to enter secrets, modify local configuration, and initiate costly or privacy-sensitive actions without appropriately informed consent.
This finding describes interactive API-key setup, browser opening, local configuration writes, media uploads/downloads, and direct AI generation despite the skill being presented primarily as an evaluation and migration advisor. Such undisclosed credential-handling and execution behavior is dangerous because it can lead users to enter secrets, modify local configuration, and initiate costly or privacy-sensitive actions without appropriately informed consent.
This finding describes interactive API-key setup, browser opening, local configuration writes, media uploads/downloads, and direct AI generation despite the skill being presented primarily as an evaluation and migration advisor. Such undisclosed credential-handling and execution behavior is dangerous because it can lead users to enter secrets, modify local configuration, and initiate costly or privacy-sensitive actions without appropriately informed consent.
This finding describes interactive API-key setup, browser opening, local configuration writes, media uploads/downloads, and direct AI generation despite the skill being presented primarily as an evaluation and migration advisor. Such undisclosed credential-handling and execution behavior is dangerous because it can lead users to enter secrets, modify local configuration, and initiate costly or privacy-sensitive actions without appropriately informed consent.
The implementation materially exceeds the declared skill purpose: instead of only helping evaluate or compare WaveSpeedAI alternatives, it provides a full-featured AI Hive client that can upload local media, submit generation jobs, poll tasks, and download remote outputs. This capability mismatch is dangerous because users or orchestrators may grant the skill trust and permissions appropriate for advisory analysis, while the code performs active external operations and data transfer to a third-party service.
The embedded SKILL_CONFIG repurposes the file into a Token Hub image-generation skill, which conflicts with the published WaveSpeedAI-alternative evaluator identity. Hidden or conflicting in-file configuration increases the risk of deceptive behavior, causing the runtime behavior, model choice, and user intent routing to differ from what reviewers and users expect.
The file implements a broad, generic AI client with chat, image/video generation, model enumeration, media upload, and task polling, which materially exceeds the manifest’s stated purpose of evaluating WaveSpeedAI alternatives and migration suitability. This scope expansion creates unnecessary access to sensitive account-backed capabilities and increases the chance the skill is used to perform actions the user did not expect, especially because it can consume credits and process arbitrary media.
The skill advertises and demonstrates capabilities that imply shell execution, network access, file I/O, and environment-variable use, but it does not declare any tool scope or permission boundaries. In an agent environment, this creates an authorization ambiguity where powerful operations may be invoked without clear least-privilege constraints, increasing the risk of unintended command execution, local file access, secret exposure, or remote uploads.
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 user-facing natural-language descriptions, prompts, and CLI guidance exclusively in Chinese. Because the skill does not provide an opt-in language/locale choice or justify a China-specific locale requirement, it appears to force a specific language on all users.
The module docstring and user-facing guidance are written exclusively in Chinese, and later prompts/help text continue this pattern, effectively imposing a specific language on users. The policy allows locale constraints only when documented and justified or when users are given a choice, which is not present here.
The skill can query user account information and wallet balance via get_user_info, which is not necessary for an advisory or migration-comparison skill. Access to billing-related metadata can disclose sensitive account state and normalize overprivileged behavior beyond the user’s apparent intent.
The interactive onboarding flow opens a browser, guides users to generate an API key, and stores the credential locally in ~/.ai-hive/config.json. For a skill whose declared role is advisory/comparative, this credential collection and persistence is out of scope and increases the risk of secret exposure, misuse of paid APIs, and unexpected account linkage.
The natural-language content of the skill, including the description and all user-facing instructions, is presented only in Chinese. Under the stated policy, forcing a specific language without giving the user a choice or documenting a justified locale restriction is a language/locale policy violation.
The display name and description are written in Chinese, and the default prompt explicitly requests runnable Chinese examples. This imposes a language/locale preference in the skill’s natural-language interface without documenting user opt-in or offering an alternative language choice.
The file includes user-facing natural-language strings in Chinese, such as the module description, CLI description, default platform value, and search aliases, with no indication that the user can choose a preferred language or locale. This may violate a language/locale policy when the skill is expected to be language-neutral unless users explicitly opt in.
The skill automatically downloads generated outputs to a default local directory without prominent disclosure in the manifest. While the files come from task result URLs rather than arbitrary local execution, silent writes can expose sensitive generated content on disk, create storage surprises, and weaken user expectations about side effects.