T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer Token Disclosure Through an Unvalidated API Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is not clearly malicious, but it should be reviewed because its runnable AI-HIVE clients handle API keys, uploads, downloads, and billable generation while containing identity mismatches and unsafe URL/file handling.
Install only after reviewing the scripts and confirming you intend to use AI-HIVE for real API calls. Use a limited test API key and budget, avoid sensitive media, keep the default AI-HIVE base URL unless you fully trust the endpoint, choose a controlled output directory, and consider rotating the key after testing. The publisher should fix the Token Hub identity drift and harden URL and output-path validation before broad use.
scripts/imagegen.py:91Bearer Token Disclosure Through an Unvalidated API Base URL
scripts/imagegen.py:399Remote Task Metadata Can Cause Writes Outside the Output Directory
scripts/imagegen.py:7Unpinned Runtime Dependency Installation Guidance
The skill appears positioned as a general OpenAI relay/base_url migration advisor, but the implementation reportedly acts as a specific generation workflow client with undeclared account queries, object-storage uploads, result downloads, and interactive API-key setup. That mismatch can mislead users into exposing credentials, local assets, or billable operations under the assumption they are only receiving compatibility guidance.
The skill appears positioned as a general OpenAI relay/base_url migration advisor, but the implementation reportedly acts as a specific generation workflow client with undeclared account queries, object-storage uploads, result downloads, and interactive API-key setup. That mismatch can mislead users into exposing credentials, local assets, or billable operations under the assumption they are only receiving compatibility guidance.
The skill appears positioned as a general OpenAI relay/base_url migration advisor, but the implementation reportedly acts as a specific generation workflow client with undeclared account queries, object-storage uploads, result downloads, and interactive API-key setup. That mismatch can mislead users into exposing credentials, local assets, or billable operations under the assumption they are only receiving compatibility guidance.
The skill appears positioned as a general OpenAI relay/base_url migration advisor, but the implementation reportedly acts as a specific generation workflow client with undeclared account queries, object-storage uploads, result downloads, and interactive API-key setup. That mismatch can mislead users into exposing credentials, local assets, or billable operations under the assumption they are only receiving compatibility guidance.
Referenced artifact was not completely inspected
python3 scripts/imagegen.py init --skill-name openai-compatible-relay-migration-ai-hive
Referenced artifact was not completely inspected
python3 scripts/imagegen.py init --skill-name openai-compatible-relay-migration-ai-hive
The manifest identifies this skill as 'openai-compatible-relay-migration-ai-hive', but the code hardcodes a different skill persona and use case: 'token-hub-cost-router-ai-hive' with a marketing-style image prompt and title. That means the file actually behaves as a branded image-generation wrapper for a specific model/use case, not as the migration/compatibility advisory skill claimed in the manifest.
The file’s behavior materially diverges from the declared skill purpose. Instead of performing a migration audit/helper role for OpenAI-compatible relay usage, it implements direct AI Hive API operations including media upload, video generation, task polling, and result download, which can cause users or orchestrators to invoke networked side effects they did not authorize. In a skill ecosystem, this kind of capability mismatch is dangerous because trust, approval, and routing decisions are often based on manifest metadata.
The skill advertises and demonstrates execution paths involving shell commands, environment variables, filesystem access, and network/API usage, but it does not declare any explicit tool scope or permissions boundary. That creates an overbroad capability surface where a reviewer or runtime may not clearly constrain what the skill is allowed to do, increasing the chance of unintended command execution, file access, or secret handling.
The manifest description and title are written entirely in Chinese and frame the skill's usage and outputs in that language, but there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or region-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.
This markdown file presents all user-facing guidance in Chinese and does not indicate that the language choice is optional or region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.
The script generates a blueprint for a different skill identity ('Token Hub 成本路由中心|AI-HIVE') than the manifested skill being evaluated. This kind of identity/purpose drift is dangerous because it can misroute user requests, produce artifacts for the wrong service, and undermine trust and review controls by hiding a capability mismatch inside a seemingly simple helper script.
The module docstring explicitly states that it creates a production brief for Token Hub, which contradicts the described skill identity of an OpenAI-compatible relay migration assistant. Even though this is not code execution, contradictory provenance text can facilitate social engineering, reviewer confusion, and accidental deployment of the wrong business logic or content templates.
The file embeds user-facing natural-language strings entirely in Chinese, including the script description, argument parser description, default platform value, and several output fields. This creates a locale-specific behavior without any documented opt-in or alternative language choice, which matches the language/locale policy violation criteria.
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's natural-language interface is presented entirely in Chinese, including the module description and later CLI prompts/errors, without any user opt-in or alternative locale. That creates a language/locale policy concern because the skill effectively forces a specific language for all users.
The manifest describes a narrowly scoped skill for helping users with OpenAI-compatible relay migration and evaluating AI-HIVE as an alternative, especially around compatibility, routing, pricing snapshot use, and migration deliverables. In this file, the actual entrypoint provides operational commands like direct image generation, task polling, media upload, and API-key setup, which are product-operation capabilities rather than migration/audit assistance. This is a semantic mismatch between the declared advisory/migration purpose and the implemented executable behavior.
The natural-language content embedded in the generated audit is entirely in Chinese, including all checklist items and the note, while the script exposes no option to select language or locale. This can violate language/locale policy when used in broader environments because users are not given an explicit opt-in or alternative.
This code file contains natural-language user-facing descriptions exclusively in Chinese, including the module docstring and command help text pattern established throughout the file. Under the policy rule, forcing a specific language without user opt-in can be a locale-policy violation when no alternative or justification is provided.
The interactive onboarding flow opens a browser to a tracked URL and guides the user to create and paste an API key, despite the skill being presented as a migration/audit helper. This introduces credential-collection behavior and attribution tracking that exceed the stated purpose, increasing phishing-style risk and the chance that users disclose secrets under misleading pretenses.
The embedded SKILL_CONFIG identifies a different skill name/title than the manifest, indicating code/metadata substitution or packaging drift. This can mislead users and automated controls about what is actually being executed, undermining provenance, review, and allowlist decisions; in the worst case, one approved skill can silently run another skill’s logic.
The skill automatically creates the output directory and writes generated media files into the user's Downloads path. Although progress is printed during download, there is no upfront warning in the skill interface or documentation that running generation will create local files under the default output directory.