T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Arbitrary API Base URL Can Disclose the Bearer API Key
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches a media-generation workflow, but it ships under-scoped API tooling that can send API keys and uploaded media to configurable or server-supplied endpoints.
Install only if you trust the AI-HIVE endpoint and are comfortable storing an API key locally. Avoid custom base URLs, use a limited/revocable API key, review any uploaded files, and prefer --no-download or a controlled output directory until endpoint and filename validation are fixed.
scripts/imagegen.py:91Arbitrary API Base URL Can Disclose the Bearer API Key
scripts/imagegen.py:280Unvalidated Server-Controlled URLs and Filename Components Enable SSRF and Output Path Traversal
The Chinese finding describes the same core issue: the skill claims to focus on role consistency and reusable assets, while the actual behavior includes undeclared text chat, user-info/wallet access, model listing, and generic upload/download and video-generation features. In a skill that invites users to upload media and provide API keys, this discrepancy materially raises the risk of credential misuse, unexpected billing, or excessive data exposure.
The Chinese finding describes the same core issue: the skill claims to focus on role consistency and reusable assets, while the actual behavior includes undeclared text chat, user-info/wallet access, model listing, and generic upload/download and video-generation features. In a skill that invites users to upload media and provide API keys, this discrepancy materially raises the risk of credential misuse, unexpected billing, or excessive data exposure.
The Chinese finding describes the same core issue: the skill claims to focus on role consistency and reusable assets, while the actual behavior includes undeclared text chat, user-info/wallet access, model listing, and generic upload/download and video-generation features. In a skill that invites users to upload media and provide API keys, this discrepancy materially raises the risk of credential misuse, unexpected billing, or excessive data exposure.
The file implements a broad, generic AI client with chat, image, video, model listing, user-info, upload, task polling, and arbitrary base-URL support, while the manifest describes a narrowly scoped drama-character consistency skill. This mismatch materially expands the skill’s effective permissions and use cases, creating a capability-confusion risk where callers may unknowingly grant access to unrelated operations such as account info retrieval or arbitrary model invocation.
The embedded SKILL_CONFIG repurposes the skill for GPT Image 2 product/ad image generation and editing, which contradicts the declared drama-character consistency purpose. This indicates the distributed artifact is effectively a different skill than advertised, increasing the risk of deceptive routing, misuse of user prompts/assets for unintended workflows, and bypass of any policy review that depended on the manifest identity.
The embedded SKILL_CONFIG identifies the skill as a generic short-drama video generator rather than the manifest's character-consistency skill. This mismatch can cause an agent platform to grant or invoke materially different functionality than reviewers and users expect, undermining trust boundaries and enabling unauthorized use of broader video-generation flows.
The skill advertises executable scripts, environment-variable usage, network access, file I/O, and shell commands, but does not declare any explicit tool scope or permission boundaries. That makes the runtime capability set opaque to users and reviewers, increasing the risk of over-privileged execution, unintended data access, or network actions beyond the user’s expectations.
The file explicitly sets language: zh-CN, which indicates a fixed language/locale for the skill. The document does not offer an opt-in choice for other languages or explain that the skill is restricted to a China-specific compliance or regional use case, so this appears to violate the language/locale policy criteria.
The skill’s invocation surface is broad because the default prompt and short description invite general project assistance without strong boundaries on when the skill should activate or what inputs are in scope. Combined with allow_implicit_invocation: true, this can cause the agent to invoke the skill in contexts where the user did not explicitly request it, increasing the chance of unintended data exposure, prompt hijacking through user-supplied material, or inappropriate workflow execution.
The script hard-codes Chinese-language strings in the module description, CLI description, and generated data fields, which imposes a specific language/locale on users. There is no user opt-in or configurable language selection, so this is a natural-language policy concern under the locale-choice rule.
The module docstring explicitly presents the code as a generic AI capability tool rather than a specialized skill, reinforcing that the implementation is broader than the advertised identity. On its own this is descriptive text, but in security context it is a reliable indicator of scope mismatch that can mislead operators and reviewers about what the skill can actually do.
This code file contains user-facing natural-language strings and documentation in Chinese, including the module docstring and subsequent CLI help/messages, but it does not offer users any language or locale opt-in. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the restriction is clearly documented and justified.
The file is presented as a specialized short-drama/character-consistency skill, but the implementation exposes broader generic capabilities such as text chat, model enumeration, user info retrieval, and arbitrary media upload. In an agent-skill setting, this breaks least-privilege expectations and can let downstream users or orchestrators invoke actions outside the declared scope, increasing the chance of data exposure or policy bypass.
The module docstring explicitly describes a generic AI capability tool, contradicting the declared specialized skill intent. In security review terms, this kind of capability/identity mismatch is dangerous because operators may approve or route the skill under narrower assumptions while the code advertises and supports broader operations.
The module docstring and user-facing interface text are written in Chinese and present the tool as a general-purpose AI capability tool, but there is no indication that the user can choose another language or that the skill is intentionally region-specific. Because this is a natural-language policy issue applicable to all file types, the hardcoded Chinese-only interaction is a locale constraint without opt-in.
The example API key placeholder uses Chinese text ('请替换为你的APIKey'), which imposes a specific language in user-facing natural language. There is no indication that the skill is region-specific or that users can choose a locale, so this appears to violate the language/locale policy.