T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:585- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly does the advertised AI-HIVE image workflow, but its API-key handling can expose credentials if users supply a custom API URL or put the key on the command line.
Before installing, confirm you trust the AI-HIVE service and keep the default HTTPS endpoint. Do not pass the API key with --api-key, do not set AI_HIVE_BASE_URL or --base-url to an untrusted host, and expect selected reference media and prompts to be uploaded for billable generation after confirmation.
scripts/imagegen.py:585API Key Exposure Through Command-Line Arguments
scripts/imagegen.py:91Bearer Credential Can Be Sent to an Arbitrary or Plaintext Base URL
The skill claims AI-HIVE OpenAPI support for configuration lookup, uploads, routing, async polling, pricing snapshots, and downloads, but the provided content does not actually implement that behavior. This mismatch is dangerous because users or orchestrators may rely on nonexistent safeguards, audit trails, or operational steps, leading to unsafe assumptions around billing, data handling, and external task execution.
The skill advertises executable workflows and includes runnable shell/Python examples that imply use of environment variables, filesystem access, and network calls, but it does not declare an explicit tool scope such as allowed-tools or permissions. That creates an authorization ambiguity where an agent/runtime may grant broader capabilities than intended, increasing the risk of unintended command execution, file access, or outbound requests if this skill is invoked automatically.
The skill is entirely framed around Chinese-language Xiaohongshu use cases and presents its interface and outputs in Chinese without stating that users may choose another language. Because the policy category covers language or locale constraints, this is a natural-language locale assumption lacking explicit opt-in or documented limitation.
The invocation cues include broad phrases like “好物分享” and a general condition about turning a reference case into original content. These terms can arise in many ordinary conversations and the file does not provide negative examples or tighter activation boundaries for when the skill should or should not trigger.
The default prompt explicitly instructs the skill to produce a "production-ready Chinese workflow," which imposes a language choice by default. This is a natural-language policy concern because the file does not offer the user a language choice or indicate that Chinese is optional or region-specific.
The file is implemented as a general-purpose AI Hive client supporting chat, image, video, upload, model enumeration, and task polling, while the declared skill is a narrowly scoped Xiaohongshu image-studio tool. This scope mismatch creates capability overreach: if the hosting platform or downstream agent assumes the manifest accurately constrains behavior, users or other components may invoke broader functions than intended, weakening policy boundaries and increasing misuse risk.
The module documentation explicitly presents the file as a generic AI capability tool, contradicting the specialized skill description. This discrepancy is security-relevant because reviewers, orchestrators, or users may rely on metadata and docs to understand trust boundaries; inconsistent declarations make it easier to smuggle broader functionality under a narrower approval context.
The module docstring and nearly all user-facing prompts/help text are written only in Chinese, which effectively constrains the skill's interaction language. There is no opt-in, language selection mechanism, or documentation that this skill is intentionally limited to a Chinese-speaking or region-specific audience.
The text-chat command provides a materially different capability from the declared image-studio purpose and can be used as a generic LLM interface. In a skill ecosystem, hidden or undocumented extra capabilities are dangerous because they bypass user and reviewer expectations, and may be used to process sensitive prompts or generate content outside the approved use case.
The video-generation path expands the skill beyond its stated image-only studio role and introduces additional content-production functionality that may not be covered by the declared review scope. Extra media-generation capability increases abuse surface, cost exposure, and policy evasion opportunities because users can access a more powerful tool than the manifest suggests.
This code embeds the skill name and description entirely in Chinese in user-facing natural-language strings. Because the file provides no opt-in, fallback, or documented region-specific justification, it may violate a language/locale policy requiring user choice.