T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:94- 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 an AI-HIVE migration and media-generation helper, but it bundles high-impact API-key, upload/download, account-query, custom-host, and mismatched Token Hub behaviors that need review before installation.
Review this skill before installing. Use it only for explicit AI-HIVE migration or media-generation testing, prefer an environment variable over the init command for API keys, do not set a custom base URL unless you fully trust it, avoid uploading sensitive or unauthorized media, and run billable generation commands only with a clear budget and output location.
scripts/imagegen.py:94Bearer Credential Disclosure Through an Unrestricted API Base URL
scripts/imagegen.py:7Unpinned Third-Party Dependency Installation
This finding describes several undeclared high-risk behaviors: querying user account and wallet data, interactive API-key setup, writing credentials to local configuration, uploading local media, and saving remote outputs locally. Those actions involve secrets, billing, and data exfiltration pathways, so disguising them inside a 'migration assessment' skill can mislead users into granting dangerous access they did not anticipate.
This finding describes several undeclared high-risk behaviors: querying user account and wallet data, interactive API-key setup, writing credentials to local configuration, uploading local media, and saving remote outputs locally. Those actions involve secrets, billing, and data exfiltration pathways, so disguising them inside a 'migration assessment' skill can mislead users into granting dangerous access they did not anticipate.
This finding describes several undeclared high-risk behaviors: querying user account and wallet data, interactive API-key setup, writing credentials to local configuration, uploading local media, and saving remote outputs locally. Those actions involve secrets, billing, and data exfiltration pathways, so disguising them inside a 'migration assessment' skill can mislead users into granting dangerous access they did not anticipate.
This finding describes several undeclared high-risk behaviors: querying user account and wallet data, interactive API-key setup, writing credentials to local configuration, uploading local media, and saving remote outputs locally. Those actions involve secrets, billing, and data exfiltration pathways, so disguising them inside a 'migration assessment' skill can mislead users into granting dangerous access they did not anticipate.
The skill advertises and includes executable workflows that rely on shell, network, environment variables, and file I/O, but it declares no explicit tool scope or permission boundaries. This creates a confused-deputy risk where the runtime may grant broader capabilities than users expect, including local file access, outbound requests, and secret handling during migration or media-generation flows.
Overly broad triggers like '模型API', 'API聚合', '图片API', and '视频API' can cause the skill to activate for unrelated requests. In a skill with network, file, and generation capabilities, excessive invocation scope increases the chance of accidental tool use, irrelevant data handling, or steering users into promotional/vendor-specific workflows when they asked for something else.
The '什么时候使用' section defines broad activation conditions without strong boundaries, so the skill may be invoked ambiguously across many unrelated requests. Given the skill's operational and potentially billable behaviors, ambiguous scope raises the risk of unintended execution, user confusion, and inappropriate access to files, networks, or third-party services.
The natural-language instruction explicitly requires runnable Chinese examples, which imposes a language preference without any opt-in mechanism visible in this file. Under the language/locale policy, forcing a specific language is a violation unless the skill offers user choice or clearly documents a justified regional constraint.
The skill enables implicit invocation with no trigger constraints, exclusions, or narrowing conditions, which increases the chance that it is auto-selected in unrelated conversations. Because this skill is designed to influence migration decisions and generate runnable code, broad automatic activation can cause unsolicited steering, unintended disclosure of context into the skill flow, or overreach beyond user intent.
The script's user-facing description and embedded skill metadata are presented in Chinese-only strings such as the module docstring, argparse description, and search aliases. This imposes a specific language choice on users without offering a language option or documenting a justified region-specific constraint.
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 file contains user-facing natural-language descriptions entirely in Chinese, including the module docstring and operational guidance, with no indication that another language is supported. Per policy, forcing a specific language or locale without user opt-in is a natural-language policy violation unless the constraint is explicitly documented and justified.
The wrapper presents itself as an image-generation skill, but it still exposes generic task lookup and upload operations that are broader than the declared purpose. This expands the attack surface and can let a caller use the skill as a general API utility, including probing task metadata or staging arbitrary uploads not necessary for the image-only workflow.
The image-focused wrapper exposes an upload command that accepts any file path and routes it through the generic media upload flow, which supports non-image MIME types such as video and audio. In this skill context, that capability is unnecessary and can be abused to upload unrelated content, bypassing the principle of least privilege for an image-only tool.
The user-facing checklist entries and note are written entirely in Chinese, and the script provides no option to select another language or indicate that the skill is intentionally region-specific. This creates a natural-language locale policy concern because the skill effectively constrains output language without user opt-in.
The manifest describes a consultative skill for alternative assessment, compatibility auditing, migration checklists, routing guidance, and deliverable generation around SiliconFlow replacement decisions. In contrast, this file implements direct operational capabilities for chat, media upload, image/video generation, task polling, file download, and API key initialization, which is broader and materially different from an evaluation/migration-focused advisor skill.
The module docstring presents the skill entirely in Chinese and describes it as a general-purpose AI tool, but it does not indicate that the language is optional or region-specific. For a general skill, forcing a specific language without opt-in is a natural-language policy concern under the locale/language rule.
The manifest context is for "siliconflow-alternative-ai-hive", but the embedded SKILL_CONFIG names the skill "token-hub-cost-router-ai-hive" and frames it as creating a marketing video for Token Hub. This indicates the shipped code is configured for a separate promotional/video-generation scenario rather than the declared SiliconFlow-alternative analysis and migration use case.
The script writes structured data to a user-specified path using write_text, which can overwrite an existing file, but the code provides no confirmation prompt, warning comment, or explanatory docstring about this side effect. Although it prints the resolved output path afterward, that happens only after the write and does not function as prior disclosure.