T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Arbitrary API base URL can expose bearer credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a disclosed AI-HIVE client, but it handles persistent API keys and media files with under-scoped safeguards that users should review before installing.
Install only if you intend to use AI-HIVE with your own authorized API key. Keep the API key scoped and revocable, avoid custom base URLs unless you fully trust the endpoint, review where downloads are written, and prefer an isolated environment with pinned dependencies.
scripts/imagegen.py:91Arbitrary API base URL can expose bearer credentials
scripts/imagegen.py:399Server-controlled task fields permit output path traversal
SKILL.md:115Runtime dependency installation is not version or integrity pinned
The declared description presents a full enterprise AI gateway/product capability set centered on aggregating model APIs, routing requests, managing credentials and quotas, auditing usage, and handling async media-generation tasks. The actual code does none of this. It only parses command-line arguments and writes a JSON file labeled as a production brief with fields like project, audience, goal, platform, format, required facts, and artifacts. While some labels and aliases reference the declared domain, the implemented behavior is materially different and far narrower. Therefore this is a clear description-behavior mismatch.
The description presents a broad enterprise gateway/product capability: organizing multiple model interfaces into a unified入口, managing keys/models/routing/quotas/audits/asynchronous tasks, and serving as an AI Gateway/cost router. The supplied code does not implement such a gateway or management plane. Instead, it is a client-side command-line tool that calls AI-HIVE’s existing hosted API. It supports API-key setup, querying user info/models, uploading media, invoking chat/image/video generation, polling tasks, and downloading outputs. The skill-specific entrypoint hardcodes a single image model (public_model_gpt_image_2) for generate/task/upload operations. While the code does include routing mode selection and async task polling, those are consumer features of the remote AI-HIVE API, not a local enterprise gateway managing multiple upstream providers, quotas, or audits. Therefore the actual behavior is materially narrower and different from the declared primary purpose.
The skill advertises and demonstrates shell execution, environment-variable use, file I/O, and networked scripts, but it does not declare any tool scope such as permissions or allowed-tools. That creates an authorization gap: hosts or reviewers cannot easily constrain what the skill may do, increasing the chance of overbroad execution, secret exposure, or unintended command/network activity when the example commands are followed.
The display name, summary, description, and metadata specify zh-CN and all user-facing documentation is written in Chinese, with no indication that users may choose another language. This creates a natural-language locale constraint that is not presented as optional or justified as region-specific compliance behavior.
The skill enables implicit invocation without any trigger constraints, exclusions, or scoping, which can cause the agent to activate this skill in contexts the user did not explicitly request. Because this skill is positioned around enterprise AI gateways, routing, keys, quotas, and audit workflows, unintended activation could expose sensitive operational guidance or cause the model to overreach into security-relevant configuration decisions.
The manifest describes a skill for organizing model APIs into a unified enterprise AI gateway with key management, routing, quotas, auditing, and async task handling. This file instead generates a local JSON 'production brief' with fields like audience, storyboard artifacts, and publishing facts, which is a content-planning function rather than AI gateway management.
The docstring and CLI description present the script as being for '企业AI网关与成本路由', suggesting gateway-related output. However, the generated JSON contains fields such as '人物板', '故事板', '场景板', and '逐镜提示词', which contradict that framing and indicate a drama/content preproduction brief instead of gateway operations.
The file’s natural-language description and generated content are hard-coded in Chinese, including the docstring, CLI description, and output fields. There is no indication that the user can choose language or that the Chinese-only behavior is a justified locale-specific constraint, which conflicts with the policy against forcing a specific language without opt-in.
The module docstring presents the skill interface and instructions only in Chinese, which imposes a specific language on users without offering an alternative or opt-in. Under the stated policy, forcing a language or locale without user choice is a natural-language policy violation.
User-facing strings throughout the script, including errors, help text, status messages, and initialization prompts, are all in Chinese. Because the skill does not offer a language option or document a justified locale limitation, this is a language-policy issue rather than just a stylistic choice.
This Python file is in scope for SQP-3 because policy violations can appear in docstrings, help text, and other natural-language strings. The top-level description, CLI help, prompts, and error messages are written exclusively in Chinese, which imposes a language choice on users without offering an alternative or opt-in path.
The manifest frames this skill as a short-drama/video-generation gateway capability, but the skill-facing CLI also exposes standalone task querying and arbitrary upload operations. Those operations are not just implementation details of generate; they let callers use the skill as a generic account/task/media utility rather than a focused short-drama video generator.
The display name, short description, and default prompt are written only in Chinese, which can imply a fixed language/locale experience without an explicit user opt-in or documented regional constraint. Under the language/locale policy, this may be a natural-language policy concern unless the skill is intentionally region-specific and that limitation is stated.
The example value for api_key includes Chinese text (请替换为你的APIKey), which imposes a specific language in user-facing configuration content. There is no indication that this locale choice is optional or justified as region-specific, so it may violate the language/locale policy.
For a skill presented as an AI gateway/video-generation tool, automatically launching a browser to an external chat/login page and appending from=cli-skill&skill=... introduces a user-environment interaction and attribution capability outside core model routing/generation behavior. This is not necessary to perform generation itself once credentials are supplied.