T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
API Credential Disclosure Through an Unrestricted Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a disclosed AI-HIVE media-generation helper, but it gives API-key-bearing network code too much destination flexibility for a billable service.
Review before installing. Use this only with an AI-HIVE account and expect it to store or read an AI-HIVE API key, upload selected media, submit potentially billable image or video jobs, poll tasks, and download results. Do not set --base-url or AI_HIVE_BASE_URL unless you fully trust the endpoint, and prefer a limited or disposable API key until destination validation is added.
scripts/imagegen.py:91API Credential Disclosure Through an Unrestricted Base URL
scripts/imagegen.py:266Unvalidated Server-Controlled Upload and Download Destinations
This skill is described as a dual image-model relay, but the documented behavior includes video generation modes and additional account/chat capabilities that are outside the declared scope. Such scope drift is risky because it can cause the wrong skill to activate, expose users to unexpected media handling or data flows, and bypass policy expectations tied to an image-only gateway.
This skill is described as a dual image-model relay, but the documented behavior includes video generation modes and additional account/chat capabilities that are outside the declared scope. Such scope drift is risky because it can cause the wrong skill to activate, expose users to unexpected media handling or data flows, and bypass policy expectations tied to an image-only gateway.
The file is presented as an image-relay skill for GPT Image 2/Nano Banana, but it actually contains broad video-generation capabilities and generic AI API operations. This mismatch expands the effective capability surface beyond what users and reviewers would reasonably expect, increasing the risk of unauthorized or surprising actions and weakening trust and policy enforcement.
The inline configuration and parser text explicitly brand the tool as an image-relay skill while routing users into a video-generation workflow. This kind of deceptive or inaccurate labeling can bypass human review expectations, cause misuse under false assumptions, and hide materially different data handling and output behavior.
The skill advertises executable workflows involving shell commands, environment variables, file access, and network calls, but it declares no explicit tool scope or permission boundaries. In an agent environment, this can lead to overbroad capability exposure, making it easier for the skill to trigger unintended external calls, read local files, or write artifacts without clear least-privilege constraints.
The trigger phrase '生图接口' is generic enough to match many unrelated image-generation requests, which can cause accidental or overbroad skill activation. In a skill that references external APIs, uploads, and potentially billable generation tasks, unintended activation raises the risk of data disclosure, misrouting, or unnecessary execution of higher-risk workflows.
The trigger phrase 'AI中转站' is highly ambiguous and may activate for many unrelated AI gateway or relay discussions. Because this skill is positioned to handle external API orchestration and possibly paid generation workflows, ambiguous invocation increases the chance of unintended data handling, incorrect guidance, or users being steered into an inapplicable external service path.
The default prompt hard-codes Chinese output ('production-ready Chinese workflow') regardless of the user's language preference. This is not a classic security flaw, but it can override user intent and create prompt steering behavior that may reduce transparency or cause unintended data handling in multilingual contexts.
The file embeds Chinese-language titles and aliases in the module docstring, argument parser description, skill name, and search aliases, with no indication that the skill is region-specific or that users can choose their preferred language/locale. This creates a natural-language locale constraint that is not justified or presented as opt-in.
The top-level docstring states this file is a '通用 AI 能力调用工具' that encapsulates text chat, image generation, video generation, model queries, media upload, and task polling. However, the actual skill entrypoint is skill_main() at L825-L844, whose parser only exposes generate, task, upload, and init, with generate hard-wired to image generation via cmd_image; chat/video/model-list functionality is not part of the skill's actual interface.
The module docstring and subsequent user-facing CLI messages are written in Chinese, indicating the skill is designed to operate in a specific language. There is no opt-in, fallback, or documented justification that this is a region-specific skill, so it can violate language/locale policy expectations.
This code file contains natural-language strings and help text exclusively in Chinese, beginning with the module docstring and continuing throughout the CLI UX. The policy scope includes language/locale violations in natural-language content, and the file does not offer users any language choice or opt-in.
Exposing account/user-info, model enumeration, and generic chat functions goes beyond the advertised image-relay purpose and creates unnecessary access to broader platform functions. Even if individually legitimate, these extra operations violate least privilege and can enable data exposure or unreviewed use paths if this skill is trusted only for image relay.
The script writes JSON output to a filesystem path provided by --output, creating parent directories as needed, but the only user-facing message appears after the write completes. There is no prior warning, confirmation, or explanatory comment/docstring describing that the command will create directories and overwrite/write a local file.
The comment says the browser is opened with a from=cli-skill query parameter '为后端归因预留', suggesting a narrow attribution purpose. In practice, the code also appends skill={skill_name} to the URL, which sends the specific skill identifier to the remote service; that is more than the comment describes and changes the user-visible intent of the request.