T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer credential exposure 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 image/video helper, but its credential handling and download paths need review before installation.
Review this before installing if you will use real AI-HIVE credentials. Use only the official AI-HIVE base URL unless you fully trust a custom gateway, store a limited-scope key, rotate it if exposed, avoid uploading sensitive media unless intended, and choose an output directory where generated downloads cannot overwrite important files.
scripts/imagegen.py:91Bearer credential exposure through an unrestricted API base URL
scripts/imagegen.py:393Output-directory escape through unsanitized task metadata
scripts/imagegen.py:312Untrusted result URLs permit unbounded and unvalidated downloads
SKILL.md:113Unpinned third-party dependency installation
The skill presents itself as a production-grade AI gateway with key isolation, routing, quotas, auditing, async task handling, and model connectivity, but the described artifacts appear not to implement those controls. This mismatch can mislead users into trusting the skill with credentials or operational decisions under false assumptions, causing insecure deployments, secret exposure, and absence of promised safeguards.
The skill advertises and demonstrates use of shell execution, environment variables, file I/O, and network access, but does not declare any explicit tool scope or permissions. This weakens review and runtime policy enforcement, increasing the chance that the skill can access sensitive local files, invoke commands, or transmit secrets without clear user or platform constraints.
The skill’s display name, summary, description, and metadata specify and present the skill entirely in Chinese, including an explicit language: zh-CN value. There is no indication that users may choose another language or that the locale restriction is required for a region-specific compliance reason.
The manifest enables implicit invocation via allow_implicit_invocation: true without any visible trigger scoping, consent boundary, or contextual restriction. This can cause the skill to be auto-selected in situations the user did not explicitly intend, increasing the chance of unintended routing, disclosure of project context, or execution of sensitive workflow guidance in unrelated conversations.
The manifest promises functionality around organizing model interfaces, managing keys, routing, quotas, auditing, async tasks, and unified use of image/video models through AI-HIVE. This script does none of that; it simply collects CLI arguments and writes a static blueprint JSON file containing marketing/search metadata and planning fields.
This Python skill’s docstring and CLI guidance are written entirely in Chinese, and the user-facing prompts/errors throughout the file follow the same pattern. Because the skill does not offer any language or locale choice, it imposes a specific language on users, which matches the language/locale policy violation criteria.
The upload_media flow sends user-selected files first to the AI Hive API to obtain an upload token and then uploads the file contents to object storage. Although there is progress output, there is no explicit warning or confirmation that local media will be transmitted to external services, which is safety-relevant for privacy-sensitive files.
The manifest describes a focused entry for AI model relay/search and, in this concrete file, the embedded skill config presents a GPT Image 2 image-generation skill. However, the code also exposes generic subcommands for querying user account info, listing all models, chatting, generating video, and arbitrary media upload through the shared CLI handlers. Those capabilities go beyond a narrowly scoped image-generation/search entry and indicate behavior broader than the described skill intent.
The file presents itself as a short-drama video skill, but actually embeds a reusable client supporting text chat, image generation, model enumeration, uploads, and task polling. This mismatch can mislead reviewers and operators about what the skill is capable of, weakening least-privilege expectations and policy enforcement.
The module docstring presents the skill entirely in Chinese as a general-purpose tool, and there is no indication that the skill is region-specific or that users may choose another language. For a general skill, hard-coding a single language in user-facing instructions and output text can violate language/locale policy when no opt-in is provided.
The skill wrapper exposes initialization, task inspection, and raw media upload operations in addition to the advertised video-generation entrypoint. This expands the capability surface beyond the manifest framing, increasing the chance that a caller can use the skill as a more general API relay or account bootstrap tool than intended.
The string literal for the API key placeholder uses Chinese text only ("请替换为你的APIKey"), which imposes a specific language in user-facing configuration guidance. This is a natural-language locale policy concern because the file does not offer an alternative language or explain why a Chinese-only placeholder is required.
The docstring frames the script as creating a deterministic production brief for 'AI中转与AI中专关键词入口', but the body emits a generic draft JSON with fields like search aliases, required facts, and storyboard-style artifacts. This documentation overstates specificity and suggests operational relevance to the relay product that the code does not implement.
The natural-language strings in the docstring, CLI description, and generated content are fixed in Chinese, with no indication that the user can select another language or that the skill is intentionally limited to a Chinese-language context. This can violate language/locale policy when a skill implicitly enforces one language without opt-in or justification.
The script writes directly to a user-controlled output path and will overwrite an existing file without confirmation. In typical CLI use this is low risk, but it can still cause unintended data loss or clobber files if the user supplies a sensitive path, especially in automation contexts.
The polling workflow automatically creates an output directory and downloads result files to disk. While the code prints download progress, it does not clearly warn beforehand that files will be saved automatically under the default Downloads path, which may surprise users or affect local storage.
The skill's stated purpose is AI model/image generation access, but the init flow opens an external browser URL containing from=cli-skill and skill=<name> for backend attribution. That telemetry-oriented browser-launch behavior is not necessary to perform generation, upload, polling, or download, and is not surfaced in the manifest description.
The init flow launches a browser to a chat page with query parameters including the skill name and a source tag, which is an onboarding/attribution behavior rather than core model relay or video generation functionality. While user setup can be reasonable, embedding browser-driven referral-style navigation is not directly justified by the skill's declared operational purpose.