T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- 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 is mostly a disclosed AI-HIVE media-generation workflow, but it needs review because it stores and uses an API key and can send that key to an arbitrary configured API endpoint.
Install only if you trust the AI-HIVE account integration and are comfortable storing an API key locally. Do not set or accept custom AI_HIVE_BASE_URL/base-url values unless you control the endpoint, use a limited API key, review commands before running them, and expect uploaded product media to be sent to the external AI-HIVE service.
scripts/imagegen.py:91Bearer Credential Disclosure Through an Unrestricted API Base URL
scripts/imagegen.py:7Unpinned Third-Party Dependency Installation
The skill claims a narrow, product-image-to-UGC-video purpose but reportedly includes undeclared capabilities such as generic chat, account or wallet retrieval, and model discovery while failing to provide several promised deliverables. Undeclared features expand the attack surface and can surprise users with access to account-related data or unrelated functions that were not consented to or reviewed in the skill description.
The skill claims a narrow, product-image-to-UGC-video purpose but reportedly includes undeclared capabilities such as generic chat, account or wallet retrieval, and model discovery while failing to provide several promised deliverables. Undeclared features expand the attack surface and can surprise users with access to account-related data or unrelated functions that were not consented to or reviewed in the skill description.
The skill claims a narrow, product-image-to-UGC-video purpose but reportedly includes undeclared capabilities such as generic chat, account or wallet retrieval, and model discovery while failing to provide several promised deliverables. Undeclared features expand the attack surface and can surprise users with access to account-related data or unrelated functions that were not consented to or reviewed in the skill description.
The packaged skill advertises product-image-to-UGC-video generation, but its exposed entrypoint only wires the generate command to cmd_image, not cmd_video. This capability mismatch is dangerous because agents and users may trust the skill to perform one bounded media task while it actually exposes different behavior, undermining policy gating, auditability, and informed user consent about what will be produced.
The skill advertises and demonstrates capabilities that require environment access, filesystem operations, shell execution, and network calls, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, this increases the risk of over-privileged execution, accidental secret exposure, unintended file access, or unauthorized outbound requests because neither users nor the platform can enforce least privilege from the manifest.
The skill content, triggers, headings, examples, and expected outputs are entirely written in Chinese, with no statement that users may choose another language. This can violate a language/locale policy when a skill implicitly requires a specific language without opt-in.
The default prompt hard-codes Chinese output and a specific workflow shape regardless of the user's language preference. While not a direct security flaw on its own, it can override user intent and reduce transparency, which is riskier here because the skill can drive external service operations and generated marketing content that the user may not fully understand or review.
The skill enables implicit invocation while its activation scope is described broadly in metadata and centered on marketing/e-commerce use cases. This increases the chance the agent auto-triggers the skill in adjacent contexts without clear user intent, which can cause unintended API actions, content generation, or uploads tied to a third-party service.
This code hard-codes the skill description, skill name, and search aliases in Chinese, including the CLI parser description and generated metadata. Under the policy rule, forcing a specific language or locale without offering a user choice can be a natural-language policy violation, and no opt-in or documented locale justification appears in this file.
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 describes the code as a general AI capability invocation tool covering chat, image, video, model query, upload, and polling, while the packaged skill claims a narrow specialized purpose. This inconsistency is a supply-chain transparency problem: reviewers and orchestrators may approve the skill under false assumptions, while the codebase actually carries broader operational capability.
This code file contains its primary docstring and most user-facing CLI messages in Chinese, including setup, error, and help text, but does not offer any language selection or indicate that the skill is intentionally China-region-specific. That creates a natural-language policy issue under the locale/language rule because the skill implicitly enforces one language for all users without opt-in.
The file contains a general-purpose chat subcommand that accepts arbitrary prompts and optional images, which exceeds the narrowly declared product-image-to-UGC-video skill scope. In a skill ecosystem, this creates unnecessary latent capability that can be invoked directly or repurposed to bypass least-privilege expectations, increasing prompt-injection and policy-scope risk.
The manifest describes a narrowly scoped skill for turning product images into UGC/e-commerce videos, but this file exposes generic chat, image generation, user-info, model listing, arbitrary media upload, and general task-query capabilities. Those operations are not merely hidden implementation details of the declared workflow; they make the script usable as a general-purpose AI-Hive API tool.
The top-level docstring and parser description explicitly label the program as a '通用 AI 能力调用工具' and enumerate text chat, image generation, model query, media upload, and polling features. That directly conflicts with the specialized manifest for a product-image-to-UGC-video skill, so the in-code documentation presents a materially different intent than the actual skill packaging claims.
This Python file contains user-facing descriptions, help text, status messages, and setup instructions almost entirely in Chinese, including the module docstring and CLI interaction text. Because the file does not offer a language choice or document a justified region-specific restriction, it violates the language/locale policy for natural-language content.
The user-info endpoint retrieves user information and wallet balance, and the CLI exposes it directly via cmd_user_info. Accessing account profile/balance data is not justified by the manifest’s stated purpose of transforming product images into marketing videos, and it introduces a separate capability unrelated to content generation.