T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
AI-HIVE API Key Can Be Sent to an Arbitrary Configured Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is broadly an AI-HIVE migration and media-generation helper, but it needs review because it can upload local files, submit billable jobs, and handle API keys in ways that are broader or less clearly documented than its main description suggests.
Review this skill before installing. Use it only if you intend to use AI-HIVE as an operational provider, not just read a neutral comparison. Treat uploads as external data transfer and generation as potentially billable. Prefer an environment variable for the API key, avoid the init flow unless you accept plaintext local storage, keep AI_HIVE_BASE_URL and --base-url pointed only at the official AI-HIVE endpoint, and test only with non-production media and limited budgets.
scripts/imagegen.py:91AI-HIVE API Key Can Be Sent to an Arbitrary Configured Endpoint
scripts/imagegen.py:638API Key Is Persisted in a Plaintext Configuration File
scripts/imagegen.py:7Runtime Dependency Installation Is Unpinned and Unverified
Directly invoking AI-HIVE generation APIs, querying wallet/account data, uploading files, polling jobs, and downloading outputs goes well beyond a generic alternative-evaluation skill. In this context, the mismatch is especially risky because the skill is framed as neutral migration guidance while it may steer users into production actions, incur charges, access local content, and persist credentials.
Directly invoking AI-HIVE generation APIs, querying wallet/account data, uploading files, polling jobs, and downloading outputs goes well beyond a generic alternative-evaluation skill. In this context, the mismatch is especially risky because the skill is framed as neutral migration guidance while it may steer users into production actions, incur charges, access local content, and persist credentials.
Directly invoking AI-HIVE generation APIs, querying wallet/account data, uploading files, polling jobs, and downloading outputs goes well beyond a generic alternative-evaluation skill. In this context, the mismatch is especially risky because the skill is framed as neutral migration guidance while it may steer users into production actions, incur charges, access local content, and persist credentials.
Directly invoking AI-HIVE generation APIs, querying wallet/account data, uploading files, polling jobs, and downloading outputs goes well beyond a generic alternative-evaluation skill. In this context, the mismatch is especially risky because the skill is framed as neutral migration guidance while it may steer users into production actions, incur charges, access local content, and persist credentials.
The file claims to implement a Replicate-alternative assessment/migration helper, but the actual code is a generic AI-Hive API client for chat, upload, image, and video generation. This mismatch is dangerous because users or an agent may invoke the skill expecting advisory behavior while instead performing networked actions, file uploads, task polling, and content generation against a third-party service, creating scope confusion and unintended data disclosure.
The embedded SKILL_CONFIG hardcodes a Token Hub image-generation use case that does not match the advertised Replicate-alternative consultation skill. This hidden repurposing increases the risk of deceptive execution paths, where a caller believes they are getting analysis or migration guidance but the skill instead routes prompts and files to a specific image model and external API provider.
The implemented skill behavior materially exceeds the manifest’s stated purpose of evaluating Replicate alternatives and migration options. Instead of limiting itself to advisory/comparison workflows, it performs direct media upload, task submission, and video generation against a third-party API, which creates a capability mismatch that can trigger unintended paid actions, external data transfer, and execution of higher-risk operations under a misleading skill identity.
The skill advertises and demonstrates capabilities that require shell, network, file read/write, and environment-variable access, but it does not declare any tool scope or permission boundaries. This creates a confused-deputy risk: an agent may execute filesystem, network, or shell actions the user did not explicitly consent to, including handling API keys and local media files.
The trigger phrases are broad enough to match many generic questions about model APIs, aggregation, or content generation, causing over-activation. Over-broad activation is dangerous here because the skill appears to have operational capabilities; accidental invocation can expose users to unwanted vendor steering, file/network actions, or billed API workflows.
The activation criteria are ambiguous and overlap with ordinary AI-platform and content-generation use cases, so the skill may trigger in contexts where the user did not ask for migration analysis. Given the surrounding capability set, such misrouting can lead to unnecessary collection of requirements, handling of local media, or progression toward external API use under the wrong context.
The default prompt hard-codes Chinese output regardless of user preference, which can override expected interaction language and reduce transparency or usability for users who did not request Chinese. While not a direct security flaw, it can contribute to misleading or unintended behavior when the skill is auto-invoked, especially in mixed-language contexts.
The skill enables implicit invocation without any visible trigger constraints, which can cause the agent to auto-apply this migration/comparison skill in conversations that only loosely match related terms. That increases the chance of unrequested steering, unintended disclosure of user context into the skill workflow, or inappropriate influence over model/vendor selection decisions.
The script description and generated metadata are entirely oriented around Chinese-language naming and values, including the skill title, default platform value, and search aliases, without offering any language or locale choice. This can violate language/locale policy because it imposes a specific locale behavior on all users rather than making it optional or explicitly justified.
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 strings and help text in Chinese, beginning with the module docstring and continuing throughout the CLI experience. Because the skill does not offer language selection or justify a Chinese-only locale, it may violate a language/locale policy requiring user choice or explicit scope.
The skill opens a browser, guides the user through API-key creation, and stores credentials locally, despite the declared purpose being advisory comparison/migration help. In this context, the onboarding flow is riskier because it can socially steer users into authorizing a third-party service and entering secrets under the guise of a non-operational advisory skill.
This Python file embeds all user-facing checklist and note text in Chinese, with no option for the user to choose language and no comment or documentation indicating that the skill is intentionally region-specific. That creates a natural-language locale policy concern because the skill effectively enforces a specific language in its generated audit output.
This code file contains user-facing natural-language documentation entirely in Chinese, describing the tool and its usage without indicating that other languages are supported. Under the policy rule for language/locale choice, this can amount to forcing a specific language without user opt-in.
The file includes broad account bootstrapping and API interaction capabilities such as browser-assisted API key setup, model enumeration, task management, upload, and direct inference operations. For a skill advertised as comparison/advisory guidance, these extra capabilities expand the attack surface and increase the chance that users disclose credentials or invoke external services without understanding that the skill is acting as a full API client rather than an evaluator.
This code writes a JSON file to a user-specified path, which can create or overwrite local files, but there is no confirmation prompt or explicit warning beyond the generic CLI arguments. The script's brief docstring and argparse description do not clearly disclose that it will write output to disk at the provided path.